From bfe902dc0f16bae4e07d9befc4ebd35c8d64ff06 Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org" Date: Thu, 20 Oct 2005 18:34:48 +0000 Subject: Rename libnfnetlink_conntrack to libnetfilter_conntrack, for some unknown reason this didn't happen in the lastest commit. --- .../libnetfilter_conntrack.h | 131 +++++++++++++++++++++ .../libnfnetlink_conntrack.h | 131 --------------------- 2 files changed, 131 insertions(+), 131 deletions(-) create mode 100644 include/libnetfilter_conntrack/libnetfilter_conntrack.h delete mode 100644 include/libnetfilter_conntrack/libnfnetlink_conntrack.h (limited to 'include') diff --git a/include/libnetfilter_conntrack/libnetfilter_conntrack.h b/include/libnetfilter_conntrack/libnetfilter_conntrack.h new file mode 100644 index 0000000..954b3e2 --- /dev/null +++ b/include/libnetfilter_conntrack/libnetfilter_conntrack.h @@ -0,0 +1,131 @@ +/* libctnetlink.h: Header file for the Connection Tracking library. + * + * Jay Schulist , Copyright (c) 2001. + * (C) 2002 by Harald Welte + * (C) 2005 by Pablo Neira Ayuso + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + */ + +#ifndef __LIBCTNETLINK_H +#define __LIBCTNETLINK_H + +#include +#include +#include +#include +#include + +/* we need this for "enum ip_conntrack_status" */ +#include + +#include + +#define CTNL_BUFFSIZE 4096 + +union ctnl_l4 { + /* Add other protocols here. */ + u_int16_t all; + struct { + u_int16_t port; + } tcp; + struct { + u_int16_t port; + } udp; + struct { + u_int8_t type, code; + u_int16_t id; + } icmp; + struct { + u_int16_t port; + } sctp; +}; + +struct ctnl_tuple { + union { + u_int32_t v4; + u_int64_t v6; + } src; + + union { + u_int32_t v4; + u_int64_t v6; + } dst; + + u_int8_t protonum; + union ctnl_l4 l4src; + union ctnl_l4 l4dst; +}; + +union ctnl_protoinfo { + struct { + u_int8_t state; + } tcp; +}; + +struct ctnl_counters { + u_int64_t packets; + u_int64_t bytes; +}; + +struct ctnl_nat { + u_int32_t min_ip, max_ip; + union ctnl_l4 l4min, l4max; +}; + +#define CTNL_DIR_ORIGINAL 0 +#define CTNL_DIR_REPLY 1 +#define CTNL_DIR_MAX CTNL_DIR_REPLY+1 + +struct ctnl_conntrack { + struct ctnl_tuple tuple[CTNL_DIR_MAX]; + + unsigned long timeout; + unsigned long mark; + unsigned int status; + unsigned int use; + unsigned int id; + + union ctnl_protoinfo protoinfo; + struct ctnl_counters counters[CTNL_DIR_MAX]; + struct ctnl_nat nat; +}; + +struct ctnl_msg_handler { + int type; + int (*handler)(struct sockaddr_nl *, struct nlmsghdr *, void *arg); +}; + +struct ctnl_handle { + struct nfnl_handle nfnlh; + struct ctnl_msg_handler *handler[IPCTNL_MSG_MAX]; +}; + +extern int ctnl_open(struct ctnl_handle *, u_int8_t, unsigned); +extern int ctnl_close(struct ctnl_handle *); +extern int ctnl_unregister_handler(struct ctnl_handle *, int); +extern int ctnl_register_handler(struct ctnl_handle *, + struct ctnl_msg_handler *); +extern int ctnl_new_conntrack(struct ctnl_handle *, struct ctnl_conntrack *); +extern int ctnl_upd_conntrack(struct ctnl_handle *, struct ctnl_conntrack *); +extern int ctnl_get_conntrack(struct ctnl_handle *, struct ctnl_tuple *, int); +extern int ctnl_del_conntrack(struct ctnl_handle *, struct ctnl_tuple *, int); +extern int ctnl_list_conntrack(struct ctnl_handle *, int); +extern int ctnl_list_conntrack_zero_counters(struct ctnl_handle *, int); +extern int ctnl_event_conntrack(struct ctnl_handle *, int); +extern int ctnl_flush_conntrack(struct ctnl_handle *); + +extern int ctnl_new_expect(struct ctnl_handle *, struct ctnl_tuple *, + struct ctnl_tuple *, struct ctnl_tuple *, + unsigned long); +extern int ctnl_del_expect(struct ctnl_handle *,struct ctnl_tuple *); +extern int ctnl_get_expect(struct ctnl_handle *, struct ctnl_tuple *); +extern int ctnl_list_expect(struct ctnl_handle *, int); +extern int ctnl_event_expect(struct ctnl_handle *, int); +extern int ctnl_flush_expect(struct ctnl_handle *); + +extern int ctnl_send(struct ctnl_handle *, struct nlmsghdr *); +extern int ctnl_wilddump_request(struct ctnl_handle *, int , int); + +#endif /* __LIBCTNETLINK_H */ diff --git a/include/libnetfilter_conntrack/libnfnetlink_conntrack.h b/include/libnetfilter_conntrack/libnfnetlink_conntrack.h deleted file mode 100644 index 954b3e2..0000000 --- a/include/libnetfilter_conntrack/libnfnetlink_conntrack.h +++ /dev/null @@ -1,131 +0,0 @@ -/* libctnetlink.h: Header file for the Connection Tracking library. - * - * Jay Schulist , Copyright (c) 2001. - * (C) 2002 by Harald Welte - * (C) 2005 by Pablo Neira Ayuso - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - */ - -#ifndef __LIBCTNETLINK_H -#define __LIBCTNETLINK_H - -#include -#include -#include -#include -#include - -/* we need this for "enum ip_conntrack_status" */ -#include - -#include - -#define CTNL_BUFFSIZE 4096 - -union ctnl_l4 { - /* Add other protocols here. */ - u_int16_t all; - struct { - u_int16_t port; - } tcp; - struct { - u_int16_t port; - } udp; - struct { - u_int8_t type, code; - u_int16_t id; - } icmp; - struct { - u_int16_t port; - } sctp; -}; - -struct ctnl_tuple { - union { - u_int32_t v4; - u_int64_t v6; - } src; - - union { - u_int32_t v4; - u_int64_t v6; - } dst; - - u_int8_t protonum; - union ctnl_l4 l4src; - union ctnl_l4 l4dst; -}; - -union ctnl_protoinfo { - struct { - u_int8_t state; - } tcp; -}; - -struct ctnl_counters { - u_int64_t packets; - u_int64_t bytes; -}; - -struct ctnl_nat { - u_int32_t min_ip, max_ip; - union ctnl_l4 l4min, l4max; -}; - -#define CTNL_DIR_ORIGINAL 0 -#define CTNL_DIR_REPLY 1 -#define CTNL_DIR_MAX CTNL_DIR_REPLY+1 - -struct ctnl_conntrack { - struct ctnl_tuple tuple[CTNL_DIR_MAX]; - - unsigned long timeout; - unsigned long mark; - unsigned int status; - unsigned int use; - unsigned int id; - - union ctnl_protoinfo protoinfo; - struct ctnl_counters counters[CTNL_DIR_MAX]; - struct ctnl_nat nat; -}; - -struct ctnl_msg_handler { - int type; - int (*handler)(struct sockaddr_nl *, struct nlmsghdr *, void *arg); -}; - -struct ctnl_handle { - struct nfnl_handle nfnlh; - struct ctnl_msg_handler *handler[IPCTNL_MSG_MAX]; -}; - -extern int ctnl_open(struct ctnl_handle *, u_int8_t, unsigned); -extern int ctnl_close(struct ctnl_handle *); -extern int ctnl_unregister_handler(struct ctnl_handle *, int); -extern int ctnl_register_handler(struct ctnl_handle *, - struct ctnl_msg_handler *); -extern int ctnl_new_conntrack(struct ctnl_handle *, struct ctnl_conntrack *); -extern int ctnl_upd_conntrack(struct ctnl_handle *, struct ctnl_conntrack *); -extern int ctnl_get_conntrack(struct ctnl_handle *, struct ctnl_tuple *, int); -extern int ctnl_del_conntrack(struct ctnl_handle *, struct ctnl_tuple *, int); -extern int ctnl_list_conntrack(struct ctnl_handle *, int); -extern int ctnl_list_conntrack_zero_counters(struct ctnl_handle *, int); -extern int ctnl_event_conntrack(struct ctnl_handle *, int); -extern int ctnl_flush_conntrack(struct ctnl_handle *); - -extern int ctnl_new_expect(struct ctnl_handle *, struct ctnl_tuple *, - struct ctnl_tuple *, struct ctnl_tuple *, - unsigned long); -extern int ctnl_del_expect(struct ctnl_handle *,struct ctnl_tuple *); -extern int ctnl_get_expect(struct ctnl_handle *, struct ctnl_tuple *); -extern int ctnl_list_expect(struct ctnl_handle *, int); -extern int ctnl_event_expect(struct ctnl_handle *, int); -extern int ctnl_flush_expect(struct ctnl_handle *); - -extern int ctnl_send(struct ctnl_handle *, struct nlmsghdr *); -extern int ctnl_wilddump_request(struct ctnl_handle *, int , int); - -#endif /* __LIBCTNETLINK_H */ -- cgit v1.2.3