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

vlan.tci

Tag Control Information

1

0

vlan.tci.pcp

Priority Code Point

1

3

vlan.tci.dei

Drop Eligible Indicator

1

4

vlan.tci.vid

VLAN Identifier

3

24

vlan.type

Protocol (Internet Layer)


class pcapkit.protocols.link.vlan.VLAN(file=None, length=None, **kwargs)[source]

Bases: pcapkit.protocols.link.link.Link

This class implements 802.1Q Customer VLAN Tag Type.

classmethod __index__()[source]

Numeral registry index of the protocol.

Raises

UnsupportedCall – This protocol has no registry entry.

__length_hint__()[source]

Return an estimated length for the object.

Return type

Literal[4]

make(**kwargs)[source]

Make (construct) packet data.

Keyword Arguments

**kwargs – Arbitrary keyword arguments.

Returns

Constructed packet data.

Return type

bytes

read(length=None, **kwargs)[source]

Read 802.1Q Customer VLAN Tag Type.

Parameters

length (Optional[int]) – Length of packet data.

Keyword Arguments

**kwargs – Arbitrary keyword arguments.

Returns

Parsed packet data.

Return type

DataType_VLAN

property alias

Acronym of corresponding protocol.

Return type

Literal[‘802.1Q’]

property length

Header length of current protocol.

Return type

Literal[4]

property name

Name of current protocol.

Return type

Literal[‘802.1Q Customer VLAN Tag Type’]

property protocol

Name of next layer protocol.

Return type

pcapkit.const.reg.ethertype.EtherType

Data Structure

Important

Following classes are only for documentation purpose. They do NOT exist in the pcapkit module.

class pcapkit.protocols.link.vlan.DataType_VLAN
Bases

TypedDict

IEEE 802.1Q customer VLAN tag type [RFC 7042].

tci: DataType_TCI

Tag control information.

type: pcapkit.const.reg.ethertype.EtherType

Protocol (internet layer).

class pcapkit.protocols.link.vlan.DataType_TCI
Bases

TypedDict

Tag control information.

pcp: pcapkit.const.vlan.priority_level.PriorityLevel

Priority code point.

dei: bool

Drop eligible indicator.

vid: int

VLAN identifier.


*

https://en.wikipedia.org/wiki/IEEE_802.1Q