VLAN - 802.1Q Customer VLAN Tag Type¶
pcapkit.protocols.link.vlan
contains
VLAN
only, which implements extractor for 802.1Q
Customer VLAN Tag Type [*], whose structure is
described as below:
Octets |
Bits |
Name |
Description |
---|---|---|---|
1 |
0 |
|
Tag Control Information |
1 |
0 |
|
Priority Code Point |
1 |
3 |
|
Drop Eligible Indicator |
1 |
4 |
|
VLAN Identifier |
3 |
24 |
|
Protocol (Internet Layer) |
- class pcapkit.protocols.link.vlan.VLAN(file=None, length=None, **kwargs)[source]¶
-
This class implements 802.1Q Customer VLAN Tag Type.
- property name: Literal['802.1Q Customer VLAN Tag Type']¶
Name of current protocol.
- read(length=None, **kwargs)[source]¶
Read 802.1Q Customer VLAN Tag Type.
Structure of 802.1Q Customer VLAN Tag Type [IEEE 802.1Q]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TCI | | |-------------------------------| | | P |D| | Type | | C |E| VID | | | P |I| | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- make(tci=None, pcp=<PriorityLevel.BE: 0>, pcp_default=None, pcp_namespace=None, pcp_reversed=False, dei=False, vid=0, type=<EtherType.Internet_Protocol_version_4: 2048>, type_default=None, type_namespace=None, type_reversed=False, payload=b'', **kwargs)[source]¶
Make (construct) packet data.
- Parameters:
pcp (
PriorityLevel
|IntEnum
|IntEnum
|str
|int
) – Priority Code Point (PCP) field.pcp_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – Namespace of PCP field.pcp_reversed (
bool
) – Reversed flag of PCP field.dei (
bool
) – Drop Eligible Indicator (DEI) field.vid (
int
) – VLAN Identifier (VID) field.type (
EtherType
|IntEnum
|IntEnum
|str
|int
) – EtherType field.type_default (
Optional
[int
]) – Default value of EtherType field.type_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – Namespace of EtherType field.type_reversed (
bool
) – Reversed flag of EtherType field.payload (
bytes
|ProtocolBase
|Schema
) – Payload field.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed packet data.
- classmethod __index__()[source]¶
Numeral registry index of the protocol.
- Raises:
UnsupportedCall – This protocol has no registry entry.
- Return type:
Header Schemas¶
- class pcapkit.protocols.schema.link.vlan.VLAN(dict_=None, **kwargs)[source]¶
Bases:
Schema
Header schema for 802.1Q Customer VLAN Tag Type packet.
- tci: TCIType = <BitField tci>¶
Tag control information.
- type: Enum_EtherType = <EnumField type>¶
EtherType.
- payload: bytes = <PayloadField payload>¶
Payload.
- class pcapkit.protocols.schema.link.vlan.TCI(dict_=None, **kwargs)[source]¶
Bases:
Schema
Header schema for 802.1Q Customer VLAN Tag Type tag control information.
- pcp: Enum_PriorityLevel = <EnumField pcp>¶
Priority code point.
- dei: int = <UInt8Field dei>¶
Drop eligible indicator.
- vid: int = <UInt16Field vid>¶
VLAN identifier.
Type Stubs¶
Data Models¶
- class pcapkit.protocols.data.link.vlan.VLAN(*args: VT, **kwargs: VT)[source]¶
Bases:
Protocol
Data model for 802.1Q customer VLAN tag type.
- tci: TCI¶
Tag control information.
- type: EtherType¶
Protocol (Internet Layer).
- class pcapkit.protocols.data.link.vlan.TCI(*args: VT, **kwargs: VT)[source]¶
Bases:
Data
Data model for tag control information.
- pcp: PriorityLevel¶
Priority code point.
- dei: bool¶
Drop eligible indicator.
- vid: int¶
VLAN identifier.
Footnotes