| libnetfilter_conntrack.h | | libnetfilter_conntrack.h | |
| | | | |
| skipping to change at line 130 | | skipping to change at line 130 | |
| ATTR_SCTP_STATE = 52, /* u8 bits */ | | ATTR_SCTP_STATE = 52, /* u8 bits */ | |
| ATTR_SCTP_VTAG_ORIG, /* u32 bits */ | | ATTR_SCTP_VTAG_ORIG, /* u32 bits */ | |
| ATTR_SCTP_VTAG_REPL, /* u32 bits */ | | ATTR_SCTP_VTAG_REPL, /* u32 bits */ | |
| ATTR_HELPER_NAME, /* string (30 bytes max) */ | | ATTR_HELPER_NAME, /* string (30 bytes max) */ | |
| ATTR_DCCP_STATE = 56, /* u8 bits */ | | ATTR_DCCP_STATE = 56, /* u8 bits */ | |
| ATTR_DCCP_ROLE, /* u8 bits */ | | ATTR_DCCP_ROLE, /* u8 bits */ | |
| ATTR_DCCP_HANDSHAKE_SEQ, /* u64 bits */ | | ATTR_DCCP_HANDSHAKE_SEQ, /* u64 bits */ | |
| ATTR_TCP_WSCALE_ORIG, /* u8 bits */ | | ATTR_TCP_WSCALE_ORIG, /* u8 bits */ | |
| ATTR_TCP_WSCALE_REPL = 60, /* u8 bits */ | | ATTR_TCP_WSCALE_REPL = 60, /* u8 bits */ | |
| ATTR_ZONE, /* u16 bits */ | | ATTR_ZONE, /* u16 bits */ | |
|
| | | ATTR_SECCTX, /* string */ | |
| | | ATTR_TIMESTAMP_START, /* u64 bits, linux >= 2.6.38 | |
| | | */ | |
| | | ATTR_TIMESTAMP_STOP = 64, /* u64 bits, linux >= 2.6.38 | |
| | | */ | |
| ATTR_MAX | | ATTR_MAX | |
| }; | | }; | |
| | | | |
| /* conntrack attribute groups */ | | /* conntrack attribute groups */ | |
| enum nf_conntrack_attr_grp { | | enum nf_conntrack_attr_grp { | |
| ATTR_GRP_ORIG_IPV4 = 0, /* struct nfct_attr_grp_ipv4
*/ | | ATTR_GRP_ORIG_IPV4 = 0, /* struct nfct_attr_grp_ipv4
*/ | |
| ATTR_GRP_REPL_IPV4, /* struct nfct_attr_grp_ipv4
*/ | | ATTR_GRP_REPL_IPV4, /* struct nfct_attr_grp_ipv4
*/ | |
| ATTR_GRP_ORIG_IPV6, /* struct nfct_attr_grp_ipv6
*/ | | ATTR_GRP_ORIG_IPV6, /* struct nfct_attr_grp_ipv6
*/ | |
| ATTR_GRP_REPL_IPV6, /* struct nfct_attr_grp_ipv6
*/ | | ATTR_GRP_REPL_IPV6, /* struct nfct_attr_grp_ipv6
*/ | |
| ATTR_GRP_ORIG_PORT = 4, /* struct nfct_attr_grp_port
*/ | | ATTR_GRP_ORIG_PORT = 4, /* struct nfct_attr_grp_port
*/ | |
| | | | |
| skipping to change at line 199 | | skipping to change at line 202 | |
| }; | | }; | |
| | | | |
| /* constructor / destructor */ | | /* constructor / destructor */ | |
| extern struct nf_conntrack *nfct_new(void); | | extern struct nf_conntrack *nfct_new(void); | |
| extern void nfct_destroy(struct nf_conntrack *ct); | | extern void nfct_destroy(struct nf_conntrack *ct); | |
| | | | |
| /* clone */ | | /* clone */ | |
| struct nf_conntrack *nfct_clone(const struct nf_conntrack *ct); | | struct nf_conntrack *nfct_clone(const struct nf_conntrack *ct); | |
| | | | |
| /* object size */ | | /* object size */ | |
|
| extern size_t nfct_sizeof(const struct nf_conntrack *ct); | | extern __attribute__((deprecated)) size_t nfct_sizeof(const struct nf_connt
rack *ct); | |
| | | | |
| /* maximum object size */ | | /* maximum object size */ | |
|
| extern size_t nfct_maxsize(void); | | extern __attribute__((deprecated)) size_t nfct_maxsize(void); | |
| | | | |
| /* set option */ | | /* set option */ | |
| enum { | | enum { | |
| NFCT_SOPT_UNDO_SNAT, | | NFCT_SOPT_UNDO_SNAT, | |
| NFCT_SOPT_UNDO_DNAT, | | NFCT_SOPT_UNDO_DNAT, | |
| NFCT_SOPT_UNDO_SPAT, | | NFCT_SOPT_UNDO_SPAT, | |
| NFCT_SOPT_UNDO_DPAT, | | NFCT_SOPT_UNDO_DPAT, | |
| NFCT_SOPT_SETUP_ORIGINAL, | | NFCT_SOPT_SETUP_ORIGINAL, | |
| NFCT_SOPT_SETUP_REPLY, | | NFCT_SOPT_SETUP_REPLY, | |
| __NFCT_SOPT_MAX, | | __NFCT_SOPT_MAX, | |
| | | | |
| skipping to change at line 346 | | skipping to change at line 349 | |
| /* 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_BIT = 2, | |
| NFCT_OF_ID = (1 << NFCT_OF_ID_BIT), | | NFCT_OF_ID = (1 << NFCT_OF_ID_BIT), | |
|
| | | | |
| | | NFCT_OF_TIMESTAMP_BIT = 3, | |
| | | NFCT_OF_TIMESTAMP = (1 << NFCT_OF_TIMESTAMP_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 */ | | /* comparison */ | |
| | | | |
| skipping to change at line 404 | | skipping to change at line 410 | |
| const void *data); | | const void *data); | |
| | | | |
| extern int nfct_catch(struct nfct_handle *h); | | extern int nfct_catch(struct nfct_handle *h); | |
| | | | |
| /* copy */ | | /* copy */ | |
| enum { | | enum { | |
| NFCT_CP_ALL = 0, | | NFCT_CP_ALL = 0, | |
| NFCT_CP_ORIG = (1 << 0), | | NFCT_CP_ORIG = (1 << 0), | |
| NFCT_CP_REPL = (1 << 1), | | NFCT_CP_REPL = (1 << 1), | |
| NFCT_CP_META = (1 << 2), | | NFCT_CP_META = (1 << 2), | |
|
| | | NFCT_CP_OVERRIDE = (1 << 3), | |
| }; | | }; | |
| | | | |
| extern void nfct_copy(struct nf_conntrack *dest, | | extern void nfct_copy(struct nf_conntrack *dest, | |
| const struct nf_conntrack *source, | | const struct nf_conntrack *source, | |
| unsigned int flags); | | unsigned int flags); | |
| | | | |
| extern void nfct_copy_attr(struct nf_conntrack *ct1, | | extern void nfct_copy_attr(struct nf_conntrack *ct1, | |
| const struct nf_conntrack *ct2, | | const struct nf_conntrack *ct2, | |
| const enum nf_conntrack_attr type); | | const enum nf_conntrack_attr type); | |
| | | | |
| | | | |
| skipping to change at line 467 | | skipping to change at line 474 | |
| | | | |
| extern int nfct_filter_set_logic(struct nfct_filter *filter, | | extern int nfct_filter_set_logic(struct nfct_filter *filter, | |
| const enum nfct_filter_attr attr, | | const enum nfct_filter_attr attr, | |
| const enum nfct_filter_logic logic); | | const enum nfct_filter_logic logic); | |
| | | | |
| extern int nfct_filter_attach(int fd, struct nfct_filter *filter); | | extern int nfct_filter_attach(int fd, struct nfct_filter *filter); | |
| extern int nfct_filter_detach(int fd); | | extern int nfct_filter_detach(int fd); | |
| | | | |
| /* low level API: netlink functions */ | | /* low level API: netlink functions */ | |
| | | | |
|
| extern int nfct_build_conntrack(struct nfnl_subsys_handle *ssh, | | extern __attribute__((deprecated)) 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 __attribute__((deprecated)) | |
| | | int nfct_parse_conntrack(enum nf_conntrack_msg_type msg, | |
| const struct nlmsghdr *nlh, | | const struct nlmsghdr *nlh, | |
| struct nf_conntrack *ct); | | struct nf_conntrack *ct); | |
| | | | |
|
| extern int nfct_build_query(struct nfnl_subsys_handle *ssh, | | extern __attribute__((deprecated)) | |
| | | int nfct_build_query(struct nfnl_subsys_handle *ssh, | |
| const enum nf_conntrack_query query, | | const enum nf_conntrack_query query, | |
| const void *data, | | const void *data, | |
| void *req, | | void *req, | |
| unsigned int size); | | unsigned int size); | |
| | | | |
| /* | | /* | |
| * NEW expectation API | | * NEW expectation API | |
| */ | | */ | |
| | | | |
| /* expectation object */ | | /* expectation object */ | |
| struct nf_expect; | | struct nf_expect; | |
| | | | |
| /* expect attributes */ | | /* expect attributes */ | |
| enum nf_expect_attr { | | enum nf_expect_attr { | |
| ATTR_EXP_MASTER = 0, /* pointer to conntrack object */ | | ATTR_EXP_MASTER = 0, /* pointer to conntrack object */ | |
| ATTR_EXP_EXPECTED, /* pointer to conntrack object */ | | ATTR_EXP_EXPECTED, /* pointer to conntrack object */ | |
| ATTR_EXP_MASK, /* pointer to conntrack object */ | | ATTR_EXP_MASK, /* pointer to conntrack object */ | |
| ATTR_EXP_TIMEOUT, /* u32 bits */ | | ATTR_EXP_TIMEOUT, /* u32 bits */ | |
|
| | | ATTR_EXP_ZONE, /* u16 bits */ | |
| | | ATTR_EXP_FLAGS, /* u32 bits */ | |
| ATTR_EXP_MAX | | ATTR_EXP_MAX | |
| }; | | }; | |
| | | | |
| /* constructor / destructor */ | | /* constructor / destructor */ | |
| extern struct nf_expect *nfexp_new(void); | | extern struct nf_expect *nfexp_new(void); | |
| extern void nfexp_destroy(struct nf_expect *exp); | | extern void nfexp_destroy(struct nf_expect *exp); | |
| | | | |
| /* clone */ | | /* clone */ | |
| extern struct nf_expect *nfexp_clone(const struct nf_expect *exp); | | extern struct nf_expect *nfexp_clone(const struct nf_expect *exp); | |
| | | | |
| | | | |
| skipping to change at line 588 | | skipping to change at line 600 | |
| /* print */ | | /* print */ | |
| extern int nfexp_snprintf(char *buf, | | extern int nfexp_snprintf(char *buf, | |
| unsigned int size, | | unsigned int size, | |
| const struct nf_expect *exp, | | const struct nf_expect *exp, | |
| 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); | |
| | | | |
| extern int nfexp_catch(struct nfct_handle *h); | | extern int nfexp_catch(struct nfct_handle *h); | |
| | | | |
|
| | | /* low level API */ | |
| | | extern __attribute__((deprecated)) | |
| | | int nfexp_build_expect(struct nfnl_subsys_handle *ssh, | |
| | | void *req, | |
| | | size_t size, | |
| | | u_int16_t type, | |
| | | u_int16_t flags, | |
| | | const struct nf_expect *exp); | |
| | | | |
| | | extern __attribute__((deprecated)) | |
| | | int nfexp_parse_expect(enum nf_conntrack_msg_type type, | |
| | | const struct nlmsghdr *nlh, | |
| | | struct nf_expect *exp); | |
| | | | |
| | | extern __attribute__((deprecated)) | |
| | | int nfexp_build_query(struct nfnl_subsys_handle *ssh, | |
| | | const enum nf_conntrack_query qt, | |
| | | const void *data, | |
| | | void *buffer, | |
| | | unsigned int size); | |
| | | | |
| /* Bitset representing status of connection. Taken from ip_conntrack.h | | /* Bitset representing status of connection. Taken from ip_conntrack.h | |
| * | | * | |
| * Note: For backward compatibility this shouldn't ever change | | * Note: For backward compatibility this shouldn't ever change | |
| * in kernel space. | | * in kernel space. | |
| */ | | */ | |
| enum ip_conntrack_status { | | enum ip_conntrack_status { | |
| /* It's an expected connection: bit 0 set. This bit never changed *
/ | | /* It's an expected connection: bit 0 set. This bit never changed *
/ | |
| IPS_EXPECTED_BIT = 0, | | IPS_EXPECTED_BIT = 0, | |
| IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), | | IPS_EXPECTED = (1 << IPS_EXPECTED_BIT), | |
| | | | |
| | | | |
| skipping to change at line 639 | | skipping to change at line 672 | |
| IPS_DST_NAT_DONE_BIT = 8, | | IPS_DST_NAT_DONE_BIT = 8, | |
| IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT), | | IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT), | |
| | | | |
| /* Both together */ | | /* Both together */ | |
| IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE), | | IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE), | |
| | | | |
| /* Connection is dying (removed from lists), can not be unset. */ | | /* Connection is dying (removed from lists), can not be unset. */ | |
| IPS_DYING_BIT = 9, | | IPS_DYING_BIT = 9, | |
| IPS_DYING = (1 << IPS_DYING_BIT), | | IPS_DYING = (1 << IPS_DYING_BIT), | |
| | | | |
|
| /* Connection has fixed timeout. */ | | /* Connection has fixed timeout. */ | |
| IPS_FIXED_TIMEOUT_BIT = 10, | | IPS_FIXED_TIMEOUT_BIT = 10, | |
| IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), | | IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), | |
|
| | | | |
| | | /* Conntrack is a template */ | |
| | | IPS_TEMPLATE_BIT = 11, | |
| | | IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT), | |
| | | | |
| | | /* Conntrack is a fake untracked entry */ | |
| | | IPS_UNTRACKED_BIT = 12, | |
| | | IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT), | |
| }; | | }; | |
| | | | |
|
| | | /* expectation flags */ | |
| | | #define NF_CT_EXPECT_PERMANENT 0x1 | |
| | | #define NF_CT_EXPECT_INACTIVE 0x2 | |
| | | #define NF_CT_EXPECT_USERSPACE 0x4 | |
| | | | |
| /* | | /* | |
| * TCP flags | | * TCP flags | |
| */ | | */ | |
| | | | |
| /* Window scaling is advertised by the sender */ | | /* Window scaling is advertised by the sender */ | |
| #define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01 | | #define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01 | |
| | | | |
| /* SACK is permitted by the sender */ | | /* SACK is permitted by the sender */ | |
| #define IP_CT_TCP_FLAG_SACK_PERM 0x02 | | #define IP_CT_TCP_FLAG_SACK_PERM 0x02 | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 6 lines changed or deleted | | 54 lines changed or added | |
|