Home
last modified time | relevance | path

Searched refs:hook (Results 1 – 25 of 206) sorted by relevance

123456789

/linux/tools/testing/selftests/bpf/prog_tests/
H A Dtc_bpf.c26 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 Dbpf_qdisc.c23 DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook, .ifindex = LO_IFINDEX, in do_test()
31 err = bpf_tc_hook_create(&hook); in do_test()
52 bpf_tc_hook_destroy(&hook); in do_test()
89 DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook, in test_qdisc_attach_to_mq()
105 hook.ifindex = if_nametoindex("veth0"); in test_qdisc_attach_to_mq()
108 err = bpf_tc_hook_create(&hook); in test_qdisc_attach_to_mq()
111 bpf_tc_hook_destroy(&hook); in test_qdisc_attach_to_mq()
120 DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook, .ifindex = LO_IFINDEX, in test_qdisc_attach_to_non_root()
138 err = bpf_tc_hook_create(&hook); in test_qdisc_attach_to_non_root()
140 bpf_tc_hook_destroy(&hook); in test_qdisc_attach_to_non_root()
H A Dxfrm_info.c72 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 Dvrf_socket_lookup.c107 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 Dnf_bpf_link.c38 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 Dnf_conntrack_pptp.c92 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()
131 const struct nf_nat_pptp_hook *hook; in exp_gre() local
161 hook = rcu_dereference(nf_nat_pptp_hook); in exp_gre()
162 if (hook && ct->status & IPS_NAT_MASK) in exp_gre()
163 hook->exp_gre(exp_orig, exp_reply); in exp_gre()
197 const struct nf_nat_pptp_hook *hook; in pptp_inbound_pkt() local
304 hook = rcu_dereference(nf_nat_pptp_hook); in pptp_inbound_pkt()
[all …]
H A Dnfnetlink_hook.c58 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 Dnft_chain_filter.c175 ingress_state.hook = NF_INET_INGRESS; in nft_do_chain_inet_ingress()
183 ingress_state.hook = NF_INET_INGRESS; in nft_do_chain_inet_ingress()
327 struct nft_hook *hook; in nft_netdev_event() local
330 list_for_each_entry(hook, &basechain->hook_list, list) { in nft_netdev_event()
331 ops = nft_hook_find_ops(hook, dev); in nft_netdev_event()
332 match = !strncmp(hook->ifname, dev->name, hook->ifnamelen); in nft_netdev_event()
364 list_add_tail_rcu(&ops->list, &hook->ops_list); in nft_netdev_event()
H A Dnf_tables_api.c320 struct nft_hook *hook; in nft_netdev_register_hooks() local
324 list_for_each_entry(hook, hook_list, list) { in nft_netdev_register_hooks()
325 list_for_each_entry(ops, &hook->ops_list, list) { in nft_netdev_register_hooks()
336 list_for_each_entry(hook, hook_list, list) { in nft_netdev_register_hooks()
337 list_for_each_entry(ops, &hook->ops_list, list) { in nft_netdev_register_hooks()
347 static void nft_netdev_hook_free_ops(struct nft_hook *hook) in nft_netdev_hook_free_ops() argument
351 list_for_each_entry_safe(ops, next, &hook->ops_list, list) { in nft_netdev_hook_free_ops()
357 static void nft_netdev_hook_free(struct nft_hook *hook) in nft_netdev_hook_free() argument
359 nft_netdev_hook_free_ops(hook); in nft_netdev_hook_free()
360 kfree(hook); in nft_netdev_hook_free()
[all …]
/linux/include/linux/
H A Dnetfilter.h79 u8 hook; member
104 nf_hookfn *hook; member
115 nf_hookfn *hook; member
165 return entry->hook(entry->priv, skb, state); in nf_hook_entry_hookfn()
169 unsigned int hook, in nf_hook_state_init() argument
177 p->hook = hook; in nf_hook_state_init()
234 static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net, in nf_hook() argument
244 __builtin_constant_p(hook) && in nf_hook()
245 !static_key_false(&nf_hooks_needed[pf][hook])) in nf_hook()
252 hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]); in nf_hook()
[all …]
H A Dpci.h2416 void (*hook)(struct pci_dev *dev); member
2433 class_shift, hook) \ argument
2434 __ADDRESSABLE(hook) \
2439 ".long " #hook " - . \n" \
2449 class_shift, hook, stub) \ argument
2453 hook(dev); \
2459 class_shift, hook, stub) \ argument
2461 class_shift, hook)
2465 class_shift, hook) \ argument
2467 class_shift, hook, __UNIQUE_ID(hook))
[all …]
/linux/tools/lib/bpf/
H A Dnetlink.c534 typedef int (*qdisc_config_t)(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook);
536 static int clsact_config(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook) in clsact_config() argument
544 static int qdisc_config(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook) in qdisc_config() argument
546 const char *qdisc = OPTS_GET(hook, qdisc, NULL); in qdisc_config()
548 req->tc.tcm_parent = OPTS_GET(hook, parent, TC_H_ROOT); in qdisc_config()
549 req->tc.tcm_handle = OPTS_GET(hook, handle, 0); in qdisc_config()
554 static int attach_point_to_config(struct bpf_tc_hook *hook, in attach_point_to_config() argument
557 switch (OPTS_GET(hook, attach_point, 0)) { in attach_point_to_config()
561 if (OPTS_GET(hook, parent, 0)) in attach_point_to_config()
597 static int tc_qdisc_modify(struct bpf_tc_hook *hook, int cmd, int flags) in tc_qdisc_modify() argument
[all …]
/linux/net/ipv4/netfilter/
H A Dipt_REJECT.c34 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 Dnf_reject_ipv4.c23 struct tcphdr *_oth, int hook);
52 int hook) in nf_reject_skb_v4_tcp_reset() argument
62 oth = nf_reject_ip_tcphdr_get(oldskb, &_oth, hook); in nf_reject_skb_v4_tcp_reset()
108 int hook, u8 code) in nf_reject_skb_v4_unreach() argument
143 nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), proto)) in nf_reject_skb_v4_unreach()
176 struct tcphdr *_oth, int hook) in nf_reject_ip_tcphdr_get() argument
197 if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP)) in nf_reject_ip_tcphdr_get()
274 int hook) in nf_send_reset() argument
280 oth = nf_reject_ip_tcphdr_get(oldskb, &_oth, hook); in nf_send_reset()
348 void nf_send_unreach(struct sk_buff *skb_in, int code, int hook) in nf_send_unreach() argument
[all …]
/linux/fs/xfs/
H A Dxfs_hooks.h37 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()
/linux/include/acpi/
H A Dbattery.h16 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/security/integrity/ima/
H A Dima.h60 /* bitset of digests algorithms allowed in the setxattr hook */
357 #define __ima_hooks(hook) \
358 hook(NONE, none) \
359 hook(FILE_CHECK, file) \
360 hook(MMAP_CHECK, mmap) \
361 hook(MMAP_CHECK_REQPROT, mmap_reqprot) \
362 hook(BPRM_CHECK, bprm) \
363 hook(CREDS_CHECK, creds) \
364 hook(POST_SETATTR, post_setattr) \
365 hook(MODULE_CHEC
307 __ima_hooks(hook) global() argument
[all...]
/linux/drivers/gpu/drm/i915/display/
H A Dintel_quirks.c107 void (*hook)(struct intel_display *display); member
116 void (*hook)(struct intel_dp *intel_dp); member
129 void (*hook)(struct intel_display *display); member
167 .hook = quirk_invert_brightness,
189 .hook = quirk_no_pps_backlight_power_hook,
274 .hook = quirk_fw_sync_len,
282 .hook = quirk_disable_edp_panel_replay,
290 .hook = quirk_disable_edp_panel_replay,
308 q->hook(display); in intel_init_quirks()
312 intel_dmi_quirks[i].hook(display); in intel_init_quirks()
[all …]
/linux/net/ipv6/netfilter/
H A Dnf_reject_ipv6.c27 unsigned int *otcplen, int hook);
29 static bool nf_reject_v6_csum_ok(struct sk_buff *skb, int hook) in nf_reject_v6_csum_ok() argument
51 return nf_ip6_checksum(skb, hook, thoff, proto) == 0; in nf_reject_v6_csum_ok()
76 int hook) in nf_reject_skb_v6_tcp_reset() argument
87 oth = nf_reject_ip6_tcphdr_get(oldskb, &_oth, &otcplen, hook); in nf_reject_skb_v6_tcp_reset()
137 int hook, u8 code) in nf_reject_skb_v6_unreach() argument
159 if (!nf_reject_v6_csum_ok(oldskb, hook)) in nf_reject_skb_v6_unreach()
196 unsigned int *otcplen, int hook) in nf_reject_ip6_tcphdr_get() argument
233 if (nf_ip6_checksum(oldskb, hook, tcphoff, IPPROTO_TCP)) { in nf_reject_ip6_tcphdr_get()
314 int hook) in nf_send_reset6() argument
[all …]
H A Dip6table_nat.c36 .hook = ip6t_do_table,
42 .hook = ip6t_do_table,
48 .hook = ip6t_do_table,
54 .hook = ip6t_do_table,
/linux/drivers/acpi/
H A Dbattery.c760 static void battery_hook_unregister_unlocked(struct acpi_battery_hook *hook) in battery_hook_unregister_unlocked() argument
769 if (!hook->remove_battery(battery->bat, hook)) in battery_hook_unregister_unlocked()
772 list_del_init(&hook->list); in battery_hook_unregister_unlocked()
774 pr_info("hook unregistered: %s\n", hook->name); in battery_hook_unregister_unlocked()
777 void battery_hook_unregister(struct acpi_battery_hook *hook) in battery_hook_unregister() argument
785 if (!list_empty(&hook->list)) in battery_hook_unregister()
786 battery_hook_unregister_unlocked(hook); in battery_hook_unregister()
792 void battery_hook_register(struct acpi_battery_hook *hook) in battery_hook_register() argument
797 list_add(&hook->list, &battery_hook_list); in battery_hook_register()
805 if (hook->add_battery(battery->bat, hook)) { in battery_hook_register()
[all …]
/linux/tools/testing/selftests/net/netfilter/
H A Dnft_queue.sh99 type filter hook prerouting priority $prio; policy accept;
103 type filter hook input priority $prio; policy accept;
107 type filter hook forward priority $prio; policy accept;
112 type filter hook output priority $prio; policy accept;
118 type filter hook postrouting priority $prio; policy accept;
131 type filter hook prerouting priority $prio; policy accept;
135 type filter hook input priority $prio; policy accept;
139 type filter hook forward priority $prio; policy accept;
143 type filter hook output priority $prio; policy accept;
147 type filter hook postrouting priority $prio; policy accept;
[all …]
H A Dconntrack_vrf.sh90 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 Dftrace.c70 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 Dvmaster.c36 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()
379 if (master->hook && !first_init) in master_put()
380 master->hook(master->hook_private_data, master->val); in master_put()
476 void (*hook)(void *private_data, int), in snd_ctl_add_vmaster_hook()
480 master->hook = hook; in snd_ctl_add_vmaster_hook()
513 if (master->hook && !first_init) in snd_ctl_sync_vmaster()
514 master->hook(master->hook_private_data, master->val); in snd_ctl_sync_vmaster()

123456789