| libnetfilter_conntrack.h | | libnetfilter_conntrack.h | |
| /* | | /* | |
|
| * (C) 2005-2007 by Pablo Neira Ayuso <pablo@netfilter.org> | | * (C) 2005-2008 by Pablo Neira Ayuso <pablo@netfilter.org> | |
| * | | * | |
| * This software may be used and distributed according to the terms | | * This software may be used and distributed according to the terms | |
| * of the GNU General Public License, incorporated herein by reference. | | * of the GNU General Public License, incorporated herein by reference. | |
| */ | | */ | |
| | | | |
| #ifndef _LIBNETFILTER_CONNTRACK_H_ | | #ifndef _LIBNETFILTER_CONNTRACK_H_ | |
| #define _LIBNETFILTER_CONNTRACK_H_ | | #define _LIBNETFILTER_CONNTRACK_H_ | |
| | | | |
| #include <netinet/in.h> | | #include <netinet/in.h> | |
| #include <libnfnetlink/linux_nfnetlink.h> | | #include <libnfnetlink/linux_nfnetlink.h> | |
| | | | |
| skipping to change at line 120 | | skipping to change at line 120 | |
| ATTR_MASTER_PORT_DST, /* u16 bits */ | | ATTR_MASTER_PORT_DST, /* u16 bits */ | |
| ATTR_MASTER_L3PROTO, /* u8 bits */ | | ATTR_MASTER_L3PROTO, /* u8 bits */ | |
| ATTR_MASTER_L4PROTO = 44, /* u8 bits */ | | ATTR_MASTER_L4PROTO = 44, /* u8 bits */ | |
| ATTR_SECMARK, /* u32 bits */ | | ATTR_SECMARK, /* u32 bits */ | |
| ATTR_ORIG_NAT_SEQ_CORRECTION_POS, /* u32 bits */ | | ATTR_ORIG_NAT_SEQ_CORRECTION_POS, /* u32 bits */ | |
| ATTR_ORIG_NAT_SEQ_OFFSET_BEFORE, /* u32 bits */ | | ATTR_ORIG_NAT_SEQ_OFFSET_BEFORE, /* u32 bits */ | |
| ATTR_ORIG_NAT_SEQ_OFFSET_AFTER = 48, /* u32 bits */ | | ATTR_ORIG_NAT_SEQ_OFFSET_AFTER = 48, /* u32 bits */ | |
| ATTR_REPL_NAT_SEQ_CORRECTION_POS, /* u32 bits */ | | ATTR_REPL_NAT_SEQ_CORRECTION_POS, /* u32 bits */ | |
| ATTR_REPL_NAT_SEQ_OFFSET_BEFORE, /* u32 bits */ | | ATTR_REPL_NAT_SEQ_OFFSET_BEFORE, /* u32 bits */ | |
| ATTR_REPL_NAT_SEQ_OFFSET_AFTER, /* u32 bits */ | | ATTR_REPL_NAT_SEQ_OFFSET_AFTER, /* u32 bits */ | |
|
| | | ATTR_SCTP_STATE = 52, /* u8 bits */ | |
| | | ATTR_SCTP_VTAG_ORIG, /* u32 bits */ | |
| | | ATTR_SCTP_VTAG_REPL, /* u32 bits */ | |
| ATTR_MAX | | ATTR_MAX | |
| }; | | }; | |
| | | | |
| /* message type */ | | /* message type */ | |
| enum nf_conntrack_msg_type { | | enum nf_conntrack_msg_type { | |
| NFCT_T_UNKNOWN = 0, | | NFCT_T_UNKNOWN = 0, | |
| | | | |
| NFCT_T_NEW_BIT = 0, | | NFCT_T_NEW_BIT = 0, | |
| NFCT_T_NEW = (1 << NFCT_T_NEW_BIT), | | NFCT_T_NEW = (1 << NFCT_T_NEW_BIT), | |
| | | | |
| | | | |
| skipping to change at line 254 | | skipping to change at line 257 | |
| NFCT_O_MAX | | NFCT_O_MAX | |
| }; | | }; | |
| | | | |
| /* output flags */ | | /* output flags */ | |
| enum { | | enum { | |
| NFCT_OF_SHOW_LAYER3_BIT = 0, | | NFCT_OF_SHOW_LAYER3_BIT = 0, | |
| NFCT_OF_SHOW_LAYER3 = (1 << NFCT_OF_SHOW_LAYER3_BIT), | | NFCT_OF_SHOW_LAYER3 = (1 << NFCT_OF_SHOW_LAYER3_BIT), | |
| | | | |
| NFCT_OF_TIME_BIT = 1, | | NFCT_OF_TIME_BIT = 1, | |
| NFCT_OF_TIME = (1 << NFCT_OF_TIME_BIT), | | NFCT_OF_TIME = (1 << NFCT_OF_TIME_BIT), | |
|
| | | | |
| | | NFCT_OF_ID_BIT = 2, | |
| | | NFCT_OF_ID = (1 << NFCT_OF_ID_BIT), | |
| }; | | }; | |
| | | | |
| extern int nfct_snprintf(char *buf, | | extern int nfct_snprintf(char *buf, | |
| unsigned int size, | | unsigned int size, | |
| const struct nf_conntrack *ct, | | const struct nf_conntrack *ct, | |
| const unsigned int msg_type, | | const unsigned int msg_type, | |
| const unsigned int out_type, | | const unsigned int out_type, | |
| const unsigned int out_flags); | | const unsigned int out_flags); | |
| | | | |
|
| | | /* comparison */ | |
| extern int nfct_compare(const struct nf_conntrack *ct1, | | extern int nfct_compare(const struct nf_conntrack *ct1, | |
| const struct nf_conntrack *ct2); | | const struct nf_conntrack *ct2); | |
| | | | |
|
| | | enum { | |
| | | NFCT_CMP_ALL = 0, | |
| | | NFCT_CMP_ORIG = (1 << 0), | |
| | | NFCT_CMP_REPL = (1 << 1), | |
| | | NFCT_CMP_TIMEOUT_EQ = (1 << 2), | |
| | | NFCT_CMP_TIMEOUT_GT = (1 << 3), | |
| | | NFCT_CMP_TIMEOUT_GE = (NFCT_CMP_TIMEOUT_EQ | NFCT_CMP_TIMEOUT_GT), | |
| | | NFCT_CMP_TIMEOUT_LT = (1 << 4), | |
| | | NFCT_CMP_TIMEOUT_LE = (NFCT_CMP_TIMEOUT_EQ | NFCT_CMP_TIMEOUT_LT), | |
| | | }; | |
| | | | |
| | | extern int nfct_cmp(const struct nf_conntrack *ct1, | |
| | | const struct nf_conntrack *ct2, | |
| | | unsigned int flags); | |
| | | | |
| /* query */ | | /* query */ | |
| enum nf_conntrack_query { | | enum nf_conntrack_query { | |
| NFCT_Q_CREATE, | | NFCT_Q_CREATE, | |
| NFCT_Q_UPDATE, | | NFCT_Q_UPDATE, | |
| NFCT_Q_DESTROY, | | NFCT_Q_DESTROY, | |
| NFCT_Q_GET, | | NFCT_Q_GET, | |
| NFCT_Q_FLUSH, | | NFCT_Q_FLUSH, | |
| NFCT_Q_DUMP, | | NFCT_Q_DUMP, | |
| NFCT_Q_DUMP_RESET, | | NFCT_Q_DUMP_RESET, | |
| NFCT_Q_CREATE_UPDATE, | | NFCT_Q_CREATE_UPDATE, | |
| }; | | }; | |
| | | | |
| extern int nfct_query(struct nfct_handle *h, | | extern int nfct_query(struct nfct_handle *h, | |
| const enum nf_conntrack_query query, | | const enum nf_conntrack_query query, | |
| const void *data); | | const void *data); | |
| | | | |
|
| | | extern int nfct_send(struct nfct_handle *h, | |
| | | const enum nf_conntrack_query query, | |
| | | const void *data); | |
| | | | |
| extern int nfct_catch(struct nfct_handle *h); | | extern int nfct_catch(struct nfct_handle *h); | |
| | | | |
|
| | | /* copy */ | |
| | | enum { | |
| | | NFCT_CP_ALL = 0, | |
| | | NFCT_CP_ORIG = (1 << 0), | |
| | | NFCT_CP_REPL = (1 << 1), | |
| | | NFCT_CP_META = (1 << 2), | |
| | | }; | |
| | | | |
| | | extern void nfct_copy(struct nf_conntrack *dest, | |
| | | const struct nf_conntrack *source, | |
| | | unsigned int flags); | |
| | | | |
| | | extern void nfct_copy_attr(struct nf_conntrack *ct1, | |
| | | const struct nf_conntrack *ct2, | |
| | | const enum nf_conntrack_attr type); | |
| | | | |
| /* low level API: netlink functions */ | | /* low level API: netlink functions */ | |
| | | | |
| extern int nfct_build_conntrack(struct nfnl_subsys_handle *ssh, | | extern int nfct_build_conntrack(struct nfnl_subsys_handle *ssh, | |
| void *req, | | void *req, | |
| size_t size, | | size_t size, | |
| u_int16_t type, | | u_int16_t type, | |
| u_int16_t flags, | | u_int16_t flags, | |
| const struct nf_conntrack *ct); | | const struct nf_conntrack *ct); | |
| | | | |
| extern int nfct_parse_conntrack(enum nf_conntrack_msg_type msg, | | extern int nfct_parse_conntrack(enum nf_conntrack_msg_type msg, | |
| | | | |
End of changes. 7 change blocks. |
| 1 lines changed or deleted | | 43 lines changed or added | |
|