Another TODO to do
This commit is contained in:
parent
0005f827e5
commit
e37c4e48e2
1 changed files with 7 additions and 6 deletions
13
main.go
13
main.go
|
@ -142,7 +142,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------- Tables --------------------------------
|
// -------------------------------- Tables --------------------------------
|
||||||
routing := router.NewRoutingTable()
|
routes := router.NewRoutingTable()
|
||||||
zones := router.NewZoneTable()
|
zones := router.NewZoneTable()
|
||||||
zones.Upsert(cfg.EtherTalk.NetStart, cfg.EtherTalk.ZoneName, true)
|
zones.Upsert(cfg.EtherTalk.NetStart, cfg.EtherTalk.ZoneName, true)
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ func main() {
|
||||||
UDPConn: ln,
|
UDPConn: ln,
|
||||||
RemoteAddr: raddr,
|
RemoteAddr: raddr,
|
||||||
RecieveCh: make(chan aurp.Packet, 1024),
|
RecieveCh: make(chan aurp.Packet, 1024),
|
||||||
RoutingTable: routing,
|
RoutingTable: routes,
|
||||||
ZoneTable: zones,
|
ZoneTable: zones,
|
||||||
}
|
}
|
||||||
aurp.Inc(&nextConnID)
|
aurp.Inc(&nextConnID)
|
||||||
|
@ -186,7 +186,7 @@ func main() {
|
||||||
AARP: aarpMachine,
|
AARP: aarpMachine,
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
PcapHandle: pcapHandle,
|
PcapHandle: pcapHandle,
|
||||||
RoutingTable: routing,
|
RoutingTable: routes,
|
||||||
}
|
}
|
||||||
rtmpCh := make(chan *ddp.ExtPacket, 1024)
|
rtmpCh := make(chan *ddp.ExtPacket, 1024)
|
||||||
go rtmpMachine.Run(ctx, rtmpCh)
|
go rtmpMachine.Run(ctx, rtmpCh)
|
||||||
|
@ -197,7 +197,7 @@ func main() {
|
||||||
PcapHandle: pcapHandle,
|
PcapHandle: pcapHandle,
|
||||||
MyHWAddr: myHWAddr,
|
MyHWAddr: myHWAddr,
|
||||||
// MyDDPAddr: ...,
|
// MyDDPAddr: ...,
|
||||||
RouteTable: routing,
|
RouteTable: routes,
|
||||||
ZoneTable: zones,
|
ZoneTable: zones,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,9 +268,10 @@ func main() {
|
||||||
// it specifies the local network to which the node is
|
// it specifies the local network to which the node is
|
||||||
// connected. Packets whose destination network number is 0 are
|
// connected. Packets whose destination network number is 0 are
|
||||||
// addressed to a node on the local network."
|
// addressed to a node on the local network."
|
||||||
|
// TODO: more generic routing
|
||||||
if ddpkt.DstNet != 0 && (ddpkt.DstNet < cfg.EtherTalk.NetStart || ddpkt.DstNet > cfg.EtherTalk.NetEnd) {
|
if ddpkt.DstNet != 0 && (ddpkt.DstNet < cfg.EtherTalk.NetStart || ddpkt.DstNet > cfg.EtherTalk.NetEnd) {
|
||||||
// Is it for a network in the routing table?
|
// Is it for a network in the routing table?
|
||||||
rt := routing.LookupRoute(ddpkt.DstNet)
|
rt := routes.LookupRoute(ddpkt.DstNet)
|
||||||
if rt == nil {
|
if rt == nil {
|
||||||
log.Printf("DDP: no route for network %d", ddpkt.DstNet)
|
log.Printf("DDP: no route for network %d", ddpkt.DstNet)
|
||||||
continue
|
continue
|
||||||
|
@ -436,7 +437,7 @@ func main() {
|
||||||
UDPConn: ln,
|
UDPConn: ln,
|
||||||
RemoteAddr: raddr,
|
RemoteAddr: raddr,
|
||||||
RecieveCh: make(chan aurp.Packet, 1024),
|
RecieveCh: make(chan aurp.Packet, 1024),
|
||||||
RoutingTable: routing,
|
RoutingTable: routes,
|
||||||
ZoneTable: zones,
|
ZoneTable: zones,
|
||||||
}
|
}
|
||||||
aurp.Inc(&nextConnID)
|
aurp.Inc(&nextConnID)
|
||||||
|
|
Loading…
Reference in a new issue