otherfns(3)

✨ otherfns β€” bestie edition ✨

okay so this is otherfns(3), like, the miscellaneous page of the libnetfilter_queue library manual, and honestly? it's giving "the bonus level of the Unix docs" πŸ’…


🌸 NAME 🌸

otherfns β€” Other functions


πŸŽ€ SYNOPSIS πŸŽ€

πŸ’– Modules

  • Internal functions

πŸ¦‹ Functions

unsigned int pktb_tailroom (struct pkt_buff *pktb)
uint8_t * pktb_mac_header (struct pkt_buff *pktb)
uint8_t * pktb_network_header (struct pkt_buff *pktb)
uint8_t * pktb_transport_header (struct pkt_buff *pktb)

✨ Detailed Description ✨

so basically, the library ships a whole lil collection of other functions that most user-space programs will never ever need. no cap. like, they're there, they're valid, they're just… not the main character for most people πŸ™ˆ

these divide into 2 groups:

  1. Functions to get values of members of opaque struct pktbuff, described below
  2. Internal functions, described in Module Internal functions

πŸ’… Function Documentation πŸ’…

πŸ“ uint8_t * pktb_mac_header (struct pkt_buff * pktb)

pktb_mac_header β€” get address of layer 2 header (if any)

Parameters

  • pktb β€” Pointer to userspace packet buffer

Returns

Pointer to MAC header or NULL if no such header present.

Only packet buffers in family AF_BRIDGE have a non-NULL MAC header. πŸ‘‘

Definition at line 233 of file pktbuff.c.


🌈 uint8_t * pktb_network_header (struct pkt_buff * pktb)

pktb_network_header β€” get address of layer 3 header

Parameters

  • pktb β€” Pointer to userspace packet buffer

Returns

Pointer to layer 3 header or NULL if the packet buffer was created with an unsupported family

Definition at line 245 of file pktbuff.c.


🧚 unsigned int pktb_tailroom (struct pkt_buff * pktb)

pktb_tailroom β€” get room available for packet expansion

Parameters

  • pktb β€” Pointer to userspace packet buffer

Returns

room in bytes after the tail of the packet buffer

This starts off as the extra argument to pktb_alloc(). Programmers should ensure this extra argument is sufficient for any packet mangle, as packet buffers cannot be expanded dynamically. 😭 like fr fr, plan ahead bestie, there is NO glow-up later.

Definition at line 220 of file pktbuff.c.


πŸ’œ uint8_t * pktb_transport_header (struct pkt_buff * pktb)

pktb_transport_header β€” get address of layer 4 header (if known)

Parameters

  • pktb β€” Pointer to userspace packet buffer

Returns

Pointer to layer 4 header or NULL if not (yet) set

Note

Unlike the lower-level headers, it is the programmer's responsibility to create the level 4 (transport) header pointer by caling e.g. nfq_ip_set_transport_header(). yes, that's caling β€” the original spelling, she stays, we don't edit history 🫢

Definition at line 260 of file pktbuff.c.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libnetfilter_queue from the source code. so nobody hand-wrote this one, it just ✨manifested✨


and that's the whole vibe check, bestie β€” libnetfilter_queue, Version 1.0.5, dated otherfns(3). go forth and mangle packets responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from