| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | tc_bpf.c | 26 static int test_tc_bpf_basic(const struct bpf_tc_hook *hook, int fd) in test_tc_bpf_basic() argument 37 ret = bpf_tc_attach(hook, &opts); in test_tc_bpf_basic() 48 ret = bpf_tc_attach(hook, &opts); in test_tc_bpf_basic() 53 ret = bpf_tc_query(hook, &opts); in test_tc_bpf_basic() 64 ret = bpf_tc_detach(hook, &opts); in test_tc_bpf_basic() 69 static int test_tc_bpf_api(struct bpf_tc_hook *hook, int fd) in test_tc_bpf_api() argument 209 ret = bpf_tc_detach(hook, NULL); in test_tc_bpf_api() 213 ret = bpf_tc_detach(hook, &opts_hpr); in test_tc_bpf_api() 217 ret = bpf_tc_detach(hook, &opts_hpf); in test_tc_bpf_api() 221 ret = bpf_tc_detach(hook, &opts_hpi); in test_tc_bpf_api() [all …]
|
| H A D | xfrm_info.c | 72 static int attach_tc_prog(struct bpf_tc_hook *hook, int igr_fd, int egr_fd) in attach_tc_prog() argument 80 ret = bpf_tc_hook_create(hook); in attach_tc_prog() 85 hook->attach_point = BPF_TC_INGRESS; in attach_tc_prog() 86 ret = bpf_tc_attach(hook, &opts1); in attach_tc_prog() 88 bpf_tc_hook_destroy(hook); in attach_tc_prog() 94 hook->attach_point = BPF_TC_EGRESS; in attach_tc_prog() 95 ret = bpf_tc_attach(hook, &opts2); in attach_tc_prog() 97 bpf_tc_hook_destroy(hook); in attach_tc_prog()
|
| H A D | vrf_socket_lookup.c | 107 LIBBPF_OPTS(bpf_tc_hook, hook, .attach_point = BPF_TC_INGRESS); in attach_progs() 115 hook.ifindex = ifindex; in attach_progs() 117 ret = bpf_tc_hook_create(&hook); in attach_progs() 121 ret = bpf_tc_attach(&hook, &opts); in attach_progs() 123 bpf_tc_hook_destroy(&hook); in attach_progs() 128 bpf_tc_hook_destroy(&hook); in attach_progs()
|
| /linux/net/netfilter/ |
| H A D | nf_bpf_link.c | 38 const struct nf_defrag_hook *hook; in get_proto_defrag_hook() local 43 hook = rcu_dereference(*ptr_global_hook); in get_proto_defrag_hook() 44 if (!hook) { in get_proto_defrag_hook() 51 hook = rcu_dereference(*ptr_global_hook); in get_proto_defrag_hook() 54 if (hook && try_module_get(hook->owner)) { in get_proto_defrag_hook() 56 hook = rcu_pointer_handoff(hook); in get_proto_defrag_hook() 58 WARN_ONCE(!hook, "%s has bad registration", mod); in get_proto_defrag_hook() 59 hook = ERR_PTR(-ENOENT); in get_proto_defrag_hook() 63 if (!IS_ERR(hook)) { in get_proto_defrag_hook() 64 err = hook->enable(link->net); in get_proto_defrag_hook() [all …]
|
| H A D | utils.c | 10 __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, in nf_ip_checksum() argument 18 if (hook != NF_INET_PRE_ROUTING && hook != NF_INET_LOCAL_IN) in nf_ip_checksum() 43 static __sum16 nf_ip_checksum_partial(struct sk_buff *skb, unsigned int hook, in nf_ip_checksum_partial() argument 53 return nf_ip_checksum(skb, hook, dataoff, protocol); in nf_ip_checksum_partial() 64 __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, in nf_ip6_checksum() argument 72 if (hook != NF_INET_PRE_ROUTING && hook != NF_INET_LOCAL_IN) in nf_ip6_checksum() 97 static __sum16 nf_ip6_checksum_partial(struct sk_buff *skb, unsigned int hook, in nf_ip6_checksum_partial() argument 108 return nf_ip6_checksum(skb, hook, dataoff, protocol); in nf_ip6_checksum_partial() 123 __sum16 nf_checksum(struct sk_buff *skb, unsigned int hook, in nf_checksum() argument 131 csum = nf_ip_checksum(skb, hook, dataoff, protocol); in nf_checksum() [all …]
|
| H A D | nfnetlink_hook.c | 58 u8 hook; member 211 ret = snprintf(sym, sizeof(sym), "%ps", ops->hook); in nfnl_hook_dump_one() 279 nfnl_hook_entries_head(u8 pf, unsigned int hook, struct net *net, const char *dev) in nfnl_hook_entries_head() argument 288 if (hook >= ARRAY_SIZE(net->nf.hooks_ipv4)) in nfnl_hook_entries_head() 290 hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]); in nfnl_hook_entries_head() 293 if (hook >= ARRAY_SIZE(net->nf.hooks_ipv6)) in nfnl_hook_entries_head() 295 hook_head = rcu_dereference(net->nf.hooks_ipv6[hook]); in nfnl_hook_entries_head() 299 if (hook >= ARRAY_SIZE(net->nf.hooks_arp)) in nfnl_hook_entries_head() 301 hook_head = rcu_dereference(net->nf.hooks_arp[hook]); in nfnl_hook_entries_head() 306 if (hook >= ARRAY_SIZE(net->nf.hooks_bridge)) in nfnl_hook_entries_head() [all …]
|
| H A D | nft_reject_netdev.c | 30 int hook) in nft_reject_netdev_send_v4_tcp_reset() argument 34 nskb = nf_reject_skb_v4_tcp_reset(net, oldskb, dev, hook); in nft_reject_netdev_send_v4_tcp_reset() 44 int hook, u8 code) in nft_reject_netdev_send_v4_unreach() argument 48 nskb = nf_reject_skb_v4_unreach(net, oldskb, dev, hook, code); in nft_reject_netdev_send_v4_unreach() 58 int hook) in nft_reject_netdev_send_v6_tcp_reset() argument 62 nskb = nf_reject_skb_v6_tcp_reset(net, oldskb, dev, hook); in nft_reject_netdev_send_v6_tcp_reset() 73 int hook, u8 code) in nft_reject_netdev_send_v6_unreach() argument 77 nskb = nf_reject_skb_v6_unreach(net, oldskb, dev, hook, code); in nft_reject_netdev_send_v6_unreach()
|
| H A D | nf_conntrack_pptp.c | 92 const struct nf_nat_pptp_hook *hook; in pptp_expectfn() local 103 hook = rcu_dereference(nf_nat_pptp_hook); in pptp_expectfn() 104 if (hook && ct->master->status & IPS_NAT_MASK) in pptp_expectfn() 105 hook->expectfn(ct, exp); in pptp_expectfn() 190 const struct nf_nat_pptp_hook *hook; in exp_gre() local 220 hook = rcu_dereference(nf_nat_pptp_hook); in exp_gre() 221 if (hook && ct->status & IPS_NAT_MASK) in exp_gre() 222 hook->exp_gre(exp_orig, exp_reply); in exp_gre() 260 const struct nf_nat_pptp_hook *hook; in pptp_inbound_pkt() local 364 hook = rcu_dereference(nf_nat_pptp_hook); in pptp_inbound_pkt() [all …]
|
| H A D | nft_chain_filter.c | 174 ingress_state.hook = NF_INET_INGRESS; in nft_do_chain_inet_ingress() 182 ingress_state.hook = NF_INET_INGRESS; in nft_do_chain_inet_ingress() 326 struct nft_hook *hook; in nft_netdev_event() local 329 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_netdev_event() 330 ops = nft_hook_find_ops(hook, dev); in nft_netdev_event() 331 match = !strncmp(hook->ifname, dev->name, hook->ifnamelen); in nft_netdev_event() 363 list_add_tail_rcu(&ops->list, &hook->ops_list); in nft_netdev_event()
|
| H A D | nf_tables_offload.c | 225 struct nft_hook *hook; in nft_chain_offload_support() 230 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_chain_offload_support() 231 list_for_each_entry(ops, &hook->ops_list, list) { in nft_chain_offload_support() 463 struct nft_hook *hook; in nft_flow_block_chain() 466 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_flow_block_chain() 467 list_for_each_entry(ops, &hook->ops_list, list) { in nft_flow_block_chain() 485 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_flow_block_chain() 486 list_for_each_entry(ops, &hook->ops_list, list) { in nft_flow_block_chain() 632 struct nft_hook *hook, *found; in __nft_offload_get_chain() 647 list_for_each_entry(hook, in __nft_offload_get_chain() 224 struct nft_hook *hook; nft_chain_offload_support() local 459 struct nft_hook *hook; nft_flow_block_chain() local 625 struct nft_hook *hook, *found; __nft_offload_get_chain() local [all...] |
| /linux/include/linux/ |
| H A D | netfilter.h | 79 u8 hook; member 103 nf_hookfn *hook; member 114 nf_hookfn *hook; member 158 return entry->hook(entry->priv, skb, state); in nf_hook_entry_hookfn() 162 unsigned int hook, in nf_hook_state_init() argument 170 p->hook = hook; in nf_hook_state_init() 227 static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, in nf_hook() argument 237 __builtin_constant_p(hook) && in nf_hook() 238 !static_key_false(&nf_hooks_needed[pf][hook])) in nf_hook() 245 hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]); in nf_hook() [all …]
|
| H A D | pci.h | 2308 void (*hook)(struct pci_dev *dev); member 2325 class_shift, hook) \ argument 2326 __ADDRESSABLE(hook) \ 2331 ".long " #hook " - . \n" \ 2341 class_shift, hook, stub) \ argument 2345 hook(dev); \ 2351 class_shift, hook, stub) \ argument 2353 class_shift, hook) 2357 class_shift, hook) \ argument 2359 class_shift, hook, __UNIQUE_ID(hook)) [all …]
|
| /linux/net/ipv4/netfilter/ |
| H A D | ipt_REJECT.c | 34 int hook = xt_hooknum(par); in reject_tg() local 38 nf_send_unreach(skb, ICMP_NET_UNREACH, hook); in reject_tg() 41 nf_send_unreach(skb, ICMP_HOST_UNREACH, hook); in reject_tg() 44 nf_send_unreach(skb, ICMP_PROT_UNREACH, hook); in reject_tg() 47 nf_send_unreach(skb, ICMP_PORT_UNREACH, hook); in reject_tg() 50 nf_send_unreach(skb, ICMP_NET_ANO, hook); in reject_tg() 53 nf_send_unreach(skb, ICMP_HOST_ANO, hook); in reject_tg() 56 nf_send_unreach(skb, ICMP_PKT_FILTERED, hook); in reject_tg() 59 nf_send_reset(xt_net(par), par->state->sk, skb, hook); in reject_tg()
|
| H A D | iptable_nat.c | 34 .hook = ipt_do_table, 40 .hook = ipt_do_table, 46 .hook = ipt_do_table, 52 .hook = ipt_do_table,
|
| /linux/tools/lib/bpf/ |
| H A D | netlink.c | 532 typedef int (*qdisc_config_t)(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook); 534 static int clsact_config(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook) in clsact_config() 542 static int qdisc_config(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook) in attach_point_to_config() argument 544 const char *qdisc = OPTS_GET(hook, qdisc, NULL); in attach_point_to_config() 546 req->tc.tcm_parent = OPTS_GET(hook, parent, TC_H_ROOT); in attach_point_to_config() 547 req->tc.tcm_handle = OPTS_GET(hook, handle, 0); in attach_point_to_config() 552 static int attach_point_to_config(struct bpf_tc_hook *hook, in attach_point_to_config() 555 switch (OPTS_GET(hook, attach_point, 0)) { in attach_point_to_config() 559 if (OPTS_GET(hook, parent, 0)) 595 static int tc_qdisc_modify(struct bpf_tc_hook *hook, in in tc_qdisc_modify() 582 tc_qdisc_modify(struct bpf_tc_hook * hook,int cmd,int flags) tc_qdisc_modify() argument 606 tc_qdisc_create_excl(struct bpf_tc_hook * hook) tc_qdisc_create_excl() argument 611 tc_qdisc_delete(struct bpf_tc_hook * hook) tc_qdisc_delete() argument 616 bpf_tc_hook_create(struct bpf_tc_hook * hook) bpf_tc_hook_create() argument 632 bpf_tc_hook_destroy(struct bpf_tc_hook * hook) bpf_tc_hook_destroy() argument 718 bpf_tc_attach(const struct bpf_tc_hook * hook,struct bpf_tc_opts * opts) bpf_tc_attach() argument 792 __bpf_tc_detach(const struct bpf_tc_hook * hook,const struct bpf_tc_opts * opts,const bool flush) __bpf_tc_detach() argument 853 bpf_tc_detach(const struct bpf_tc_hook * hook,const struct bpf_tc_opts * opts) bpf_tc_detach() argument 865 bpf_tc_query(const struct bpf_tc_hook * hook,struct bpf_tc_opts * opts) bpf_tc_query() argument [all...] |
| /linux/fs/xfs/ |
| H A D | xfs_hooks.h | 37 typedef int (*xfs_hook_fn_t)(struct xfs_hook *hook, unsigned long action, 41 int xfs_hooks_add(struct xfs_hooks *chain, struct xfs_hook *hook); 42 void xfs_hooks_del(struct xfs_hooks *chain, struct xfs_hook *hook); 46 static inline void xfs_hook_setup(struct xfs_hook *hook, notifier_fn_t fn) in xfs_hook_setup() argument 48 hook->nb.notifier_call = fn; in xfs_hook_setup() 49 hook->nb.priority = 0; in xfs_hook_setup()
|
| H A D | xfs_hooks.c | 27 struct xfs_hook *hook) in xfs_hooks_add() argument 29 ASSERT(hook->nb.notifier_call != NULL); in xfs_hooks_add() 32 return blocking_notifier_chain_register(&chain->head, &hook->nb); in xfs_hooks_add() 39 struct xfs_hook *hook) in xfs_hooks_del() argument 41 blocking_notifier_chain_unregister(&chain->head, &hook->nb); in xfs_hooks_del()
|
| /linux/security/integrity/ima/ |
| H A D | ima.h | 49 /* bitset of digests algorithms allowed in the setxattr hook */ 313 #define __ima_hooks(hook) \ 314 hook(NONE, none) \ 315 hook(FILE_CHECK, file) \ 316 hook(MMAP_CHECK, mmap) \ 317 hook(MMAP_CHECK_REQPROT, mmap_reqprot) \ 318 hook(BPRM_CHECK, bprm) \ 319 hook(CREDS_CHECK, creds) \ 320 hook(POST_SETATTR, post_setattr) \ 321 hook(MODULE_CHEC 307 __ima_hooks(hook) global() argument [all...] |
| /linux/include/acpi/ |
| H A D | battery.h | 16 int (*add_battery)(struct power_supply *battery, struct acpi_battery_hook *hook); 17 int (*remove_battery)(struct power_supply *battery, struct acpi_battery_hook *hook); 21 void battery_hook_register(struct acpi_battery_hook *hook); 22 void battery_hook_unregister(struct acpi_battery_hook *hook); 23 int devm_battery_hook_register(struct device *dev, struct acpi_battery_hook *hook);
|
| /linux/net/bridge/netfilter/ |
| H A D | nft_reject_bridge.c | 48 int hook) in nft_reject_br_send_v4_tcp_reset() argument 52 nskb = nf_reject_skb_v4_tcp_reset(net, oldskb, NULL, hook); in nft_reject_br_send_v4_tcp_reset() 64 int hook, u8 code) in nft_reject_br_send_v4_unreach() argument 68 nskb = nf_reject_skb_v4_unreach(net, oldskb, NULL, hook, code); in nft_reject_br_send_v4_unreach() 80 int hook) in nft_reject_br_send_v6_tcp_reset() argument 84 nskb = nf_reject_skb_v6_tcp_reset(net, oldskb, NULL, hook); in nft_reject_br_send_v6_tcp_reset() 97 int hook, u8 code) in nft_reject_br_send_v6_unreach() argument 101 nskb = nf_reject_skb_v6_unreach(net, oldskb, NULL, hook, code); in nft_reject_br_send_v6_unreach()
|
| /linux/tools/testing/selftests/net/netfilter/ |
| H A D | nft_queue.sh | 97 type filter hook prerouting priority $prio; policy accept; 101 type filter hook input priority $prio; policy accept; 105 type filter hook forward priority $prio; policy accept; 110 type filter hook output priority $prio; policy accept; 116 type filter hook postrouting priority $prio; policy accept; 129 type filter hook prerouting priority $prio; policy accept; 133 type filter hook input priority $prio; policy accept; 137 type filter hook forward priority $prio; policy accept; 141 type filter hook output priority $prio; policy accept; 145 type filter hook postroutin [all...] |
| H A D | conntrack_vrf.sh | 90 type filter hook prerouting priority raw; 100 type filter hook output priority raw; 144 type filter hook output priority raw; 149 type filter hook postrouting priority mangle; 154 type nat hook postrouting priority 0; 191 type nat hook postrouting priority 0;
|
| /linux/arch/csky/kernel/ |
| H A D | ftrace.c | 70 static int ftrace_check_current_nop(unsigned long hook) in ftrace_check_current_nop() argument 73 unsigned long hook_pos = hook - 2; in ftrace_check_current_nop() 91 static int ftrace_modify_code(unsigned long hook, unsigned long target, in ftrace_modify_code() argument 96 unsigned long hook_pos = hook - 2; in ftrace_modify_code() 99 make_jbsr(target, hook, call, nolr); in ftrace_modify_code()
|
| /linux/sound/core/ |
| H A D | vmaster.c | 36 void (*hook)(void *private_data, int); member 124 if (master->hook) in master_init() 125 master->hook(master->hook_private_data, master->val); in master_init() 380 if (master->hook && !first_init) in master_put() 381 master->hook(master->hook_private_data, master->val); in master_put() 477 void (*hook)(void *private_data, int), in snd_ctl_add_vmaster_hook() 481 master->hook = hook; in snd_ctl_add_vmaster_hook() 514 if (master->hook && !first_init) in snd_ctl_sync_vmaster() 515 master->hook(master->hook_private_data, master->val); in snd_ctl_sync_vmaster()
|
| /linux/net/ipv6/netfilter/ |
| H A D | ip6table_nat.c | 36 .hook = ip6t_do_table, 42 .hook = ip6t_do_table, 48 .hook = ip6t_do_table, 54 .hook = ip6t_do_table,
|