• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _NFCT_PROTOTYPES_H_
2 #define _NFCT_PROTOTYPES_H_
3 
4 /*
5  * conntrack internal prototypes
6  */
7 int __build_conntrack(struct nfnl_subsys_handle *ssh, struct nfnlhdr *req, size_t size, uint16_t type, uint16_t flags, const struct nf_conntrack *ct);
8 void __build_tuple(struct nfnlhdr *req, size_t size, const struct __nfct_tuple *t, const int type);
9 int __parse_message_type(const struct nlmsghdr *nlh);
10 void __parse_conntrack(const struct nlmsghdr *nlh, struct nfattr *cda[], struct nf_conntrack *ct);
11 void __parse_tuple(const struct nfattr *attr, struct __nfct_tuple *tuple, int dir, uint32_t *set);
12 int __snprintf_conntrack(char *buf, unsigned int len, const struct nf_conntrack *ct, unsigned int type, unsigned int msg_output, unsigned int flags, struct nfct_labelmap *);
13 int __snprintf_address(char *buf, unsigned int len, const struct __nfct_tuple *tuple, const char *src_tag, const char *dst_tag);
14 int __snprintf_protocol(char *buf, unsigned int len, const struct nf_conntrack *ct);
15 int __snprintf_proto(char *buf, unsigned int len, const struct __nfct_tuple *tuple);
16 int __snprintf_conntrack_default(char *buf, unsigned int len, const struct nf_conntrack *ct, const unsigned int msg_type, const unsigned int flags, struct nfct_labelmap *);
17 int __snprintf_conntrack_xml(char *buf, unsigned int len, const struct nf_conntrack *ct, const unsigned int msg_type, const unsigned int flags, struct nfct_labelmap *);
18 int __snprintf_connlabels(char *buf, unsigned int len, struct nfct_labelmap *map, const struct nfct_bitmask *b, const char *fmt);
19 
20 enum __nfct_addr {
21 	__ADDR_SRC = 0,
22 	__ADDR_DST,
23 };
24 int __snprintf_addr_xml(char *buf, unsigned int len, const struct __nfct_tuple *tuple, enum __nfct_addr type);
25 int __snprintf_proto_xml(char *buf, unsigned int len, const struct __nfct_tuple *tuple, enum __nfct_addr type);
26 int __snprintf_localtime_xml(char *buf, unsigned int len, const struct tm *tm);
27 
28 const char *__proto2str(uint8_t protonum);
29 const char *__l3proto2str(uint8_t protonum);
30 
31 int __callback(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data);
32 
33 int __setobjopt(struct nf_conntrack *ct, unsigned int option);
34 int __getobjopt(const struct nf_conntrack *ct, unsigned int option);
35 int __compare(const struct nf_conntrack *ct1, const struct nf_conntrack *ct2, unsigned int flags);
36 int __cmp_orig(const struct nf_conntrack *ct1, const struct nf_conntrack *ct2, unsigned int flags);
37 void __copy_fast(struct nf_conntrack *ct1, const struct nf_conntrack *ct);
38 
39 int __setup_netlink_socket_filter(int fd, struct nfct_filter *filter);
40 
41 void __build_filter_dump(struct nfnlhdr *req, size_t size, const struct nfct_filter_dump *filter_dump);
42 
43 int nfct_build_tuple(struct nlmsghdr *nlh, const struct __nfct_tuple *t, int type);
44 int nfct_parse_tuple(const struct nlattr *attr, struct __nfct_tuple *tuple, int dir, uint32_t *set);
45 
46 /*
47  * expectation internal prototypes
48  */
49 int __build_expect(struct nfnl_subsys_handle *ssh, struct nfnlhdr *req, size_t size, uint16_t type, uint16_t flags, const struct nf_expect *exp);
50 int __parse_expect_message_type(const struct nlmsghdr *nlh);
51 void __parse_expect(const struct nlmsghdr *nlh, struct nfattr *cda[], struct nf_expect *exp);
52 int __expect_callback(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data);
53 int __cmp_expect(const struct nf_expect *exp1, const struct nf_expect *exp2, unsigned int flags);
54 int __snprintf_expect(char *buf, unsigned int len, const struct nf_expect *exp, unsigned int type, unsigned int msg_output, unsigned int flags);
55 int __snprintf_expect_default(char *buf, unsigned int len, const struct nf_expect *exp, unsigned int msg_type, unsigned int flags);
56 int __snprintf_expect_xml(char *buf, unsigned int len, const struct nf_expect *exp, unsigned int msg_type, unsigned int flags);
57 
58 /*
59  * connlabel internal prototypes
60  */
61 const char *__labels_get_path(void);
62 struct nfct_labelmap *__labelmap_new(const char *);
63 void __labelmap_destroy(struct nfct_labelmap *);
64 
65 int __labelmap_get_bit(struct nfct_labelmap *map, const char *name);
66 const char *__labelmap_get_name(struct nfct_labelmap *map, unsigned int bit);
67 
68 #endif
69