diff options
author | David Doan <daviddoan@Davids-MacBook-Pro-70.local> | 2023-10-23 18:37:05 -0400 |
---|---|---|
committer | David Doan <daviddoan@Davids-MacBook-Pro-70.local> | 2023-10-23 18:37:05 -0400 |
commit | 78de9f539dfbcc7eaf400601c80e24ba7230b910 (patch) | |
tree | fee5da740cb56a8f92a41a5d97abc08cdcb1b743 | |
parent | 24e1643ec354358241c71f578c20ebe76b60dfb7 (diff) |
moving sections
-rw-r--r-- | pkg/ipstack/ipstack.go | 14 |
1 files 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 { |