diff options
author | David Doan <daviddoan@Davids-MacBook-Pro-70.local> | 2023-10-05 23:32:06 -0400 |
---|---|---|
committer | David Doan <daviddoan@Davids-MacBook-Pro-70.local> | 2023-10-05 23:32:06 -0400 |
commit | 770a08b747233942fb19da529763f61987a804d6 (patch) | |
tree | 3c822fde32750780fe38f46b6f25e9642c1cec0f /cmd/pkg/protocol.go | |
parent | 7bb2015a1f2de7a31c3f2b3092a574602a2a3d53 (diff) |
file importing
Diffstat (limited to 'cmd/pkg/protocol.go')
-rw-r--r-- | cmd/pkg/protocol.go | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/cmd/pkg/protocol.go b/cmd/pkg/protocol.go deleted file mode 100644 index 84444c3..0000000 --- a/cmd/pkg/protocol.go +++ /dev/null @@ -1,66 +0,0 @@ -package pkg - -import ( - "net" - // "netip" -) - -const ( - MAX_IP_PACKET_SIZE = 1400 -) - -func Initialize(config IpConfig) (error) { - // ip config from go parser - - // initialize ip table - - // error check - - // different for router and host?? - // host - // create node interfaces? -} - -func ipRecv(data []byte) (error) { - // parse ip header - - // check ip checksum - - // check ip version - - // check ip length - - // check ip ttl - - // check ip protocol - - // check ip destination - - // check ip source - - // check forwarding table -} - -func ipForwarding(dst netip.Addr, protocolNum uint16, data []byte) (error) { - // send test packest to dst - - // lookup forwarding table - - // locally - - // not locally -} - -type HandlerFunc = func(*Packet, []interface{}) (error) { - - // do smth with packet -} - -func RegisterRecvHandler(protocolNum uint8, callbackFunc HandlerFunc) (error) { -} - -func routeRip() (error) { - // communicate with other routers - - // update forwarding table -} |