func BenchmarkUnpackEthArp(bn *testing.B) { var eth_pkt eth.Packet var arp_pkt arp.Packet for n := 0; n < bn.N; n++ { layers.Unpack(test_eth_arp, ð_pkt, &arp_pkt) } }
func BenchmarkUnpackEthUPv4TCP(bn *testing.B) { var eth_pkt eth.Packet var ip4_pkt ipv4.Packet var tcp_pkt tcp.Packet for n := 0; n < bn.N; n++ { layers.Unpack(test_eth_ipv4_tcp, ð_pkt, &ip4_pkt, &tcp_pkt) } }
func BenchmarkUnpackEthUPv4UDP(bn *testing.B) { var eth_pkt eth.Packet var ip4_pkt ipv4.Packet var udp_pkt udp.Packet for n := 0; n < bn.N; n++ { layers.Unpack(test_eth_ipv4_udp, ð_pkt, &ip4_pkt, &udp_pkt) } }
func TestUnpackEthUPv4TCP(t *testing.T) { var eth_pkt eth.Packet var ip4_pkt ipv4.Packet var tcp_pkt tcp.Packet _, err := layers.Unpack(test_eth_ipv4_tcp, ð_pkt, &ip4_pkt, &tcp_pkt) if err != nil { t.Fatalf("Error unpacking: %s", err) } }
func TestUnpackEthUPv4UDPRaw(t *testing.T) { var eth_pkt eth.Packet var ip4_pkt ipv4.Packet var udp_pkt udp.Packet var raw_pkt raw.Packet _, err := layers.Unpack(test_eth_ipv4_udp_raw, ð_pkt, &ip4_pkt, &udp_pkt, &raw_pkt) if err != nil { t.Fatalf("Error unpacking: %s", err) } }
func TestUnpackEthArp(t *testing.T) { _, err := layers.Unpack(test_eth_arp, ð.Packet{}, &arp.Packet{}) if err != nil { t.Fatalf("Error unpacking: %s", err) } }