Home
last modified time | relevance | path

Searched refs:ct (Results 1 – 25 of 351) sorted by relevance

12345678910>>...15

/external/libnetfilter_conntrack/src/conntrack/
Dgetter.c12 static const void *get_attr_orig_ipv4_src(const struct nf_conntrack *ct) in get_attr_orig_ipv4_src() argument
14 return &ct->head.orig.src.v4; in get_attr_orig_ipv4_src()
17 static const void *get_attr_orig_ipv4_dst(const struct nf_conntrack *ct) in get_attr_orig_ipv4_dst() argument
19 return &ct->head.orig.dst.v4; in get_attr_orig_ipv4_dst()
22 static const void *get_attr_repl_ipv4_src(const struct nf_conntrack *ct) in get_attr_repl_ipv4_src() argument
24 return &ct->repl.src.v4; in get_attr_repl_ipv4_src()
27 static const void *get_attr_repl_ipv4_dst(const struct nf_conntrack *ct) in get_attr_repl_ipv4_dst() argument
29 return &ct->repl.dst.v4; in get_attr_repl_ipv4_dst()
32 static const void *get_attr_orig_ipv6_src(const struct nf_conntrack *ct) in get_attr_orig_ipv6_src() argument
34 return &ct->head.orig.src.v6; in get_attr_orig_ipv6_src()
[all …]
Dobjopt.c12 static void __autocomplete(struct nf_conntrack *ct, int dir) in __autocomplete() argument
18 this = &ct->head.orig; in __autocomplete()
19 other = &ct->repl; in __autocomplete()
22 this = &ct->repl; in __autocomplete()
23 other = &ct->head.orig; in __autocomplete()
50 ct->head.set[0] |= TS_ORIG | TS_REPL; in __autocomplete()
53 static void setobjopt_undo_snat(struct nf_conntrack *ct) in setobjopt_undo_snat() argument
55 switch (ct->head.orig.l3protonum) { in setobjopt_undo_snat()
57 ct->snat.min_ip.v4 = ct->repl.dst.v4; in setobjopt_undo_snat()
58 ct->snat.max_ip.v4 = ct->snat.min_ip.v4; in setobjopt_undo_snat()
[all …]
Dbuild_mnl.c114 nfct_build_protoinfo(struct nlmsghdr *nlh, const struct nf_conntrack *ct) in nfct_build_protoinfo() argument
118 switch(ct->head.orig.protonum) { in nfct_build_protoinfo()
123 if (!(test_bit(ATTR_TCP_STATE, ct->head.set) || in nfct_build_protoinfo()
124 test_bit(ATTR_TCP_FLAGS_ORIG, ct->head.set) || in nfct_build_protoinfo()
125 test_bit(ATTR_TCP_FLAGS_REPL, ct->head.set) || in nfct_build_protoinfo()
126 test_bit(ATTR_TCP_MASK_ORIG, ct->head.set) || in nfct_build_protoinfo()
127 test_bit(ATTR_TCP_MASK_REPL, ct->head.set) || in nfct_build_protoinfo()
128 test_bit(ATTR_TCP_WSCALE_ORIG, ct->head.set) || in nfct_build_protoinfo()
129 test_bit(ATTR_TCP_WSCALE_REPL, ct->head.set))) { in nfct_build_protoinfo()
134 if (test_bit(ATTR_TCP_STATE, ct->head.set)) { in nfct_build_protoinfo()
[all …]
Dsetter.c41 set_attr_orig_ipv4_src(struct nf_conntrack *ct, const void *value, size_t len) in set_attr_orig_ipv4_src() argument
43 ct->head.orig.src.v4 = *((uint32_t *) value); in set_attr_orig_ipv4_src()
47 set_attr_orig_ipv4_dst(struct nf_conntrack *ct, const void *value, size_t len) in set_attr_orig_ipv4_dst() argument
49 ct->head.orig.dst.v4 = *((uint32_t *) value); in set_attr_orig_ipv4_dst()
53 set_attr_repl_ipv4_src(struct nf_conntrack *ct, const void *value, size_t len) in set_attr_repl_ipv4_src() argument
55 ct->repl.src.v4 = *((uint32_t *) value); in set_attr_repl_ipv4_src()
59 set_attr_repl_ipv4_dst(struct nf_conntrack *ct, const void *value, size_t len) in set_attr_repl_ipv4_dst() argument
61 ct->repl.dst.v4 = *((uint32_t *) value); in set_attr_repl_ipv4_dst()
65 set_attr_orig_ipv6_src(struct nf_conntrack *ct, const void *value, size_t len) in set_attr_orig_ipv6_src() argument
67 memcpy(&ct->head.orig.src.v6, value, sizeof(uint32_t)*4); in set_attr_orig_ipv6_src()
[all …]
Dbuild.c107 const struct nf_conntrack *ct) in __build_protoinfo() argument
111 switch(ct->head.orig.protonum) { in __build_protoinfo()
116 if (!(test_bit(ATTR_TCP_STATE, ct->head.set) || in __build_protoinfo()
117 test_bit(ATTR_TCP_FLAGS_ORIG, ct->head.set) || in __build_protoinfo()
118 test_bit(ATTR_TCP_FLAGS_REPL, ct->head.set) || in __build_protoinfo()
119 test_bit(ATTR_TCP_MASK_ORIG, ct->head.set) || in __build_protoinfo()
120 test_bit(ATTR_TCP_MASK_REPL, ct->head.set) || in __build_protoinfo()
121 test_bit(ATTR_TCP_WSCALE_ORIG, ct->head.set) || in __build_protoinfo()
122 test_bit(ATTR_TCP_WSCALE_REPL, ct->head.set))) { in __build_protoinfo()
127 if (test_bit(ATTR_TCP_STATE, ct->head.set)) in __build_protoinfo()
[all …]
Dgrp_getter.c12 static void get_attr_grp_orig_ipv4(const struct nf_conntrack *ct, void *data) in get_attr_grp_orig_ipv4() argument
15 this->src = ct->head.orig.src.v4; in get_attr_grp_orig_ipv4()
16 this->dst = ct->head.orig.dst.v4; in get_attr_grp_orig_ipv4()
19 static void get_attr_grp_repl_ipv4(const struct nf_conntrack *ct, void *data) in get_attr_grp_repl_ipv4() argument
22 this->src = ct->repl.src.v4; in get_attr_grp_repl_ipv4()
23 this->dst = ct->repl.dst.v4; in get_attr_grp_repl_ipv4()
26 static void get_attr_grp_orig_ipv6(const struct nf_conntrack *ct, void *data) in get_attr_grp_orig_ipv6() argument
29 memcpy(this->src, &ct->head.orig.src.v6, sizeof(uint32_t)*4); in get_attr_grp_orig_ipv6()
30 memcpy(this->dst, &ct->head.orig.dst.v6, sizeof(uint32_t)*4); in get_attr_grp_orig_ipv6()
33 static void get_attr_grp_repl_ipv6(const struct nf_conntrack *ct, void *data) in get_attr_grp_repl_ipv6() argument
[all …]
Dparse.c209 struct nf_conntrack *ct) in __parse_protoinfo_tcp() argument
216 ct->protoinfo.tcp.state = in __parse_protoinfo_tcp()
218 set_bit(ATTR_TCP_STATE, ct->head.set); in __parse_protoinfo_tcp()
222 memcpy(&ct->protoinfo.tcp.wscale[__DIR_ORIG], in __parse_protoinfo_tcp()
225 set_bit(ATTR_TCP_WSCALE_ORIG, ct->head.set); in __parse_protoinfo_tcp()
229 memcpy(&ct->protoinfo.tcp.wscale[__DIR_REPL], in __parse_protoinfo_tcp()
232 set_bit(ATTR_TCP_WSCALE_REPL, ct->head.set); in __parse_protoinfo_tcp()
236 memcpy(&ct->protoinfo.tcp.flags[0], in __parse_protoinfo_tcp()
239 set_bit(ATTR_TCP_FLAGS_ORIG, ct->head.set); in __parse_protoinfo_tcp()
240 set_bit(ATTR_TCP_MASK_ORIG, ct->head.set); in __parse_protoinfo_tcp()
[all …]
Dsnprintf_default.c14 const struct nf_conntrack *ct) in __snprintf_l3protocol() argument
17 l3proto2str[ct->head.orig.l3protonum] == NULL ? in __snprintf_l3protocol()
18 "unknown" : l3proto2str[ct->head.orig.l3protonum], in __snprintf_l3protocol()
19 ct->head.orig.l3protonum)); in __snprintf_l3protocol()
24 const struct nf_conntrack *ct) in __snprintf_protocol() argument
27 proto2str[ct->head.orig.protonum] == NULL ? in __snprintf_protocol()
28 "unknown" : proto2str[ct->head.orig.protonum], in __snprintf_protocol()
29 ct->head.orig.protonum)); in __snprintf_protocol()
34 const struct nf_conntrack *ct) in __snprintf_timeout() argument
36 return snprintf(buf, len, "%u ", ct->timeout); in __snprintf_timeout()
[all …]
Dgrp_setter.c40 static void set_attr_grp_orig_ipv4(struct nf_conntrack *ct, const void *value) in set_attr_grp_orig_ipv4() argument
43 ct->head.orig.src.v4 = this->src; in set_attr_grp_orig_ipv4()
44 ct->head.orig.dst.v4 = this->dst; in set_attr_grp_orig_ipv4()
45 ct->head.orig.l3protonum = AF_INET; in set_attr_grp_orig_ipv4()
48 static void set_attr_grp_repl_ipv4(struct nf_conntrack *ct, const void *value) in set_attr_grp_repl_ipv4() argument
51 ct->repl.src.v4 = this->src; in set_attr_grp_repl_ipv4()
52 ct->repl.dst.v4 = this->dst; in set_attr_grp_repl_ipv4()
53 ct->repl.l3protonum = AF_INET; in set_attr_grp_repl_ipv4()
56 static void set_attr_grp_orig_ipv6(struct nf_conntrack *ct, const void *value) in set_attr_grp_orig_ipv6() argument
59 memcpy(&ct->head.orig.src.v6, this->src, sizeof(uint32_t)*4); in set_attr_grp_orig_ipv6()
[all …]
Dparse_mnl.c330 nfct_parse_protoinfo_tcp(const struct nlattr *attr, struct nf_conntrack *ct) in nfct_parse_protoinfo_tcp() argument
338 ct->protoinfo.tcp.state = in nfct_parse_protoinfo_tcp()
340 set_bit(ATTR_TCP_STATE, ct->head.set); in nfct_parse_protoinfo_tcp()
344 memcpy(&ct->protoinfo.tcp.wscale[__DIR_ORIG], in nfct_parse_protoinfo_tcp()
347 set_bit(ATTR_TCP_WSCALE_ORIG, ct->head.set); in nfct_parse_protoinfo_tcp()
351 memcpy(&ct->protoinfo.tcp.wscale[__DIR_REPL], in nfct_parse_protoinfo_tcp()
354 set_bit(ATTR_TCP_WSCALE_REPL, ct->head.set); in nfct_parse_protoinfo_tcp()
358 memcpy(&ct->protoinfo.tcp.flags[0], in nfct_parse_protoinfo_tcp()
361 set_bit(ATTR_TCP_FLAGS_ORIG, ct->head.set); in nfct_parse_protoinfo_tcp()
362 set_bit(ATTR_TCP_MASK_ORIG, ct->head.set); in nfct_parse_protoinfo_tcp()
[all …]
Dsnprintf_xml.c164 const struct nf_conntrack *ct, in __snprintf_counters_xml() argument
171 (unsigned long long)ct->counters[type].packets); in __snprintf_counters_xml()
175 (unsigned long long)ct->counters[type].bytes); in __snprintf_counters_xml()
183 const struct nf_conntrack *ct) in __snprintf_timestamp_start() argument
189 (unsigned long long)ct->timestamp.start); in __snprintf_timestamp_start()
197 const struct nf_conntrack *ct) in __snprintf_timestamp_stop() argument
203 (unsigned long long)ct->timestamp.stop); in __snprintf_timestamp_stop()
211 const struct nf_conntrack *ct) in __snprintf_deltatime_now() argument
218 delta_time = now - (time_t)(ct->timestamp.start / NSEC_PER_SEC); in __snprintf_deltatime_now()
228 __snprintf_deltatime(char *buf, unsigned int len, const struct nf_conntrack *ct) in __snprintf_deltatime() argument
[all …]
Dapi.c77 struct nf_conntrack *ct; in nfct_new() local
79 ct = malloc(sizeof(struct nf_conntrack)); in nfct_new()
80 if (!ct) in nfct_new()
83 memset(ct, 0, sizeof(struct nf_conntrack)); in nfct_new()
85 return ct; in nfct_new()
92 void nfct_destroy(struct nf_conntrack *ct) in nfct_destroy() argument
94 assert(ct != NULL); in nfct_destroy()
95 if (ct->secctx) in nfct_destroy()
96 free(ct->secctx); in nfct_destroy()
97 if (ct->helper_info) in nfct_destroy()
[all …]
/external/libnl/lib/netfilter/
Dct_obj.c60 struct nfnl_ct *ct = (struct nfnl_ct *) c; in ct_free_data() local
62 if (ct == NULL) in ct_free_data()
65 nl_addr_put(ct->ct_orig.src); in ct_free_data()
66 nl_addr_put(ct->ct_orig.dst); in ct_free_data()
67 nl_addr_put(ct->ct_repl.src); in ct_free_data()
68 nl_addr_put(ct->ct_repl.dst); in ct_free_data()
121 static void dump_icmp(struct nl_dump_params *p, struct nfnl_ct *ct, int reply) in dump_icmp() argument
123 if (nfnl_ct_test_icmp_type(ct, reply)) in dump_icmp()
124 nl_dump(p, "icmp type %d ", nfnl_ct_get_icmp_type(ct, reply)); in dump_icmp()
126 if (nfnl_ct_test_icmp_code(ct, reply)) in dump_icmp()
[all …]
Dct.c119 static int ct_parse_ip(struct nfnl_ct *ct, int repl, struct nlattr *attr) in ct_parse_ip() argument
133 err = nfnl_ct_set_src(ct, repl, addr); in ct_parse_ip()
142 err = nfnl_ct_set_dst(ct, repl, addr); in ct_parse_ip()
151 err = nfnl_ct_set_src(ct, repl, addr); in ct_parse_ip()
160 err = nfnl_ct_set_dst(ct, repl, addr); in ct_parse_ip()
174 static int ct_parse_proto(struct nfnl_ct *ct, int repl, struct nlattr *attr) in ct_parse_proto() argument
184 nfnl_ct_set_proto(ct, nla_get_u8(tb[CTA_PROTO_NUM])); in ct_parse_proto()
186 nfnl_ct_set_src_port(ct, repl, in ct_parse_proto()
189 nfnl_ct_set_dst_port(ct, repl, in ct_parse_proto()
192 if (ct->ct_family == AF_INET) { in ct_parse_proto()
[all …]
/external/libnetfilter_conntrack/utils/
Dconntrack_master.c14 struct nf_conntrack *ct, *expected; in main() local
17 ct = nfct_new(); in main()
18 if (!ct) { in main()
23 nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET); in main()
24 nfct_set_attr_u32(ct, ATTR_IPV4_SRC, inet_addr("1.1.1.1")); in main()
25 nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr("2.2.2.2")); in main()
27 nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP); in main()
28 nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(20)); in main()
29 nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(10)); in main()
31 nfct_setobjopt(ct, NFCT_SOPT_SETUP_REPLY); in main()
[all …]
Dconntrack_create_nat.c14 struct nf_conntrack *ct; in main() local
16 ct = nfct_new(); in main()
17 if (!ct) { in main()
22 nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET); in main()
23 nfct_set_attr_u32(ct, ATTR_IPV4_SRC, inet_addr("1.1.1.1")); in main()
24 nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr("2.2.2.2")); in main()
26 nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP); in main()
27 nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(20)); in main()
28 nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(10)); in main()
30 nfct_setobjopt(ct, NFCT_SOPT_SETUP_REPLY); in main()
[all …]
Dconntrack_update.c14 struct nf_conntrack *ct; in main() local
16 ct = nfct_new(); in main()
17 if (!ct) { in main()
22 nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET); in main()
23 nfct_set_attr_u32(ct, ATTR_IPV4_SRC, inet_addr("1.1.1.1")); in main()
24 nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr("2.2.2.2")); in main()
26 nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP); in main()
27 nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(20)); in main()
28 nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(10)); in main()
30 nfct_setobjopt(ct, NFCT_SOPT_SETUP_REPLY); in main()
[all …]
Dconntrack_create.c14 struct nf_conntrack *ct; in main() local
16 ct = nfct_new(); in main()
17 if (!ct) { in main()
22 nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET); in main()
23 nfct_set_attr_u32(ct, ATTR_IPV4_SRC, inet_addr("1.1.1.1")); in main()
24 nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr("2.2.2.2")); in main()
26 nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP); in main()
27 nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(20)); in main()
28 nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(10)); in main()
30 nfct_setobjopt(ct, NFCT_SOPT_SETUP_REPLY); in main()
[all …]
Dconntrack_get.c11 struct nf_conntrack *ct, in cb() argument
16 nfct_snprintf(buf, sizeof(buf), ct, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, NFCT_OF_SHOW_LAYER3); in cb()
26 struct nf_conntrack *ct; in main() local
28 ct = nfct_new(); in main()
29 if (!ct) { in main()
34 nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET); in main()
35 nfct_set_attr_u32(ct, ATTR_IPV4_SRC, inet_addr("1.1.1.1")); in main()
36 nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr("2.2.2.2")); in main()
38 nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP); in main()
39 nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(20)); in main()
[all …]
Dconntrack_grp_create.c14 struct nf_conntrack *ct; in main() local
16 ct = nfct_new(); in main()
17 if (!ct) { in main()
26 nfct_set_attr_grp(ct, ATTR_GRP_ORIG_IPV4, &grp_ipv4); in main()
32 nfct_set_attr_grp(ct, ATTR_GRP_ORIG_PORT, &grp_port); in main()
33 nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP); in main()
35 nfct_setobjopt(ct, NFCT_SOPT_SETUP_REPLY); in main()
37 nfct_set_attr_u8(ct, ATTR_TCP_STATE, TCP_CONNTRACK_SYN_SENT); in main()
38 nfct_set_attr_u32(ct, ATTR_TIMEOUT, 100); in main()
39 nfct_set_attr(ct, ATTR_HELPER_NAME, "ftp"); in main()
[all …]
/external/libnl/src/lib/
Dct.c24 struct nfnl_ct *ct; in nl_cli_ct_alloc() local
26 ct = nfnl_ct_alloc(); in nl_cli_ct_alloc()
27 if (!ct) in nl_cli_ct_alloc()
30 return ct; in nl_cli_ct_alloc()
38 void nl_cli_ct_parse_family(struct nfnl_ct *ct, char *arg) in nl_cli_ct_parse_family() argument
47 nfnl_ct_set_family(ct, family); in nl_cli_ct_parse_family()
50 void nl_cli_ct_parse_protocol(struct nfnl_ct *ct, char *arg) in nl_cli_ct_parse_protocol() argument
59 nfnl_ct_set_proto(ct, proto); in nl_cli_ct_parse_protocol()
62 void nl_cli_ct_parse_mark(struct nfnl_ct *ct, char *arg) in nl_cli_ct_parse_mark() argument
65 nfnl_ct_set_mark(ct, mark); in nl_cli_ct_parse_mark()
[all …]
/external/libnl/src/
Dnf-ct-add.c51 struct nfnl_ct *ct; in main() local
58 ct = nl_cli_ct_alloc(); in main()
104 case '4': nfnl_ct_set_family(ct, AF_INET); break; in main()
105 case '6': nfnl_ct_set_family(ct, AF_INET6); break; in main()
108 case 'p': nl_cli_ct_parse_protocol(ct, optarg); break; in main()
109 case ARG_ORIG_SRC: nl_cli_ct_parse_src(ct, 0, optarg); break; in main()
110 case ARG_ORIG_SPORT: nl_cli_ct_parse_src_port(ct, 0, optarg); break; in main()
111 case ARG_ORIG_DST: nl_cli_ct_parse_dst(ct, 0, optarg); break; in main()
112 case ARG_ORIG_DPORT: nl_cli_ct_parse_dst_port(ct, 0, optarg); break; in main()
113 case ARG_REPLY_SRC: nl_cli_ct_parse_src(ct, 1, optarg); break; in main()
[all …]
Dnf-ct-list.c52 struct nfnl_ct *ct; in main() local
58 ct = nl_cli_ct_alloc(); in main()
105 case '4': nfnl_ct_set_family(ct, AF_INET); break; in main()
106 case '6': nfnl_ct_set_family(ct, AF_INET6); break; in main()
110 case 'i': nl_cli_ct_parse_id(ct, optarg); break; in main()
111 case 'p': nl_cli_ct_parse_protocol(ct, optarg); break; in main()
112 case ARG_TCP_STATE: nl_cli_ct_parse_tcp_state(ct, optarg); break; in main()
113 case ARG_ORIG_SRC: nl_cli_ct_parse_src(ct, 0, optarg); break; in main()
114 case ARG_ORIG_SPORT: nl_cli_ct_parse_src_port(ct, 0, optarg); break; in main()
115 case ARG_ORIG_DST: nl_cli_ct_parse_dst(ct, 0, optarg); break; in main()
[all …]
/external/libnetfilter_conntrack/qa/
Dct_stress.c24 struct nf_conntrack *ct; in main() local
35 ct = nfct_new(); in main()
36 if (!ct) { in main()
44 nfct_destroy(ct); in main()
49 nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET); in main()
50 nfct_set_attr_u32(ct, ATTR_IPV4_SRC, inet_addr("1.1.1.1") + i); in main()
51 nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr("2.2.2.2") + i); in main()
53 nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP); in main()
54 nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(10)); in main()
55 nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(20)); in main()
[all …]
/external/iptables/extensions/
Dlibxt_u32.c45 const struct xt_u32_test *ct; in u32_dump() local
50 ct = &data->tests[testind]; in u32_dump()
55 printf("0x%x", ct->location[0].number); in u32_dump()
56 for (i = 1; i < ct->nnums; ++i) { in u32_dump()
57 switch (ct->location[i].nextop) { in u32_dump()
71 printf("0x%x", ct->location[i].number); in u32_dump()
75 for (i = 0; i < ct->nvalues; ++i) { in u32_dump()
78 if (ct->value[i].min == ct->value[i].max) in u32_dump()
79 printf("0x%x", ct->value[i].min); in u32_dump()
81 printf("0x%x:0x%x", ct->value[i].min, in u32_dump()
[all …]

12345678910>>...15