From 78de9f539dfbcc7eaf400601c80e24ba7230b910 Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 23 Oct 2023 18:37:05 -0400 Subject: moving sections --- pkg/ipstack/ipstack.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/ipstack/ipstack.go b/pkg/ipstack/ipstack.go index 725cc49..29a3cb9 100644 --- a/pkg/ipstack/ipstack.go +++ b/pkg/ipstack/ipstack.go @@ -369,13 +369,6 @@ func SprintRoutingTable() string { return tmp } -// prints the test packet as per the spec -func HandleTestPackets(src *Interface, message []byte, hdr *ipv4header.IPv4Header) error { - fmt.Printf("Received test packet: Src: %s, Dst: %s, TTL: %d, Data: %s\n", - hdr.Src.String(), hdr.Dst.String(), hdr.TTL, string(message)) - return nil -} - // ************************************** ROUTE FUNCTIONS ********************************************************** // cleans up the data structures and closes the UDP sockets @@ -933,6 +926,13 @@ func HandleRIP(src *Interface, message []byte, hdr *ipv4header.IPv4Header) error return nil } +// prints the test packet as per the spec +func HandleTestPackets(src *Interface, message []byte, hdr *ipv4header.IPv4Header) error { + fmt.Printf("Received test packet: Src: %s, Dst: %s, TTL: %d, Data: %s\n", + hdr.Src.String(), hdr.Dst.String(), hdr.TTL, string(message)) + return nil +} + // ************************************** CHECKSUM FUNCTIONS ****************************************************** // reference: https://github.com/brown-csci1680/lecture-examples/blob/main/ip-demo/cmd/udp-ip-recv/main.go func ComputeChecksum(b []byte) uint16 { -- cgit v1.2.3-70-g09d2