IPQ_CREATE_HANDLE(3)
okay bestie, gather round β this is IPQ_CREATE_HANDLE(3) from the Linux Programmer's Manual, and we're talking about creating and destroying libipq handles like it's main character energy π β¨
πΈ NAME πΈ
ipq_create_handle, ipq_destroy_handle β bestie, these two literally create and destroy libipq handles π«Ά
π SYNOPSIS π
#include <linux/netfilter.h>
#include <libipq.h>
struct ipq_handle *ipq_create_handle(uint32_t flags, uint32_t protocol);
int ipq_destroy_handle(struct ipq_handle *h);
β¨ DESCRIPTION β¨
So ipq_create_handle initialises libipq for an application β it attempts to bind to the Netlink socket used by ip_queue, and returns an opaque context handle πβ¨ It should be the first libipq function your app calls, no cap. And the handle it returns? Use that same handle in all subsequent library calls that require a handle parameter, periodt.
The flags parameter is not currently used, so the application should set it to zero for forward compatibility β it's giving "placeholder but make it future-proof" π
The protocol parameter specifies the protocol of the packets to be queued. Valid values are NFPROTO_IPV4 for IPv4 and NFPROTO_IPV6 for IPv6. Currently, only one protocol may be queued at a time for a handle β that's the vibe check, bestie.
The ipq_destroy_handle function frees up resources allocated by ipq_create_handle, and should be used when the handle is no longer required by the application. Cleanup queen behavior, honestly π§Ήπ
π RETURN VALUES π
- On success,
ipq_create_handlereturns a pointer to a context handle. On failure,NULLis returned π - On success,
ipq_destroy_handlereturns zero. On failure,-1is returned π
π¨ ERRORS π¨
On failure, a descriptive error message will be available via the ipq_errstr function. So if something goes sideways, go ask ipq_errstr β it's literally the receipts π₯
π BUGS π
None known. Iconic, honestly. No known bugs, no drama π β¨
π AUTHOR π
James Morris <jmorris@intercode.com.au> π«Ά
π COPYRIGHT π
Copyright (c) 2000-2001 Netfilter Core Team.
Distributed under the GNU General Public License.
π¦ SEE ALSO π¦
and that's the page, bestie β from Linux iptables 1.2, dated 16 October 2001. mwah, go slay your queue ππ«Άβ¨
π¦ where this page comes from
- alpine 3.22: iptables-doc 1.8.11-r1 Β· GPL-2.0-or-later
- alpine 3.23: iptables-doc 1.8.11-r1 Β· GPL-2.0-or-later
- alpine 3.24: iptables-doc 1.8.13-r0 Β· GPL-2.0-or-later
- nixpkgs unstable: iptables 1.8.13
- opensuse-leap 16.0: libipq-devel 1.8.11-160000.2.2 Β· Artistic-2.0 AND GPL-2.0-only
- opensuse-leap 16.0: libipq-devel 1.8.11-160000.2.2 Β· Artistic-2.0 AND GPL-2.0-only
- opensuse-leap 16.0: libipq-devel 1.8.11-160000.2.2 Β· Artistic-2.0 AND GPL-2.0-only
- opensuse-leap 16.0: libipq-devel 1.8.11-160000.2.2 Β· Artistic-2.0 AND GPL-2.0-only
- Copyright (c) 2000-2001 Netfilter Core Team
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms