(t *testing.T)
| 547 | } |
| 548 | |
| 549 | func TestDecodeVLANPacket(t *testing.T) { |
| 550 | p := gopacket.NewPacket( |
| 551 | []byte{ |
| 552 | 0x00, 0x10, 0xdb, 0xff, 0x10, 0x00, 0x00, 0x15, 0x2c, 0x9d, 0xcc, 0x00, |
| 553 | 0x81, 0x00, 0x01, 0xf7, 0x08, 0x00, 0x45, 0x00, 0x00, 0x28, 0x29, 0x8d, |
| 554 | 0x40, 0x00, 0x7d, 0x06, 0x83, 0xa0, 0xac, 0x1b, 0xca, 0x8e, 0x45, 0x16, |
| 555 | 0x94, 0xe2, 0xd4, 0x0a, 0x00, 0x50, 0xdf, 0xab, 0x9c, 0xc6, 0xcd, 0x1e, |
| 556 | 0xe5, 0xd1, 0x50, 0x10, 0x01, 0x00, 0x5a, 0x74, 0x00, 0x00, 0x00, 0x00, |
| 557 | 0x00, 0x00, 0x00, 0x00, |
| 558 | }, LinkTypeEthernet, testDecodeOptions) |
| 559 | if err := p.ErrorLayer(); err != nil { |
| 560 | t.Error("Error while parsing vlan packet:", err) |
| 561 | } |
| 562 | if vlan := p.Layer(LayerTypeDot1Q); vlan == nil { |
| 563 | t.Error("Didn't detect vlan") |
| 564 | } else if _, ok := vlan.(*Dot1Q); !ok { |
| 565 | t.Error("LayerTypeDot1Q layer is not a Dot1Q object") |
| 566 | } |
| 567 | for i, l := range p.Layers() { |
| 568 | t.Logf("Layer %d: %#v", i, l) |
| 569 | } |
| 570 | want := []gopacket.LayerType{LayerTypeEthernet, LayerTypeDot1Q, LayerTypeIPv4, LayerTypeTCP} |
| 571 | checkLayers(p, want, t) |
| 572 | } |
| 573 | |
| 574 | func TestDecodeSCTPPackets(t *testing.T) { |
| 575 | sctpPackets := [][]byte{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…