/net/netfilter/ |
D | nf_conntrack_core.c | 46 int (*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, 163 clean_from_lists(struct nf_conn *ct) in clean_from_lists() argument 165 pr_debug("clean_from_lists(%p)\n", ct); in clean_from_lists() 166 hlist_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode); in clean_from_lists() 167 hlist_del_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnode); in clean_from_lists() 170 nf_ct_remove_expectations(ct); in clean_from_lists() 176 struct nf_conn *ct = (struct nf_conn *)nfct; in destroy_conntrack() local 177 struct net *net = nf_ct_net(ct); in destroy_conntrack() 180 pr_debug("destroy_conntrack(%p)\n", ct); in destroy_conntrack() 182 NF_CT_ASSERT(!timer_pending(&ct->timeout)); in destroy_conntrack() [all …]
|
D | nf_conntrack_h323_main.c | 61 struct nf_conn *ct, 66 struct nf_conn *ct, 71 struct nf_conn *ct, 79 struct nf_conn *ct, 85 struct nf_conn *ct, 91 struct nf_conn *ct, 97 struct nf_conn *ct, 112 struct nf_conn *ct, enum ip_conntrack_info ctinfo, in get_tpkt_data() argument 115 struct nf_ct_h323_master *info = &nfct_help(ct)->help.ct_h323_info; in get_tpkt_data() 216 static int get_h245_addr(struct nf_conn *ct, const unsigned char *data, in get_h245_addr() argument [all …]
|
D | nf_conntrack_ecache.c | 37 if (nf_ct_is_confirmed(ecache->ct) && !nf_ct_is_dying(ecache->ct) in __nf_ct_deliver_cached_events() 40 .ct = ecache->ct, in __nf_ct_deliver_cached_events() 51 nf_ct_put(ecache->ct); in __nf_ct_deliver_cached_events() 52 ecache->ct = NULL; in __nf_ct_deliver_cached_events() 57 void nf_ct_deliver_cached_events(const struct nf_conn *ct) in nf_ct_deliver_cached_events() argument 59 struct net *net = nf_ct_net(ct); in nf_ct_deliver_cached_events() 63 ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id()); in nf_ct_deliver_cached_events() 64 if (ecache->ct == ct) in nf_ct_deliver_cached_events() 71 void __nf_ct_event_cache_init(struct nf_conn *ct) in __nf_ct_event_cache_init() argument 73 struct net *net = nf_ct_net(ct); in __nf_ct_event_cache_init() [all …]
|
D | nf_conntrack_netlink.c | 121 ctnetlink_dump_status(struct sk_buff *skb, const struct nf_conn *ct) in ctnetlink_dump_status() argument 123 NLA_PUT_BE32(skb, CTA_STATUS, htonl(ct->status)); in ctnetlink_dump_status() 131 ctnetlink_dump_timeout(struct sk_buff *skb, const struct nf_conn *ct) in ctnetlink_dump_timeout() argument 133 long timeout = (ct->timeout.expires - jiffies) / HZ; in ctnetlink_dump_timeout() 146 ctnetlink_dump_protoinfo(struct sk_buff *skb, const struct nf_conn *ct) in ctnetlink_dump_protoinfo() argument 152 l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); in ctnetlink_dump_protoinfo() 160 ret = l4proto->to_nlattr(skb, nest_proto, ct); in ctnetlink_dump_protoinfo() 171 ctnetlink_dump_helpinfo(struct sk_buff *skb, const struct nf_conn *ct) in ctnetlink_dump_helpinfo() argument 174 const struct nf_conn_help *help = nfct_help(ct); in ctnetlink_dump_helpinfo() 190 helper->to_nlattr(skb, ct); in ctnetlink_dump_helpinfo() [all …]
|
D | xt_conntrack.c | 31 const struct nf_conn *ct; in conntrack_mt_v0() local 35 ct = nf_ct_get(skb, &ctinfo); in conntrack_mt_v0() 39 if (ct == &nf_conntrack_untracked) in conntrack_mt_v0() 41 else if (ct) in conntrack_mt_v0() 47 if (ct) { in conntrack_mt_v0() 48 if (test_bit(IPS_SRC_NAT_BIT, &ct->status)) in conntrack_mt_v0() 50 if (test_bit(IPS_DST_NAT_BIT, &ct->status)) in conntrack_mt_v0() 58 if (ct == NULL) { in conntrack_mt_v0() 65 FWINV(nf_ct_protonum(ct) != in conntrack_mt_v0() 71 FWINV((ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip & in conntrack_mt_v0() [all …]
|
D | xt_CONNMARK.c | 42 struct nf_conn *ct; in connmark_tg_v0() local 48 ct = nf_ct_get(skb, &ctinfo); in connmark_tg_v0() 49 if (ct) { in connmark_tg_v0() 52 newmark = (ct->mark & ~markinfo->mask) | markinfo->mark; in connmark_tg_v0() 53 if (newmark != ct->mark) { in connmark_tg_v0() 54 ct->mark = newmark; in connmark_tg_v0() 55 nf_conntrack_event_cache(IPCT_MARK, ct); in connmark_tg_v0() 59 newmark = (ct->mark & ~markinfo->mask) | in connmark_tg_v0() 61 if (ct->mark != newmark) { in connmark_tg_v0() 62 ct->mark = newmark; in connmark_tg_v0() [all …]
|
D | nf_conntrack_proto_tcp.c | 296 static int tcp_print_conntrack(struct seq_file *s, const struct nf_conn *ct) in tcp_print_conntrack() argument 301 state = ct->proto.tcp.state; in tcp_print_conntrack() 482 static bool tcp_in_window(const struct nf_conn *ct, in tcp_in_window() argument 491 struct net *net = nf_ct_net(ct); in tcp_in_window() 494 const struct nf_conntrack_tuple *tuple = &ct->tuplehash[dir].tuple; in tcp_in_window() 698 struct nf_conn *ct, in nf_conntrack_tcp_update() argument 702 const struct ip_ct_tcp_state *sender = &ct->proto.tcp.seen[dir]; in nf_conntrack_tcp_update() 703 const struct ip_ct_tcp_state *receiver = &ct->proto.tcp.seen[!dir]; in nf_conntrack_tcp_update() 712 if (after(end, ct->proto.tcp.seen[dir].td_end)) in nf_conntrack_tcp_update() 713 ct->proto.tcp.seen[dir].td_end = end; in nf_conntrack_tcp_update() [all …]
|
D | nf_conntrack_standalone.c | 56 n = rcu_dereference(net->ct.hash[st->bucket].first); in ct_get_first() 73 head = rcu_dereference(net->ct.hash[st->bucket].first); in ct_get_next() 111 const struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(hash); in ct_seq_show() local 115 NF_CT_ASSERT(ct); in ct_seq_show() 121 l3proto = __nf_ct_l3proto_find(nf_ct_l3num(ct)); in ct_seq_show() 123 l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); in ct_seq_show() 127 l3proto->name, nf_ct_l3num(ct), in ct_seq_show() 128 l4proto->name, nf_ct_protonum(ct), in ct_seq_show() 129 timer_pending(&ct->timeout) in ct_seq_show() 130 ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) in ct_seq_show() [all …]
|
D | nf_conntrack_sip.c | 103 static int string_len(const struct nf_conn *ct, const char *dptr, in string_len() argument 115 static int digits_len(const struct nf_conn *ct, const char *dptr, in digits_len() argument 127 static int media_len(const struct nf_conn *ct, const char *dptr, in media_len() argument 130 int len = string_len(ct, dptr, limit, shift); in media_len() 138 return len + digits_len(ct, dptr, limit, shift); in media_len() 141 static int parse_addr(const struct nf_conn *ct, const char *cp, in parse_addr() argument 149 switch (nf_ct_l3num(ct)) { in parse_addr() 168 static int epaddr_len(const struct nf_conn *ct, const char *dptr, in epaddr_len() argument 174 if (!parse_addr(ct, dptr, &dptr, &addr, limit)) { in epaddr_len() 182 dptr += digits_len(ct, dptr, limit, shift); in epaddr_len() [all …]
|
D | nf_conntrack_pptp.c | 46 struct nf_conn *ct, enum ip_conntrack_info ctinfo, 53 struct nf_conn *ct, enum ip_conntrack_info ctinfo, 65 (*nf_nat_pptp_hook_expectfn)(struct nf_conn *ct, 99 static void pptp_expectfn(struct nf_conn *ct, in pptp_expectfn() argument 102 struct net *net = nf_ct_net(ct); in pptp_expectfn() 107 ct->proto.gre.timeout = PPTP_GRE_TIMEOUT; in pptp_expectfn() 108 ct->proto.gre.stream_timeout = PPTP_GRE_STREAM_TIMEOUT; in pptp_expectfn() 115 if (nf_nat_pptp_expectfn && ct->master->status & IPS_NAT_MASK) in pptp_expectfn() 116 nf_nat_pptp_expectfn(ct, exp); in pptp_expectfn() 172 static void pptp_destroy_siblings(struct nf_conn *ct) in pptp_destroy_siblings() argument [all …]
|
D | nf_conntrack_proto_gre.c | 99 int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, in nf_ct_gre_keymap_add() argument 102 struct net *net = nf_ct_net(ct); in nf_ct_gre_keymap_add() 104 struct nf_conn_help *help = nfct_help(ct); in nf_ct_gre_keymap_add() 119 dir == IP_CT_DIR_REPLY ? "reply" : "orig", ct); in nf_ct_gre_keymap_add() 141 void nf_ct_gre_keymap_destroy(struct nf_conn *ct) in nf_ct_gre_keymap_destroy() argument 143 struct net *net = nf_ct_net(ct); in nf_ct_gre_keymap_destroy() 145 struct nf_conn_help *help = nfct_help(ct); in nf_ct_gre_keymap_destroy() 148 pr_debug("entering for ct %p\n", ct); in nf_ct_gre_keymap_destroy() 223 const struct nf_conn *ct) in gre_print_conntrack() argument 226 (ct->proto.gre.timeout / HZ), in gre_print_conntrack() [all …]
|
D | nf_conntrack_proto_dccp.c | 418 static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb, in dccp_new() argument 421 struct net *net = nf_ct_net(ct); in dccp_new() 443 ct->proto.dccp.role[IP_CT_DIR_ORIGINAL] = CT_DCCP_ROLE_CLIENT; in dccp_new() 444 ct->proto.dccp.role[IP_CT_DIR_REPLY] = CT_DCCP_ROLE_SERVER; in dccp_new() 445 ct->proto.dccp.state = CT_DCCP_NONE; in dccp_new() 450 nf_log_packet(nf_ct_l3num(ct), 0, skb, NULL, NULL, NULL, msg); in dccp_new() 463 static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb, in dccp_packet() argument 467 struct net *net = nf_ct_net(ct); in dccp_packet() 478 !test_bit(IPS_SEEN_REPLY_BIT, &ct->status)) { in dccp_packet() 480 nf_ct_kill_acct(ct, ctinfo, skb); in dccp_packet() [all …]
|
D | nf_conntrack_extend.c | 22 void __nf_ct_ext_destroy(struct nf_conn *ct) in __nf_ct_ext_destroy() argument 28 if (!nf_ct_ext_exist(ct, i)) in __nf_ct_ext_destroy() 39 t->destroy(ct); in __nf_ct_ext_destroy() 75 void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp) in __nf_ct_ext_add() argument 82 NF_CT_ASSERT(!nf_ct_is_confirmed(ct)); in __nf_ct_ext_add() 84 if (!ct->ext) in __nf_ct_ext_add() 85 return nf_ct_ext_create(&ct->ext, id, gfp); in __nf_ct_ext_add() 87 if (nf_ct_ext_exist(ct, id)) in __nf_ct_ext_add() 94 newoff = ALIGN(ct->ext->len, t->align); in __nf_ct_ext_add() 98 new = __krealloc(ct->ext, newlen, gfp); in __nf_ct_ext_add() [all …]
|
D | xt_CONNSECMARK.c | 40 struct nf_conn *ct; in secmark_save() local 43 ct = nf_ct_get(skb, &ctinfo); in secmark_save() 44 if (ct && !ct->secmark) { in secmark_save() 45 ct->secmark = skb->secmark; in secmark_save() 46 nf_conntrack_event_cache(IPCT_SECMARK, ct); in secmark_save() 58 const struct nf_conn *ct; in secmark_restore() local 61 ct = nf_ct_get(skb, &ctinfo); in secmark_restore() 62 if (ct && ct->secmark) in secmark_restore() 63 skb->secmark = ct->secmark; in secmark_restore()
|
D | xt_u32.c | 20 const struct xt_u32_test *ct; in u32_match_it() local 35 ct = &data->tests[testind]; in u32_match_it() 37 pos = ct->location[0].number; in u32_match_it() 45 nnums = ct->nnums; in u32_match_it() 49 u_int32_t number = ct->location[i].number; in u32_match_it() 50 switch (ct->location[i].nextop) { in u32_match_it() 78 nvals = ct->nvalues; in u32_match_it() 80 if (ct->value[i].min <= val && val <= ct->value[i].max) in u32_match_it() 83 if (i >= ct->nvalues) in u32_match_it()
|
D | nf_conntrack_proto_sctp.c | 167 static int sctp_print_conntrack(struct seq_file *s, const struct nf_conn *ct) in sctp_print_conntrack() argument 172 state = ct->proto.sctp.state; in sctp_print_conntrack() 185 static int do_basic_checks(struct nf_conn *ct, in do_basic_checks() argument 286 static int sctp_packet(struct nf_conn *ct, in sctp_packet() argument 306 if (do_basic_checks(ct, skb, dataoff, map) != 0) in sctp_packet() 315 sh->vtag != ct->proto.sctp.vtag[dir]) { in sctp_packet() 330 if (sh->vtag != ct->proto.sctp.vtag[dir] && in sctp_packet() 331 sh->vtag != ct->proto.sctp.vtag[!dir]) in sctp_packet() 335 if (sh->vtag != ct->proto.sctp.vtag[dir] && in sctp_packet() 336 sh->vtag != ct->proto.sctp.vtag[!dir] && in sctp_packet() [all …]
|
D | nf_conntrack_acct.c | 35 .data = &init_net.ct.sysctl_acct, 45 seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir) in seq_print_acct() argument 49 acct = nf_conn_acct_find(ct); in seq_print_acct() 75 table[0].data = &net->ct.sysctl_acct; in nf_conntrack_acct_init_sysctl() 77 net->ct.acct_sysctl_header = register_net_sysctl_table(net, in nf_conntrack_acct_init_sysctl() 79 if (!net->ct.acct_sysctl_header) { in nf_conntrack_acct_init_sysctl() 95 table = net->ct.acct_sysctl_header->ctl_table_arg; in nf_conntrack_acct_fini_sysctl() 96 unregister_net_sysctl_table(net->ct.acct_sysctl_header); in nf_conntrack_acct_fini_sysctl() 114 net->ct.sysctl_acct = nf_ct_acct; in nf_conntrack_acct_init()
|
/net/ipv4/netfilter/ |
D | nf_nat_core.c | 132 same_src(const struct nf_conn *ct, in same_src() argument 137 t = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; in same_src() 152 const struct nf_conn *ct; in find_appropriate_src() local 157 ct = nat->ct; in find_appropriate_src() 158 if (same_src(ct, tuple)) { in find_appropriate_src() 161 &ct->tuplehash[IP_CT_DIR_REPLY].tuple); in find_appropriate_src() 183 const struct nf_conn *ct, in find_best_ips_proto() argument 229 struct nf_conn *ct, in get_unique_tuple() argument 232 struct net *net = nf_ct_net(ct); in get_unique_tuple() 246 if (!nf_nat_used_tuple(tuple, ct)) in get_unique_tuple() [all …]
|
D | nf_nat_standalone.c | 33 const struct nf_conn *ct; in nat_decode_session() local 39 ct = nf_ct_get(skb, &ctinfo); in nat_decode_session() 40 if (ct == NULL) in nat_decode_session() 43 t = &ct->tuplehash[dir].tuple; in nat_decode_session() 50 if (ct->status & statusbit) { in nat_decode_session() 62 if (ct->status & statusbit) { in nat_decode_session() 81 struct nf_conn *ct; in nf_nat_fn() local 91 ct = nf_ct_get(skb, &ctinfo); in nf_nat_fn() 96 if (!ct) in nf_nat_fn() 100 if (ct == &nf_conntrack_untracked) in nf_nat_fn() [all …]
|
D | nf_nat_sip.c | 38 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); in mangle_packet() local 40 if (!nf_nat_mangle_udp_packet(skb, ct, ctinfo, matchoff, matchlen, in mangle_packet() 56 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); in map_addr() local 63 if (ct->tuplehash[dir].tuple.src.u3.ip == addr->ip && in map_addr() 64 ct->tuplehash[dir].tuple.src.u.udp.port == port) { in map_addr() 65 newaddr = ct->tuplehash[!dir].tuple.dst.u3.ip; in map_addr() 66 newport = ct->tuplehash[!dir].tuple.dst.u.udp.port; in map_addr() 67 } else if (ct->tuplehash[dir].tuple.dst.u3.ip == addr->ip && in map_addr() 68 ct->tuplehash[dir].tuple.dst.u.udp.port == port) { in map_addr() 69 newaddr = ct->tuplehash[!dir].tuple.src.u3.ip; in map_addr() [all …]
|
D | nf_nat_rule.c | 73 struct nf_conn *ct; in ipt_snat_target() local 79 ct = nf_ct_get(skb, &ctinfo); in ipt_snat_target() 82 NF_CT_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED || in ipt_snat_target() 86 return nf_nat_setup_info(ct, &mr->range[0], IP_NAT_MANIP_SRC); in ipt_snat_target() 92 struct nf_conn *ct; in ipt_dnat_target() local 99 ct = nf_ct_get(skb, &ctinfo); in ipt_dnat_target() 102 NF_CT_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED)); in ipt_dnat_target() 104 return nf_nat_setup_info(ct, &mr->range[0], IP_NAT_MANIP_DST); in ipt_dnat_target() 132 alloc_null_binding(struct nf_conn *ct, unsigned int hooknum) in alloc_null_binding() argument 140 ? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip in alloc_null_binding() [all …]
|
D | nf_conntrack_l3proto_ipv4_compat.c | 37 n = rcu_dereference(net->ct.hash[st->bucket].first); in ct_get_first() 54 head = rcu_dereference(net->ct.hash[st->bucket].first); in ct_get_next() 91 const struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(hash); in ct_seq_show() local 95 NF_CT_ASSERT(ct); in ct_seq_show() 100 if (nf_ct_l3num(ct) != AF_INET) in ct_seq_show() 103 l3proto = __nf_ct_l3proto_find(nf_ct_l3num(ct)); in ct_seq_show() 105 l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); in ct_seq_show() 109 l4proto->name, nf_ct_protonum(ct), in ct_seq_show() 110 timer_pending(&ct->timeout) in ct_seq_show() 111 ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) in ct_seq_show() [all …]
|
D | nf_nat_h323.c | 30 struct nf_conn *ct = nf_ct_get(skb, &ctinfo); in set_addr() local 43 if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo, in set_addr() 59 if (!nf_nat_mangle_udp_packet(skb, ct, ctinfo, in set_addr() 98 static int set_sig_addr(struct sk_buff *skb, struct nf_conn *ct, in set_sig_addr() argument 103 const struct nf_ct_h323_master *info = &nfct_help(ct)->help.ct_h323_info; in set_sig_addr() 110 if (get_h225_addr(ct, *data, &taddr[i], &addr, &port)) { in set_sig_addr() 111 if (addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && in set_sig_addr() 117 get_h225_addr(ct, *data, &taddr[0], in set_sig_addr() 124 &ct->tuplehash[!dir].tuple.dst.u3.ip, in set_sig_addr() 127 &ct->tuplehash[!dir]. in set_sig_addr() [all …]
|
D | nf_nat_pptp.c | 40 static void pptp_nat_expected(struct nf_conn *ct, in pptp_nat_expected() argument 43 struct net *net = nf_ct_net(ct); in pptp_nat_expected() 44 const struct nf_conn *master = ct->master; in pptp_nat_expected() 87 BUG_ON(ct->status & IPS_NAT_DONE_MASK); in pptp_nat_expected() 92 = ct->master->tuplehash[!exp->dir].tuple.dst.u3.ip; in pptp_nat_expected() 97 nf_nat_setup_info(ct, &range, IP_NAT_MANIP_SRC); in pptp_nat_expected() 102 = ct->master->tuplehash[!exp->dir].tuple.src.u3.ip; in pptp_nat_expected() 107 nf_nat_setup_info(ct, &range, IP_NAT_MANIP_DST); in pptp_nat_expected() 113 struct nf_conn *ct, in pptp_outbound_pkt() argument 125 ct_pptp_info = &nfct_help(ct)->help.ct_pptp_info; in pptp_outbound_pkt() [all …]
|
/net/ax25/ |
D | ax25_addr.c | 120 int ct = 0; in ax25cmp() local 122 while (ct < 6) { in ax25cmp() 123 if ((a->ax25_call[ct] & 0xFE) != (b->ax25_call[ct] & 0xFE)) /* Clean off repeater bits */ in ax25cmp() 125 ct++; in ax25cmp() 128 if ((a->ax25_call[ct] & 0x1E) == (b->ax25_call[ct] & 0x1E)) /* SSID without control bit */ in ax25cmp() 221 int ct = 0; in ax25_addr_build() local 254 while (ct < d->ndigi) { in ax25_addr_build() 255 memcpy(buf, &d->calls[ct], AX25_ADDR_LEN); in ax25_addr_build() 257 if (d->repeated[ct]) in ax25_addr_build() 267 ct++; in ax25_addr_build() [all …]
|