• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iptables-1.4.12.1/include/libipq/

Lines Matching defs:*

2  * libipq.h
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.
21 #ifndef _LIBIPQ_H
22 #define _LIBIPQ_H
24 #include <errno.h>
25 #include <unistd.h>
26 #include <fcntl.h>
27 #include <sys/types.h>
28 #include <sys/socket.h>
29 #include <sys/uio.h>
30 #include <asm/types.h>
31 #include <linux/netlink.h>
33 #include <linux/netfilter_ipv4/ip_queue.h>
34 typedef unsigned long ipq_id_t;
36 #ifdef DEBUG_LIBIPQ
37 #include <stdio.h>
38 #define LDEBUG(x...) fprintf(stderr, ## x)
39 #else
40 #define LDEBUG(x...)
41 #endif /* DEBUG_LIBIPQ */
43 /* FIXME: glibc sucks */
44 #ifndef MSG_TRUNC
45 #define MSG_TRUNC 0x20
46 #endif
48 struct ipq_handle
50 int fd;
51 u_int8_t blocking;
52 struct sockaddr_nl local;
53 struct sockaddr_nl peer;
56 struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
58 int ipq_destroy_handle(struct ipq_handle *h);
60 ssize_t ipq_read(const struct ipq_handle *h,
61 unsigned char *buf, size_t len, int timeout);
63 int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
65 ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
67 int ipq_message_type(const unsigned char *buf);
69 int ipq_get_msgerr(const unsigned char *buf);
71 int ipq_set_verdict(const struct ipq_handle *h,
72 ipq_id_t id,
73 unsigned int verdict,
74 size_t data_len,
75 unsigned char *buf);
77 int ipq_ctl(const struct ipq_handle *h, int request, ...);
79 char *ipq_errstr(void);
80 void ipq_perror(const char *s);
82 #endif /* _LIBIPQ_H */