.TH "LibrarySetup" 3 "Wed Aug 9 2023" "Version 1.0.2" "libnetfilter_log" \" -*- nroff -*- .ad l .nh .SH NAME nflog_open, nflog_close, nflog_bind_pf, nflog_unbind_pf \- LibrarySetup .SH SYNOPSIS .nf \fB #include #include .in +1c .ti -1c .RI "struct nflog_handle * \fBnflog_open\fP (void)" .br .ti -1c .RI "int \fBnflog_close\fP (struct nflog_handle *h)" .br .ti -1c .RI "int \fBnflog_bind_pf\fP (struct nflog_handle *h, uint16_t pf)" .br .ti -1c .RI "int \fBnflog_unbind_pf\fP (struct nflog_handle *h, uint16_t pf)" .br .in -1c .SH "Detailed Description" .PP When the program has finished with libnetfilter_log, it has to call the \fBnflog_close()\fP function to release all associated resources\&. .PP .SH "Function Documentation" .PP .SS "int nflog_bind_pf (struct nflog_handle * h, uint16_t pf)" nflog_bind_pf - bind a nflog handler to a given protocol family .PP \fBParameters\fP .RS 4 \fIh\fP Netfilter log handle obtained via call to \fBnflog_open()\fP .br \fIpf\fP protocol family to bind to nflog handler obtained from \fBnflog_open()\fP .RE .PP Binds the given log connection handle to process packets belonging to the given protocol family (ie\&. PF_INET, PF_INET6, etc)\&. .PP \fBReturns\fP .RS 4 0 on success, -1 on failure with \fBerrno\fP set\&. .RE .PP \fBErrors\fP .RS 4 \fBEOPNOTSUPP\fP Not running as root .RE .PP .PP Definition at line \fB420\fP of file \fBlibnetfilter_log\&.c\fP\&. .SS "int nflog_close (struct nflog_handle * h)" nflog_close - close a nflog handler .PP \fBParameters\fP .RS 4 \fIh\fP Netfilter log handle obtained via call to \fBnflog_open()\fP .RE .PP This function closes the nflog handler and free associated resources\&. .PP \fBReturns\fP .RS 4 0 on success, -1 on failure with \fBerrno\fP set\&. .RE .PP \fBErrors\fP .RS 4 as for \fBclose\fP(2) .RE .PP .PP Definition at line \fB401\fP of file \fBlibnetfilter_log\&.c\fP\&. .SS "struct nflog_handle * nflog_open (void)" nflog_open - open a nflog handler .PP 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 \fBnflog_close()\fP\&. A new netlink connection is obtained internally and associated with the log connection handle returned\&. .PP \fBReturns\fP .RS 4 a pointer to a new log handle or NULL on failure with \fBerrno\fP set\&. .RE .PP \fBErrors\fP .RS 4 from underlying calls, in exceptional circumstances .RE .PP .PP Definition at line \fB304\fP of file \fBlibnetfilter_log\&.c\fP\&. .SS "int nflog_unbind_pf (struct nflog_handle * h, uint16_t pf)" nflog_unbind_pf - unbind nflog handler from a protocol family .PP \fBParameters\fP .RS 4 \fIh\fP Netfilter log handle obtained via call to \fBnflog_open()\fP .br \fIpf\fP protocol family to unbind family from .RE .PP Unbinds the given nflog handle from processing packets belonging to the given protocol family\&. .PP \fBReturns\fP .RS 4 0 on success, -1 on failure with \fBerrno\fP set\&. .RE .PP \fBErrors\fP .RS 4 \fBEOPNOTSUPP\fP Not running as root .RE .PP .PP Definition at line \fB437\fP of file \fBlibnetfilter_log\&.c\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libnetfilter_log from the source code\&.