/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 77 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_hook_create invalid hook = NULL")) in test_tc_bpf_api() 80 /* hook ifindex = 0 */ in test_tc_bpf_api() 82 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_hook_create invalid hook ifindex == 0")) in test_tc_bpf_api() 86 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_hook_destroy invalid hook ifindex == 0")) in test_tc_bpf_api() [all …]
|
H A D | bpf_qdisc.c | 18 DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook, .ifindex = LO_IFINDEX, in do_test() 26 err = bpf_tc_hook_create(&hook); in do_test() 47 bpf_tc_hook_destroy(&hook); in do_test() 84 DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook, in test_qdisc_attach_to_mq() 100 hook.ifindex = if_nametoindex("veth0"); in test_qdisc_attach_to_mq() 103 err = bpf_tc_hook_create(&hook); in test_qdisc_attach_to_mq() 106 bpf_tc_hook_destroy(&hook); in test_qdisc_attach_to_mq() 115 DECLARE_LIBBPF_OPTS(bpf_tc_hook, hook, .ifindex = LO_IFINDEX, in test_qdisc_attach_to_non_root() 133 err = bpf_tc_hook_create(&hook); in test_qdisc_attach_to_non_root() 135 bpf_tc_hook_destroy(&hook); in test_qdisc_attach_to_non_root()
|
/linux/include/linux/ |
H A D | netfilter.h | 79 u8 hook; member 103 nf_hookfn *hook; member 114 nf_hookfn *hook; member 128 /* trailer: pointers to original orig_ops of each hook, 133 * needed in slow path (hook register/unregister): 137 * only needed when a hook is deleted, not during 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() 198 /* Function to register/unregister hook points. */ [all …]
|
H A D | lsm_hooks.h | 49 * @active: Enabled when the static call has an LSM hook associated. 60 * Table of the static calls for each LSM hook. 87 * Security module hook list structure. 91 * @scalls: The beginning of the array of static calls assigned to this hook. 92 * @hook: The callback for the hook. 93 * @lsm: The name of the lsm that owns this hook. 97 union security_list_options hook; member 133 #define LSM_HOOK_INIT(NAME, HOOK) \ argument 136 .hook = { .NAME = HOOK } \
|
/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() argument 542 static int qdisc_config(struct libbpf_nla_req *req, const struct bpf_tc_hook *hook) in qdisc_config() argument 544 const char *qdisc = OPTS_GET(hook, qdisc, NULL); in qdisc_config() 546 req->tc.tcm_parent = OPTS_GET(hook, parent, TC_H_ROOT); in qdisc_config() 547 req->tc.tcm_handle = OPTS_GET(hook, handle, 0); in qdisc_config() 552 static int attach_point_to_config(struct bpf_tc_hook *hook, in attach_point_to_config() argument 555 switch (OPTS_GET(hook, attach_point, 0)) { in attach_point_to_config() 559 if (OPTS_GET(hook, parent, 0)) in attach_point_to_config() 595 static int tc_qdisc_modify(struct bpf_tc_hook *hook, int cmd, int flags) in tc_qdisc_modify() argument [all …]
|
/linux/fs/xfs/ |
H A D | xfs_hooks.c | 23 /* Make it so a function gets called whenever we hit a certain hook point. */ 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() 35 /* Remove a previously installed hook. */ 39 struct xfs_hook *hook) in xfs_hooks_del() argument 41 blocking_notifier_chain_unregister(&chain->head, &hook->nb); in xfs_hooks_del() 44 /* Call a hook. Returns the NOTIFY_* value returned by the last hook. */
|
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()
|
/linux/include/drm/ |
H A D | drm_simple_kms_helper.h | 34 * This hook is used by the probe helpers to filter the mode list in 60 * This hook is optional. 70 * This hook is optional. 82 * This hook is optional. 98 * This hook is optional. 116 * the documentation for the &drm_plane_helper_funcs.prepare_fb hook for 119 * For GEM drivers who neither have a @prepare_fb nor @cleanup_fb hook 123 * their @prepare_fb hook. 132 * the documentation for the &drm_plane_helper_funcs.cleanup_fb hook for 142 * the documentation for the &drm_plane_helper_funcs.begin_fb_access hook for [all …]
|
H A D | drm_modeset_helper_vtables.h | 76 * DRM_MODE_DPMS_OFF if the @disable hook isn't used. 79 * also support using this hook for enabling and disabling a CRTC to 91 * @dpms hook with DRM_MODE_DPMS_OFF. 94 * also support using this hook for disabling a CRTC to facilitate 105 * drivers ended up implementing this by calling their @dpms hook with 109 * also support using this hook for enabling a CRTC to facilitate 126 * This hook is used by the probe helpers to filter the mode list in 225 * should not use this hook. This is because the helper library calls 226 * this hook only once per mode change and not every time the display 280 * &drm_encoder_helper_funcs.disable hook. If that sequence is too [all …]
|
/linux/net/netfilter/ |
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 | core.c | 92 return NF_ACCEPT; /* ACCEPT makes nf_hook_slow call next hook */ in accept_all() 96 .hook = accept_all, 120 /* Restrict BPF hook type to force a unique priority, not in nf_hook_entries_grow() 125 * hook at same priority as a bpf one (we don't want to in nf_hook_entries_grow() 157 new->hooks[nhooks].hook = reg->hook; in nf_hook_entries_grow() 166 new->hooks[nhooks].hook = reg->hook; in nf_hook_entries_grow() 216 * __nf_hook_entries_try_shrink - try to shrink hook array 218 * @old -- current hook blob at @pp 219 * @pp -- location of hook blob 221 * Hook unregistration must always succeed, so to-be-removed hooks [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 | nf_reject_ipv4.c | 42 int hook) in nf_reject_skb_v4_tcp_reset() argument 52 oth = nf_reject_ip_tcphdr_get(oldskb, &_oth, hook); in nf_reject_skb_v4_tcp_reset() 77 int hook, u8 code) in nf_reject_skb_v4_unreach() argument 108 nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), proto)) in nf_reject_skb_v4_unreach() 140 struct tcphdr *_oth, int hook) in nf_reject_ip_tcphdr_get() argument 161 if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP)) in nf_reject_ip_tcphdr_get() 240 int hook) in nf_send_reset() argument 246 oth = nf_reject_ip_tcphdr_get(oldskb, &_oth, hook); in nf_send_reset() 250 if ((hook == NF_INET_PRE_ROUTING || hook == NF_INET_INGRESS) && in nf_send_reset() 315 void nf_send_unreach(struct sk_buff *skb_in, int code, int hook) in nf_send_unreach() argument [all …]
|
/linux/include/uapi/linux/netfilter/ |
H A D | nfnetlink_hook.h | 11 * enum nfnl_hook_attributes - netfilter hook netlink attributes 13 * @NFNLA_HOOK_HOOKNUM: netfilter hook number (NLA_U32) 14 * @NFNLA_HOOK_PRIORITY: netfilter hook priority (NLA_U32) 16 * @NFNLA_HOOK_FUNCTION_NAME: hook function name (NLA_STRING) 17 * @NFNLA_HOOK_MODULE_NAME: kernel module that registered this hook (NLA_STRING) 18 * @NFNLA_HOOK_CHAIN_INFO: basechain hook metadata (NLA_NESTED)
|
/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/drivers/acpi/ |
H A D | battery.c | 706 static void battery_hook_unregister_unlocked(struct acpi_battery_hook *hook) in battery_hook_unregister_unlocked() argument 711 * In order to remove a hook, we first need to in battery_hook_unregister_unlocked() 715 if (!hook->remove_battery(battery->bat, hook)) in battery_hook_unregister_unlocked() 718 list_del_init(&hook->list); in battery_hook_unregister_unlocked() 720 pr_info("hook unregistered: %s\n", hook->name); in battery_hook_unregister_unlocked() 723 void battery_hook_unregister(struct acpi_battery_hook *hook) in battery_hook_unregister() argument 728 * if a battery hook was previously unloaded due to an error when in battery_hook_unregister() 731 if (!list_empty(&hook->list)) in battery_hook_unregister() 732 battery_hook_unregister_unlocked(hook); in battery_hook_unregister() 738 void battery_hook_register(struct acpi_battery_hook *hook) in battery_hook_register() argument [all …]
|
/linux/security/integrity/ima/ |
H A D | ima.h | 49 /* bitset of digests algorithms allowed in the setxattr hook */ 313 #define __ima_hooks(hook) \ argument 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_CHECK, module) \ [all …]
|
/linux/security/selinux/ |
H A D | xfrm.c | 5 * This file contains the SELinux XFRM hook function implementations. 145 * LSM hook implementation that authorizes that a flow can use a xfrm policy 167 * LSM hook implementation that authorizes that a state matches 253 * LSM hook implementation that checks and/or returns the xfrm sid for the 277 * LSM hook implementation that allocs and transfers uctx spec to xfrm_policy. 287 * LSM hook implementation that copies security data structure from old to new 309 * LSM hook implementation that frees xfrm_sec_ctx security information. 317 * LSM hook implementation that authorizes deletion of labeled policies. 325 * LSM hook implementation that allocates a xfrm_sec_state, populates it using 335 * LSM hook implementation that allocates a xfrm_sec_state and populates based [all …]
|
/linux/security/ipe/ |
H A D | hooks.c | 19 * ipe_bprm_check_security() - ipe security hook function for bprm check. 23 * This LSM hook is called when a binary is loaded through the exec 39 * ipe_mmap_file() - ipe security hook function for mmap check. 46 * This hook is called when a file is loaded through the mmap 67 * ipe_file_mprotect() - ipe security hook function for mprotect check. 73 * This LSM hook is called when a mmap'd region of memory is changing 99 * ipe_kernel_read_file() - ipe security hook function for kernel read. 104 * This LSM hook is called when a file is read from disk in the kernel. 145 * ipe_kernel_load_data() - ipe security hook function for kernel load data. 149 * This LSM hook is called when a data buffer provided by userspace is loading [all …]
|
/linux/include/net/netfilter/ipv4/ |
H A D | nf_reject.h | 10 void nf_send_unreach(struct sk_buff *skb_in, int code, int hook); 12 int hook); 14 struct tcphdr *_oth, int hook); 24 int hook, u8 code); 28 int hook);
|
/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 postrouting priority $prio; policy accept; [all …]
|
/linux/net/ipv6/netfilter/ |
H A D | nf_reject_ipv6.c | 15 static bool nf_reject_v6_csum_ok(struct sk_buff *skb, int hook) in nf_reject_v6_csum_ok() argument 37 return nf_ip6_checksum(skb, hook, thoff, proto) == 0; in nf_reject_v6_csum_ok() 62 int hook) in nf_reject_skb_v6_tcp_reset() argument 73 oth = nf_reject_ip6_tcphdr_get(oldskb, &_oth, &otcplen, hook); in nf_reject_skb_v6_tcp_reset() 97 int hook, u8 code) in nf_reject_skb_v6_unreach() argument 115 if (!nf_reject_v6_csum_ok(oldskb, hook)) in nf_reject_skb_v6_unreach() 151 unsigned int *otcplen, int hook) in nf_reject_ip6_tcphdr_get() argument 188 if (nf_ip6_checksum(oldskb, hook, tcphoff, IPPROTO_TCP)) { in nf_reject_ip6_tcphdr_get() 269 int hook) in nf_send_reset6() argument 285 otcph = nf_reject_ip6_tcphdr_get(oldskb, &_otcph, &otcplen, hook); in nf_send_reset6() [all …]
|
/linux/drivers/gpu/drm/ |
H A D | drm_atomic_state_helper.c | 89 * hook. 108 * drm_atomic_helper_crtc_reset - default &drm_crtc_funcs.reset hook for CRTCs 164 * drm_atomic_helper_crtc_duplicate_state - default state duplicate hook 167 * Default CRTC state duplicate hook for drivers which don't have their own 223 * drm_atomic_helper_crtc_destroy_state - default state destroy hook 227 * Default CRTC state destroy hook for drivers which don't have their own 304 * hook. 319 * drm_atomic_helper_plane_reset - default &drm_plane_funcs.reset hook for planes 361 * drm_atomic_helper_plane_duplicate_state - default state duplicate hook 364 * Default plane state duplicate hook for drivers which don't have their own [all …]
|