---
name: "nflog_snprintf_xml"
section: "3"
platform: "linux"
package: "libnetfilter-log-doc"
version: "1.0.2-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nflog_snprintf_xml"
---

# nflog\_snprintf\_xml(3)

Printing

## NAME

nflog\_snprintf\_xml - Printing

## SYNOPSIS

```
#include <libnetfilter_log/libnetfilter_log.h>
int nflog_snprintf_xml (char *buf, size_t rem, struct nflog_data *tb, int flags)
```

## Function Documentation

### int nflog\_snprintf\_xml (char \* buf, size\_t rem, struct nflog\_data \* tb, int flags)

**nflog\_snprintf\_xml - print the logged packet in XML format into a buffer**

**Parameters**

*buf* **The buffer that you want to use to print the logged packet** \
 *rem* **The size of the buffer that you have passed** \
 *tb* **Netlink packet data handle passed to callback function** \
 *flags* **The flag that tell what to print into the buffer**

**This function supports the following flags:**

```
 - NFLOG_XML_PREFIX: include the string prefix
 - NFLOG_XML_HW: include the hardware link layer address
 - NFLOG_XML_MARK: include the packet mark
 - NFLOG_XML_DEV: include the device information
 - NFLOG_XML_PHYSDEV: include the physical device information
 - NFLOG_XML_PAYLOAD: include the payload (in hexadecimal)
 - NFLOG_XML_TIME: include the timestamp
 - NFLOG_XML_CTID: include conntrack id
 - NFLOG_XML_ALL: include all the logging information (all flags set)
```

 **You can combine these flags with a bitwise OR.**

**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.**

**Errors**

**from underlying calls, in exceptional circumstances**

**Definition at line 1066 of file libnetfilter\_log.c.**

## Author

**Generated automatically by Doxygen for libnetfilter\_log from the source code.**
