[WIP] Unmarshal DDP from AURP
This commit is contained in:
parent
9c997c1a41
commit
0234b6701c
1 changed files with 11 additions and 13 deletions
24
main.go
24
main.go
|
@ -256,19 +256,17 @@ func main() {
|
||||||
|
|
||||||
log.Printf("The packet parsed succesfully as a %T", pkt)
|
log.Printf("The packet parsed succesfully as a %T", pkt)
|
||||||
|
|
||||||
if _, ok := pkt.(*aurp.AppleTalkPacket); ok {
|
if apkt, ok := pkt.(*aurp.AppleTalkPacket); ok {
|
||||||
// Probably something like:
|
var ddpkt ddp.ExtPacket
|
||||||
//
|
if err := ddp.ExtUnmarshal(apkt.Data, &ddpkt); err != nil {
|
||||||
// * parse the DDP header
|
log.Printf("AURP: Couldn't unmarshal encapsulated DDP packet: %v", err)
|
||||||
// * check that this is headed for our local network
|
continue
|
||||||
// * write the packet out in an EtherTalk frame
|
}
|
||||||
//
|
log.Printf("AURP encapsulated DDP: src (%d.%d s %d) dst (%d.%d s %d) proto %d data len %d",
|
||||||
// or maybe if we were implementing a "central hub"
|
ddpkt.SrcNet, ddpkt.SrcNode, ddpkt.SrcSocket,
|
||||||
//
|
ddpkt.DstNet, ddpkt.DstNode, ddpkt.DstSocket,
|
||||||
// * parse the DDP header
|
ddpkt.Proto, len(ddpkt.Data))
|
||||||
// * see if we know the network
|
continue
|
||||||
// * forward to the peer with that network and lowest metric
|
|
||||||
log.Print("TODO: handle AppleTalk packets")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Existing peer?
|
// Existing peer?
|
||||||
|
|
Loading…
Reference in a new issue