VLAN(3)

✨ VLAN(3) ✨

okay bestie, so this is the manual page for VLAN(3) from vlan 1.0 β€” yes, that's the whole vibe, we're doing network packet decoding today and honestly it's giving main character energy πŸ’…


🌸 NAME 🌸

packet.link.vlan β€” the VLAN module, periodt πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

It decodes the Virtual LAN IEEE 802.1Q/802.1ad layer. That's it, that's the whole job. Lowkey iconic of it. ✨


πŸ‘‘ CLASSES πŸ‘‘

πŸ’œ class VLAN(baseobj.BaseObj)

The VLAN object itself. She's the main character fr fr.

Usage:

from packet.link.vlan import VLAN

x = VLAN(pktt)

Object definition:

VLAN(
    pcp   = int,  # Priority Point Code
    dei   = int,  # Drop Eligible Indicator
    vid   = int,  # VLAN Identifier
    etype = int,  # Payload Type
    psize = int,  # Payload Data Size
)

✨ Methods defined here ✨

---------------------

__init__(self, pktt)

Constructor 🫢

It initializes the object's private data. Like, sets up her whole little world.

  • pktt β€” Packet trace object (packet.pktt.Pktt) so this layer has access to the parent layers. She needs to know where she came from, iykyk. 🌈

__str__(self)

String representation of the object. The way she presents herself to the world πŸ’…

So here's the thing β€” the representation depends on the verbose level set by debug_repr():

  • If set to 0, the generic object representation is returned. Basic. No thoughts, head empty.
  • If set to 1, the representation of the object is condensed:
'802.1Q VLAN pcp: 4, dei: 0, vid: 2704 '
  • If set to 2, the representation of the object also includes the type of payload. She said let me give you the FULL story πŸ“:
'802.1Q Virtual LAN, pcp: 4, dei: 0, vid: 2704, etype: 0x0800(IPv4)'

🧚 FUNCTIONS 🧚

vlan_layers(pktt)

Get all the nested VLAN layers β€” so like stacked VLANs or QinQ, the whole squad 🌈

A Packet layer attribute is created for each VLAN layer: vlan1, vlan2, ..., and vlan. The last packet attribute is always vlan. No cap, that's just how it is. πŸ’–


⭐ SEE ALSO ⭐

baseobj(3), packet.link.ethernet_const(3)

Go read those too bestie, they're part of the lore πŸ“š


πŸ’€ BUGS πŸ’€

No known bugs. She's flawless. Not a single red flag. πŸ™ˆβœ¨


πŸŽ€ AUTHOR πŸŽ€

Jorge Mora (mora@netapp.com) β€” shoutout to the icon who made this πŸ«ΆπŸ‘‘


and that's the whole page!! this was NFStest 3.2, dated 21 March 2023, and it's still VLAN(3) at the end of the day πŸ’… slay, bye bestie πŸ’–βœ¨πŸ¦‹