vlan_get_pr...ffset_inline(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

vlan_get_protocol_offset_inline β€” bestie, this one just grabs the protocol EtherType for you ✨

okay so real quick, this page lives in the Kernel API Manual (yes, that one πŸ‘‘), and it's all about one little inline helper that peeks at a packet and tells you what its EtherType is. that's the whole vibe. no cap. πŸ¦‹


✨ SYNOPSIS ✨

__be16 vlan_get_protocol_offset_inline (const struct sk_buff *skb ,
__be16 type , int mac_offset , int *depth );

like, look at her. four args, one __be16 out the door. iconic behavior honestly πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the skbuff you're interrogating πŸ” this is the packet bestie, the main character, the one we're querying.
  • type β€” the first vlan protocol. yes, the first one, she's the opener 🫢
  • mac_offset β€” the MAC offset. that's it, that's the whole thing 🌸
  • depth β€” a buffer where we stash the length of the eth and vlan tags, in bytes πŸ“ (so you know how deep the tag situation goes, iykyk)

πŸ”₯ RETURN πŸ”₯

she returns the EtherType of the packet πŸ’– and here's the gorgeous part: it does NOT matter whether the packet is vlan encapsulated (normal encapsulation or hardware accelerated) or not vlan encapsulated at all. same result. no exceptions. periodt. 🌈


πŸ¦‹ SEE ALSO πŸ¦‹

so you wanna go down the rabbit hole? buckle up bestie, this is the whole friend group 😭

Kernel file ./include/linux/if_vlan.h plus struct vlan_ethhdr(9), struct vlan_pcpu_stats(9), struct vlan_priority_tci_mapping(9), struct vlan_dev_priv(9), eth_type_vlan(9), __vlan_insert_inner_tag(9), __vlan_insert_tag(9), vlan_insert_inner_tag(9), vlan_insert_tag(9), vlan_insert_tag_set_proto(9), __vlan_hwaccel_clear_tag(9), __vlan_hwaccel_copy_tag(9), __vlan_hwaccel_put_tag(9), __vlan_get_tag(9), __vlan_hwaccel_get_tag(9), vlan_get_tag(9), vlan_get_protocol(9), vlan_remove_tag(9), skb_vlan_tagged(9), skb_vlan_tagged_multi(9), vlan_features_check(9), compare_vlan_header(9)

like. that's a lot of siblings. but they're all slaying in their own lanes πŸ’€


mwah πŸ’œ that's the page! brought to you straight out of ./include/linux in the Kernel API Manual, dated October 2026 β€” and yeah, the footer still says vlan_get_pr...ffset_inline(9) because the name got truncated and honestly? she's mysterious. she's elusive. we respect it. πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from