4 * IPQ library for userspace.
6 * Author: James Morris <jmorris@intercode.com.au>
8 * Copyright (c) 2000-2001 Netfilter Core Team
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
28 #include <sys/types.h>
29 #include <sys/socket.h>
31 #include <asm/types.h>
32 #include <linux/netlink.h>
34 #ifdef KERNEL_64_USERSPACE_32
35 #include "ip_queue_64.h"
36 typedef u_int64_t ipq_id_t;
39 #include <linux/netfilter_ipv4/ip_queue.h>
43 typedef unsigned long ipq_id_t;
48 #define LDEBUG(x...) fprintf(stderr, ## x)
51 #endif /* DEBUG_LIBIPQ */
53 /* FIXME: glibc sucks */
55 #define MSG_TRUNC 0x20
62 struct sockaddr_nl local;
63 struct sockaddr_nl peer;
66 struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
68 int ipq_destroy_handle(struct ipq_handle *h);
70 ssize_t ipq_read(const struct ipq_handle *h,
71 unsigned char *buf, size_t len, int timeout);
73 int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
75 ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
77 int ipq_message_type(const unsigned char *buf);
79 int ipq_get_msgerr(const unsigned char *buf);
81 int ipq_set_verdict(const struct ipq_handle *h,
87 int ipq_ctl(const struct ipq_handle *h, int request, ...);
89 /*char *ipq_errstr(void);
90 void ipq_perror(const char *s);*/
92 #endif /* _LIBIPQ_H */