SNAP - Subnetwork Access Protocol¶
pcapkit.protocols.link.snap.protocol contains
SNAP,
which implements the extractor for the IEEE 802 Subnetwork Access
Protocol (SNAP) [*] header, the information field of an
LLC PDU addressed to the SNAP
LSAP, whose structure is:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Organizationally Unique Identifier |
3 |
24 |
|
Protocol identifier |
Under the OUI 00-00-00 the protocol identifier is an EtherType
(RFC 9542 Section 3), and the payload is dispatched as Ethernet dispatches
it; under any other it is kept as
Raw.
Added in version 1.9.0.
- class pcapkit.protocols.link.snap.protocol.SNAP(file, length=None, /, *, layer=None, protocol=None, context=None)[source]¶
-
This class implements IEEE 802 Subnetwork Access Protocol.
The header is the information field of an
LLCPDU whose DSAP isSNAP. Under the OUI00-00-00the protocol identifier is an EtherType (RFC 9542 Section 3), and the payload is dispatched throughLink.__proto__as Ethernet dispatches it. Under any other OUI the protocol identifier is that organization’s, and the payload is kept asRaw.Added in version 1.9.0.
Properties
Methods
- read(length=None, **kwargs)[source]¶
Read IEEE 802 Subnetwork Access Protocol.
Structure of SNAP header [IEEE Std 802]:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Organizationally Unique Identifier | Protocol... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |...Identifier | +-+-+-+-+-+-+-+-+
- make(*, oui=0x000000, pid=EtherType.Internet_Protocol_version_4, payload=b'', **kwargs)[source]¶
Make (construct) packet data.
- Parameters:
- Return type:
- Returns:
Constructed packet data.
- Raises:
ProtocolError – If
ouidoes not fit in 24 bits, orpidis a name, abool, or a code its field cannot carry.
Data Models
- classmethod __index__()[source]¶
Numeral registry index of the protocol.
- Return type:
- Returns:
Numeral registry index of the protocol in the LLC address values, since no link type, EtherType, protocol number or port names it.
Utilities
Header Schemas¶
Data Models¶
- class pcapkit.protocols.link.snap.data.SNAP(oui, pid)[source]¶
Bases:
ProtocolData model for SNAP headers.
Footnotes