Printing(3)
π Printing β the nflog_snprintf_xml moment π
okay bestie, so this is a page from the libnetfilter_log library manual (that's the Library Functions Manual vibe), and it's all about one lil function that turns your logged packets into pretty XML. it's giving "glow up for netlink data" fr fr β¨
π NAME π
nflog_snprintf_xml β Printing. that's it, that's the name, she's literally called Printing π
πΈ SYNOPSIS πΈ
#include <libnetfilter_log/libnetfilter_log.h>
int nflog_snprintf_xml (char *buf, size_t rem, struct nflog_data *tb, int flags)
like, that's the whole incantation. include the header, call the function, slay π¦
π Function Documentation π
β¨ int nflog_snprintf_xml (char * buf, size_t rem, struct nflog_data * tb, int flags) β¨
so nflog_snprintf_xml β print the logged packet in XML format into a buffer. she takes your packet and makes it aesthetic, XML-style π
π Parameters π
bufβ the buffer that you want to use to print the logged packet. that's your canvas bestie π¨remβ the size of the buffer that you have passed. yes, you have to tell her how much room she's working with πtbβ Netlink packet data handle passed to callback function. this is the packet's whole identity π«flagsβ the flag that tell what to print into the buffer. pick your faves π
π This function supports the following flags π
NFLOG_XML_PREFIX: include the string prefixNFLOG_XML_HW: include the hardware link layer addressNFLOG_XML_MARK: include the packet markNFLOG_XML_DEV: include the device informationNFLOG_XML_PHYSDEV: include the physical device informationNFLOG_XML_PAYLOAD: include the payload (in hexadecimal)NFLOG_XML_TIME: include the timestampNFLOG_XML_CTID: include conntrack idNFLOG_XML_ALL: include all the logging information (all flags set)
You can combine these flags with a bitwise OR. that's the "why choose one when you can have them all" energy, lowkey iconic π«Ά
β Returns β
-1 in case of failure, otherwise the length of the string that would have been printed into the buffer (in case that there is enough room in it). See snprintf() return value for more information. no cap, she'll tell you how much space she wanted even if she didn't get it π
π Errors π
from underlying calls, in exceptional circumstances. so like, rare, but not never π
π§ Definition π§
Definition at line 1066 of file libnetfilter_log.c. she's literally in the source code, go say hi β¨
πΈ Author πΈ
Generated automatically by Doxygen for libnetfilter_log from the source code. not a human, just a very dedicated robot doing the most π€π
bestie reminder: every flag, every parameter, every number up there is verbatim from the page. don't be out here inventing new flags, that's not the vibe π
mwah π this was libnetfilter_log, Version 1.0.2, dated the Printing(3) era of the manual. thanks for reading my lil yap session, ily, go log some packets π¦πβ¨
π¦ where this page comes from
- ubuntu noble: libnetfilter-log-doc 1.0.2-4build1 Β· GPL-2.0-or-later
- ubuntu questing: libnetfilter-log-doc 1.0.2-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms