C_Tag - 802.1Q Customer VLAN Tag Type

pcapkit.protocols.link.c_tag contains C_Tag only, which implements extractor for the 802.1Q Customer VLAN Tag Type (C-Tag, formerly the Q-Tag) [*], EtherType 0x8100.

Its structure, and all of its parsing and construction, come from VLAN; this class adds only the tag’s own identity – name, alias, info_name – and its registry index.

It lives in a module of its own rather than beside S_Tag because the two are reached through different registry indices, 0x8100 against 0x88A8, which is the project’s rule for when protocols share a module. Contrast InARP, which shares arp with ARP precisely because it inherits its index.

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

Bases: VLAN

This class implements 802.1Q Customer VLAN Tag Type.

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

Name of current protocol.

property alias: Literal['802.1Q']

Acronym of corresponding protocol.

property info_name: Literal['c_tag']

Key name of the info dict.

classmethod id()[source]

Index ID of the protocol.

Return type:

tuple[Literal['C_Tag'], Literal['VLAN']]

Returns:

Index ID of the protocol. VLAN is retained alongside the class’s own name so that selecting the protocol by that name – as pcapkit.extract(..., protocol='VLAN') did when this class was VLAN – keeps matching.

classmethod __index__()[source]

Numeral registry index of the protocol.

Return type:

EtherType

Returns:

Numeral registry index of the protocol in IANA.

Footnotes