MCPcopy Index your code
hub / github.com/google/gopacket / ProtocolGuessingDecoder

Struct ProtocolGuessingDecoder

layers/mpls.go:33–33  ·  view source on GitHub ↗

ProtocolGuessingDecoder attempts to guess the protocol of the bytes it's given, then decode the packet accordingly. Its algorithm for guessing is: If the packet starts with byte 0x45-0x4F: IPv4 If the packet starts with byte 0x60-0x6F: IPv6 Otherwise: Error See draft-hsmit-isis-aal5mux-00.txt for

Source from the content-addressed store, hash-verified

31// Otherwise: Error
32// See draft-hsmit-isis-aal5mux-00.txt for more detail on this approach.
33type ProtocolGuessingDecoder struct{}
34
35func (ProtocolGuessingDecoder) Decode(data []byte, p gopacket.PacketBuilder) error {
36 switch data[0] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected