This commit is contained in:
黄思敏 2022-08-29 09:15:33 +08:00
parent b896363b34
commit 9a35a15897

View File

@ -9,7 +9,6 @@ import (
"github.com/songgao/packets/ethernet" "github.com/songgao/packets/ethernet"
"github.com/songgao/water" "github.com/songgao/water"
"github.com/songgao/water/waterutil"
) )
func init() { func init() {
@ -68,8 +67,8 @@ func testmain() {
log.Fatal(err) log.Fatal(err)
} }
frame = frame[:n] frame = frame[:n]
log.Printf("Dst: %s %s\n", waterutil.IPv4Destination(frame), frame.Destination())
log.Printf("Src: %s %s\n", waterutil.IPv4Source(frame), frame.Source()) log.Printf("Dst: %s Src: %s\n", frame.Destination(), frame.Source())
log.Printf("Ethertype: % x\n", frame.Ethertype()) log.Printf("Ethertype: % x\n", frame.Ethertype())
// log.Printf("Payload: % x\n", frame.Payload()) // log.Printf("Payload: % x\n", frame.Payload())