新TAP测试(TODO 解析arp)
This commit is contained in:
parent
ccff98d5e3
commit
a60ac04577
|
@ -101,9 +101,8 @@ func NewNetTunnel() *NetTunnel {
|
|||
log.Printf("% x len: %d", frame.Ethertype(), len(frame))
|
||||
switch frame.Ethertype() {
|
||||
case ethernet.ARP:
|
||||
log.Printf("bytes len: %d type(arp): % x", len(rbuf), frame.Ethertype()) // 数据长度
|
||||
arp := ARP(frame)
|
||||
log.Println(arp.IPv4Source(), arp.Source(), arp.IPv4Destination(), arp.Destination())
|
||||
log.Printf("bytes len: %d type(arp): % x src: %s(%s) dst: %s(%s)", len(arp), frame.Ethertype(), arp.IPv4Source(), arp.Source(), arp.IPv4Destination(), arp.Destination()) // 数据长度
|
||||
|
||||
SwapBytes(frame, 0, frame, 6, 6)
|
||||
binary.BigEndian.PutUint16(frame[20:22], 2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user