---
name: "nflog_unbind_pf"
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_unbind_pf"
---

# nflog\_unbind\_pf(3)

LibrarySetup

## NAME

nflog\_open, nflog\_close, nflog\_bind\_pf, nflog\_unbind\_pf - LibrarySetup

## SYNOPSIS

```
#include <netinet/in.h>
#include <libnetfilter_log/libnetfilter_log.h>
struct nflog_handle * nflog_open (void)
int nflog_close (struct nflog_handle *h)
int nflog_bind_pf (struct nflog_handle *h, uint16_t pf)
int nflog_unbind_pf (struct nflog_handle *h, uint16_t pf)
```

## Detailed Description

**When the program has finished with libnetfilter\_log, it has to call the nflog\_close() function to release all associated resources.**

## Function Documentation

### int nflog\_bind\_pf (struct nflog\_handle \* h, uint16\_t pf)

**nflog\_bind\_pf - bind a nflog handler to a given protocol family**

**Parameters**

*h* **Netfilter log handle obtained via call to nflog\_open()** \
 *pf* **protocol family to bind to nflog handler obtained from nflog\_open()**

**Binds the given log connection handle to process packets belonging to the given protocol family (ie. PF\_INET, PF\_INET6, etc).**

**Returns**

**0 on success, -1 on failure with errno set.**

**Errors**

**EOPNOTSUPP Not running as root**

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

### int nflog\_close (struct nflog\_handle \* h)

**nflog\_close - close a nflog handler**

**Parameters**

*h* **Netfilter log handle obtained via call to nflog\_open()**

**This function closes the nflog handler and free associated resources.**

**Returns**

**0 on success, -1 on failure with errno set.**

**Errors**

**as for [close(2)](/close/2.md)**

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

### struct nflog\_handle \* nflog\_open (void)

**nflog\_open - open a nflog handler**

**This function obtains a netfilter log connection handle. When you are finished with the handle returned by this function, you should destroy it by calling nflog\_close(). A new netlink connection is obtained internally and associated with the log connection handle returned.**

**Returns**

**a pointer to a new log handle or NULL on failure with errno set.**

**Errors**

**from underlying calls, in exceptional circumstances**

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

### int nflog\_unbind\_pf (struct nflog\_handle \* h, uint16\_t pf)

**nflog\_unbind\_pf - unbind nflog handler from a protocol family**

**Parameters**

*h* **Netfilter log handle obtained via call to nflog\_open()** \
 *pf* **protocol family to unbind family from**

**Unbinds the given nflog handle from processing packets belonging to the given protocol family.**

**Returns**

**0 on success, -1 on failure with errno set.**

**Errors**

**EOPNOTSUPP Not running as root**

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

## Author

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