Layer represents a single decoded packet layer (using either the OSI or TCP/IP definition of a layer). When decoding, a packet's data is broken up into a number of layers. The caller may call LayerType() to figure out which type of layer they've received from the packet. Optionally, they may then
| 17 | // they may then use a type assertion to get the actual layer type for deep |
| 18 | // inspection of the data. |
| 19 | type Layer interface { |
| 20 | // LayerType is the gopacket type for this layer. |
| 21 | LayerType() LayerType |
| 22 | // LayerContents returns the set of bytes that make up this layer. |
| 23 | LayerContents() []byte |
| 24 | // LayerPayload returns the set of bytes contained within this layer, not |
| 25 | // including the layer itself. |
| 26 | LayerPayload() []byte |
| 27 | } |
| 28 | |
| 29 | // Payload is a Layer containing the payload of a packet. The definition of |
| 30 | // what constitutes the payload of a packet depends on previous layers; for |
no outgoing calls
no test coverage detected
searching dependent graphs…