diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-26 13:14:02 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-26 13:14:02 +0200 |
commit | 9d806d3853c926df75e83966d2c4f832708a1b08 (patch) | |
tree | 97dd50a56751d5cb48b60353697aa9ccad9a3e14 /src/routing.go | |
parent | cf3a5130d3aa53fc56c7c3194ee326d5a1d21970 (diff) |
Begin work on outbound packet flow
Diffstat (limited to 'src/routing.go')
-rw-r--r-- | src/routing.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/routing.go b/src/routing.go index 553df11..4189c25 100644 --- a/src/routing.go +++ b/src/routing.go @@ -2,7 +2,6 @@ package main import ( "errors" - "fmt" "net" "sync" ) @@ -52,25 +51,3 @@ func (table *RoutingTable) LookupIPv6(address []byte) *Peer { defer table.mutex.RUnlock() return table.IPv6.Lookup(address) } - -func OutgoingRoutingWorker(device *Device, queue chan []byte) { - for { - packet := <-queue - switch packet[0] >> 4 { - - case IPv4version: - dst := packet[IPv4offsetDst : IPv4offsetDst+net.IPv4len] - peer := device.routingTable.LookupIPv4(dst) - fmt.Println("IPv4", peer) - - case IPv6version: - dst := packet[IPv6offsetDst : IPv6offsetDst+net.IPv6len] - peer := device.routingTable.LookupIPv6(dst) - fmt.Println("IPv6", peer) - - default: - // todo: log - fmt.Println("Unknown IP version") - } - } -} |