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: Link[VLAN]

This class implements 802.1Q Customer VLAN Tag Type.

Parameters
  • *args (Any) – Arbitrary positional arguments.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

Protocol[PT]

classmethod __index__()[source]

Numeral registry index of the protocol.

Raises

UnsupportedCall – This protocol has no registry entry.

Return type

NoReturn

property name: Literal['802.1Q Customer VLAN Tag Type']

Name of current protocol.

Return type

Literal[‘802.1Q Customer VLAN Tag Type’]

property alias: Literal['802.1Q']

Acronym of corresponding protocol.

Return type

Literal[‘802.1Q’]

property info_name: Literal['c_tag']

Key name of the info dict.

Return type

Literal[‘c_tag’]

property length: Literal[4]

Header length of current protocol.

Return type

Literal[4]

property protocol: EtherType

Name of next layer protocol.

Return type

EtherType

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|                       |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • length (Optional[int]) – Length of packet data.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

VLAN

Returns

Parsed packet data.

make(**kwargs)[source]

Make (construct) packet data.

Parameters

**kwargs (Any) – Arbitrary keyword arguments.

Return type

NoReturn

Returns

Constructed packet data.

Data Structures

class pcapkit.protocols.data.link.vlan.VLAN(tci, type)[source]

Bases: Info

Data model for 802.1Q customer VLAN tag type.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

tci: TCI

Tag control information.

type: EtherType

Protocol (Internet Layer).

class pcapkit.protocols.data.link.vlan.TCI(pcp, dei, vid)[source]

Bases: Info

Data model for tag control information.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

pcp: PriorityLevel

Priority code point.

dei: bool

Drop eligible indicator.

vid: int

VLAN identifier.


*

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