/Linux-v6.6/tools/testing/selftests/bpf/progs/ |
D | test_sockmap_listen.c | 59 int verdict; in prog_stream_verdict() local 62 verdict = bpf_sk_redirect_map(skb, &sock_map, zero, 0); in prog_stream_verdict() 64 verdict = bpf_sk_redirect_hash(skb, &sock_hash, &zero, 0); in prog_stream_verdict() 66 count = bpf_map_lookup_elem(&verdict_map, &verdict); in prog_stream_verdict() 70 return verdict; in prog_stream_verdict() 78 int verdict; in prog_skb_verdict() local 81 verdict = bpf_sk_redirect_map(skb, &sock_map, zero, in prog_skb_verdict() 84 verdict = bpf_sk_redirect_hash(skb, &sock_hash, &zero, in prog_skb_verdict() 87 count = bpf_map_lookup_elem(&verdict_map, &verdict); in prog_skb_verdict() 91 return verdict; in prog_skb_verdict() [all …]
|
D | test_skmsg_load_helpers.c | 31 int verdict = SK_PASS; in prog_msg_verdict() local 42 verdict = SK_DROP; in prog_msg_verdict() 44 return verdict; in prog_msg_verdict()
|
/Linux-v6.6/net/netfilter/ |
D | nf_queue.c | 238 unsigned int index, unsigned int verdict) in nf_queue() argument 242 ret = __nf_queue(skb, state, index, verdict >> NF_VERDICT_QBITS); in nf_queue() 245 (verdict & NF_VERDICT_FLAG_QUEUE_BYPASS)) in nf_queue() 260 unsigned int verdict, i = *index; in nf_iterate() local 265 verdict = nf_hook_entry_hookfn(hook, skb, state); in nf_iterate() 266 if (verdict != NF_ACCEPT) { in nf_iterate() 268 if (verdict != NF_REPEAT) in nf_iterate() 269 return verdict; in nf_iterate() 299 void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict) in nf_reinject() argument 324 if (verdict == NF_REPEAT) in nf_reinject() [all …]
|
D | nf_tables_core.c | 45 const struct nft_verdict *verdict, in __nft_trace_packet() argument 55 nft_trace_notify(pkt, verdict, rule, info); in __nft_trace_packet() 59 struct nft_verdict *verdict, in nft_trace_packet() argument 66 __nft_trace_packet(pkt, verdict, rule, info, type); in nft_trace_packet() 94 regs->verdict.code = NFT_BREAK; in nft_cmp_fast_eval() 108 regs->verdict.code = NFT_BREAK; in nft_cmp16_fast_eval() 118 switch (regs->verdict.code) { in __nft_trace_verdict() 135 __nft_trace_packet(pkt, ®s->verdict, rule, info, type); in __nft_trace_verdict() 277 regs.verdict.code = NFT_CONTINUE; in nft_do_chain() 290 if (regs.verdict.code != NFT_CONTINUE) in nft_do_chain() [all …]
|
D | nft_fwd_netdev.c | 37 regs->verdict.code = NF_STOLEN; in nft_fwd_netdev_eval() 101 unsigned int verdict = NF_STOLEN; in nft_fwd_neigh_eval() local 111 verdict = NFT_BREAK; in nft_fwd_neigh_eval() 115 verdict = NF_DROP; in nft_fwd_neigh_eval() 127 verdict = NFT_BREAK; in nft_fwd_neigh_eval() 131 verdict = NF_DROP; in nft_fwd_neigh_eval() 140 verdict = NFT_BREAK; in nft_fwd_neigh_eval() 152 regs->verdict.code = verdict; in nft_fwd_neigh_eval()
|
D | nft_immediate.c | 74 struct nft_chain *chain = priv->data.verdict.chain; in nft_immediate_init() 76 switch (priv->data.verdict.code) { in nft_immediate_init() 105 switch (data->verdict.code) { in nft_immediate_activate() 108 chain = data->verdict.chain; in nft_immediate_activate() 151 switch (data->verdict.code) { in nft_immediate_deactivate() 154 chain = data->verdict.chain; in nft_immediate_deactivate() 198 switch (data->verdict.code) { in nft_immediate_destroy() 201 chain = data->verdict.chain; in nft_immediate_destroy() 260 switch (data->verdict.code) { in nft_immediate_validate() 264 err = nft_chain_validate(ctx, data->verdict.chain); in nft_immediate_validate() [all …]
|
D | nf_tables_trace.c | 127 const struct nft_verdict *verdict, in nf_trace_fill_rule_info() argument 140 verdict->code == NFT_CONTINUE) in nf_trace_fill_rule_info() 148 static bool nft_trace_have_verdict_chain(const struct nft_verdict *verdict, in nft_trace_have_verdict_chain() argument 159 switch (verdict->code) { in nft_trace_have_verdict_chain() 190 const struct nft_verdict *verdict, in nft_trace_notify() argument 225 if (nft_trace_have_verdict_chain(verdict, info)) in nft_trace_notify() 226 size += nla_total_size(strlen(verdict->chain->name)); /* jump target */ in nft_trace_notify() 253 if (nf_trace_fill_rule_info(skb, verdict, rule, info)) in nft_trace_notify() 262 if (nft_verdict_dump(skb, NFTA_TRACE_VERDICT, verdict)) in nft_trace_notify() 266 if (verdict->code == NF_STOLEN) in nft_trace_notify()
|
D | nft_synproxy.c | 61 regs->verdict.code = NF_STOLEN; in nft_synproxy_eval_v4() 67 regs->verdict.code = NF_STOLEN; in nft_synproxy_eval_v4() 69 regs->verdict.code = NF_DROP; in nft_synproxy_eval_v4() 92 regs->verdict.code = NF_STOLEN; in nft_synproxy_eval_v6() 98 regs->verdict.code = NF_STOLEN; in nft_synproxy_eval_v6() 100 regs->verdict.code = NF_DROP; in nft_synproxy_eval_v6() 117 regs->verdict.code = NFT_BREAK; in nft_synproxy_do_eval() 122 regs->verdict.code = NF_DROP; in nft_synproxy_do_eval() 130 regs->verdict.code = NF_DROP; in nft_synproxy_do_eval() 135 regs->verdict.code = NF_DROP; in nft_synproxy_do_eval() [all …]
|
D | nft_socket.c | 33 regs->verdict.code = NFT_BREAK; in nft_socket_wildcard() 100 regs->verdict.code = NFT_BREAK; in nft_socket_eval() 112 regs->verdict.code = NFT_BREAK; in nft_socket_eval() 118 regs->verdict.code = NFT_BREAK; in nft_socket_eval() 126 regs->verdict.code = NFT_BREAK; in nft_socket_eval() 133 regs->verdict.code = NFT_BREAK; in nft_socket_eval()
|
D | nft_tproxy.c | 35 regs->verdict.code = NFT_BREAK; in nft_tproxy_eval_v4() 41 regs->verdict.code = NFT_BREAK; in nft_tproxy_eval_v4() 80 regs->verdict.code = NFT_BREAK; in nft_tproxy_eval_v4() 102 regs->verdict.code = NFT_BREAK; in nft_tproxy_eval_v6() 109 regs->verdict.code = NFT_BREAK; in nft_tproxy_eval_v6() 153 regs->verdict.code = NFT_BREAK; in nft_tproxy_eval_v6() 182 regs->verdict.code = NFT_BREAK; in nft_tproxy_eval()
|
D | nft_xfrm.c | 127 regs->verdict.code = NFT_BREAK; in nft_xfrm_state_get_key() 156 regs->verdict.code = NFT_BREAK; in nft_xfrm_state_get_key() 167 regs->verdict.code = NFT_BREAK; in nft_xfrm_get_eval_in() 191 regs->verdict.code = NFT_BREAK; in nft_xfrm_get_eval_out() 209 regs->verdict.code = NFT_BREAK; in nft_xfrm_get_eval()
|
D | nfnetlink_queue.c | 228 static void nfqnl_reinject(struct nf_queue_entry *entry, unsigned int verdict) in nfqnl_reinject() argument 233 if (verdict == NF_ACCEPT || in nfqnl_reinject() 234 verdict == NF_REPEAT || in nfqnl_reinject() 235 verdict == NF_STOP) { in nfqnl_reinject() 241 verdict = NF_DROP; in nfqnl_reinject() 245 nf_reinject(entry, verdict); in nfqnl_reinject() 1084 unsigned int verdict; in verdicthdr_get() local 1090 verdict = ntohl(vhdr->verdict) & NF_VERDICT_MASK; in verdicthdr_get() 1091 if (verdict > NF_MAX_VERDICT || verdict == NF_STOLEN) in verdicthdr_get() 1110 unsigned int verdict, maxid; in nfqnl_recv_verdict_batch() local [all …]
|
D | nft_ct_fast.c | 34 regs->verdict.code = NFT_BREAK; in nft_ct_get_fast_eval() 57 regs->verdict.code = NFT_BREAK; in nft_ct_get_fast_eval()
|
D | nft_osf.c | 32 regs->verdict.code = NFT_BREAK; in nft_osf_eval() 39 regs->verdict.code = NFT_BREAK; in nft_osf_eval() 43 regs->verdict.code = NFT_BREAK; in nft_osf_eval()
|
D | nft_compat.c | 92 regs->verdict.code = NFT_CONTINUE; in nft_target_eval_xt() 95 regs->verdict.code = ret; in nft_target_eval_xt() 119 regs->verdict.code = NF_ACCEPT; in nft_target_eval_bridge() 122 regs->verdict.code = NF_DROP; in nft_target_eval_bridge() 125 regs->verdict.code = NFT_CONTINUE; in nft_target_eval_bridge() 128 regs->verdict.code = NFT_RETURN; in nft_target_eval_bridge() 131 regs->verdict.code = ret; in nft_target_eval_bridge() 384 regs->verdict.code = NF_DROP; in __nft_match_eval() 390 regs->verdict.code = NFT_CONTINUE; in __nft_match_eval() 393 regs->verdict.code = NFT_BREAK; in __nft_match_eval()
|
/Linux-v6.6/samples/bpf/ |
D | test_cgrp2_attach.c | 43 static int prog_load(int map_fd, int verdict) in prog_load() argument 71 BPF_MOV64_IMM(BPF_REG_0, verdict), /* r0 = verdict */ in prog_load() 92 static int attach_filter(int cg_fd, int type, int verdict) in attach_filter() argument 105 prog_fd = prog_load(map_fd, verdict); in attach_filter() 136 int detach_only = 0, verdict = 1; in main() local 143 verdict = 0; in main() 174 ret = attach_filter(cg_fd, type, verdict); in main()
|
/Linux-v6.6/tools/testing/selftests/bpf/prog_tests/ |
D | sockmap_basic.c | 114 int err, map, verdict; in test_skmsg_helpers() local 120 verdict = bpf_program__fd(skel->progs.prog_msg_verdict); in test_skmsg_helpers() 123 err = bpf_prog_attach(verdict, map, BPF_SK_MSG_VERDICT, 0); in test_skmsg_helpers() 127 err = bpf_prog_detach2(verdict, map, BPF_SK_MSG_VERDICT); in test_skmsg_helpers() 278 int err, map, verdict; in test_sockmap_skb_verdict_attach() local 284 verdict = bpf_program__fd(skel->progs.prog_skb_verdict); in test_sockmap_skb_verdict_attach() 287 err = bpf_prog_attach(verdict, map, first, 0); in test_sockmap_skb_verdict_attach() 291 err = bpf_prog_attach(verdict, map, second, 0); in test_sockmap_skb_verdict_attach() 294 err = bpf_prog_detach2(verdict, map, first); in test_sockmap_skb_verdict_attach() 362 int n, err, map, verdict, s, c1, p1; in test_sockmap_skb_verdict_shutdown() local [all …]
|
D | sockmap_listen.c | 731 int verdict = bpf_program__fd(skel->progs.prog_stream_verdict); in test_skb_redir_to_connected() local 740 err = xbpf_prog_attach(verdict, sock_map, BPF_SK_SKB_STREAM_VERDICT, 0); in test_skb_redir_to_connected() 747 xbpf_prog_detach2(verdict, sock_map, BPF_SK_SKB_STREAM_VERDICT); in test_skb_redir_to_connected() 756 int verdict = bpf_program__fd(skel->progs.prog_msg_verdict); in test_msg_redir_to_connected() local 761 err = xbpf_prog_attach(verdict, sock_map, BPF_SK_MSG_VERDICT, 0); in test_msg_redir_to_connected() 767 xbpf_prog_detach2(verdict, sock_map, BPF_SK_MSG_VERDICT); in test_msg_redir_to_connected() 833 int verdict = bpf_program__fd(skel->progs.prog_stream_verdict); in test_skb_redir_to_listening() local 842 err = xbpf_prog_attach(verdict, sock_map, BPF_SK_SKB_STREAM_VERDICT, 0); in test_skb_redir_to_listening() 849 xbpf_prog_detach2(verdict, sock_map, BPF_SK_SKB_STREAM_VERDICT); in test_skb_redir_to_listening() 858 int verdict = bpf_program__fd(skel->progs.prog_msg_verdict); in test_msg_redir_to_listening() local [all …]
|
D | netns_cookie.c | 16 int err, val, ret, map, verdict; in test_netns_cookie() local 35 verdict = bpf_program__fd(skel->progs.get_netns_cookie_sk_msg); in test_netns_cookie() 37 err = bpf_prog_attach(verdict, map, BPF_SK_MSG_VERDICT, 0); in test_netns_cookie()
|
/Linux-v6.6/tools/testing/selftests/netfilter/ |
D | nf-queue.c | 24 uint32_t verdict; member 171 .verdict = htonl(verd), in nfq_build_verdict() 316 nlh = nfq_build_verdict(buf, id, opts.queue_num, opts.verdict); in mainloop() 347 opts.verdict = atoi(optarg); in parse_opts() 348 if (opts.verdict > 0xffff) { in parse_opts() 353 opts.verdict <<= 16; in parse_opts() 354 opts.verdict |= NF_QUEUE; in parse_opts() 375 if (opts.verdict != NF_ACCEPT && (opts.verdict >> 16 == opts.queue_num)) { in parse_opts() 385 opts.verdict = NF_ACCEPT; in main()
|
/Linux-v6.6/Documentation/bpf/ |
D | map_sockmap.rst | 14 the result of a BPF (verdict) program with the help of the BPF helpers 29 and a verdict program. The parser program determines how much data has been 30 parsed and therefore how much data needs to be queued to come to a verdict. The 31 verdict program is essentially the redirect program and can return a verdict 39 parse or verdict program. If adding a sock object to a map would result 64 There are additional helpers available to use with the parser and verdict 67 bytes the given verdict should apply to. The helper ``bpf_msg_cork_bytes()`` 68 handles a different case where a BPF program cannot reach a verdict on a msg 90 the message ``msg`` is allowed to pass (i.e., if the verdict BPF program 136 If the ``map`` has BPF programs (parser and verdict), those will be inherited [all …]
|
/Linux-v6.6/net/netfilter/ipvs/ |
D | ip_vs_core.c | 863 unsigned int verdict = NF_DROP; in handle_response_icmp() local 901 verdict = NF_ACCEPT; in handle_response_icmp() 906 return verdict; in handle_response_icmp() 1364 int verdict = ip_vs_out_icmp_v6(ipvs, skb, &related, in ip_vs_out_hook() local 1368 return verdict; in ip_vs_out_hook() 1374 int verdict = ip_vs_out_icmp(ipvs, skb, &related, hooknum); in ip_vs_out_hook() local 1377 return verdict; in ip_vs_out_hook() 1471 int *verdict, struct ip_vs_conn **cpp, in ip_vs_try_to_schedule() argument 1482 if (!pp->conn_schedule(ipvs, af, skb, pd, verdict, cpp, iph)) in ip_vs_try_to_schedule() 1496 *verdict = NF_ACCEPT; in ip_vs_try_to_schedule() [all …]
|
/Linux-v6.6/net/ipv4/netfilter/ |
D | arp_tables.c | 189 unsigned int verdict = NF_DROP; in arpt_do_table() local 239 v = ((struct xt_standard_target *)t)->verdict; in arpt_do_table() 243 verdict = (unsigned int)(-v) - 1; in arpt_do_table() 258 verdict = NF_DROP; in arpt_do_table() 270 verdict = t->u.kernel.target->target(skb, &acpar); in arpt_do_table() 272 if (verdict == XT_CONTINUE) { in arpt_do_table() 287 return verdict; in arpt_do_table() 336 t->verdict < 0) || visited) { in mark_source_chains() 363 int newpos = t->verdict; in mark_source_chains() 440 unsigned int verdict; in check_underflow() local [all …]
|
D | ip_tables.c | 172 t->verdict < 0) { in get_chainname_rulenum() 232 unsigned int verdict = NF_DROP; in ipt_do_table() local 313 v = ((struct xt_standard_target *)t)->verdict; in ipt_do_table() 317 verdict = (unsigned int)(-v) - 1; in ipt_do_table() 332 verdict = NF_DROP; in ipt_do_table() 345 verdict = t->u.kernel.target->target(skb, &acpar); in ipt_do_table() 346 if (verdict == XT_CONTINUE) { in ipt_do_table() 361 else return verdict; in ipt_do_table() 399 t->verdict < 0) || visited) { in mark_source_chains() 425 int newpos = t->verdict; in mark_source_chains() [all …]
|
/Linux-v6.6/net/ipv6/netfilter/ |
D | ip6_tables.c | 197 t->verdict < 0) { in get_chainname_rulenum() 255 unsigned int verdict = NF_DROP; in ip6t_do_table() local 336 v = ((struct xt_standard_target *)t)->verdict; in ip6t_do_table() 340 verdict = (unsigned int)(-v) - 1; in ip6t_do_table() 353 verdict = NF_DROP; in ip6t_do_table() 366 verdict = t->u.kernel.target->target(skb, &acpar); in ip6t_do_table() 367 if (verdict == XT_CONTINUE) in ip6t_do_table() 379 else return verdict; in ip6t_do_table() 417 t->verdict < 0) || visited) { in mark_source_chains() 443 int newpos = t->verdict; in mark_source_chains() [all …]
|