/Linux-v5.10/security/selinux/ |
D | netif.c | 53 static inline u32 sel_netif_hashfn(const struct net *ns, int ifindex) in sel_netif_hashfn() argument 55 return (((uintptr_t)ns + ifindex) & (SEL_NETIF_HASH_SIZE - 1)); in sel_netif_hashfn() 69 int ifindex) in sel_netif_find() argument 71 int idx = sel_netif_hashfn(ns, ifindex); in sel_netif_find() 76 netif->nsec.ifindex == ifindex) in sel_netif_find() 98 idx = sel_netif_hashfn(netif->nsec.ns, netif->nsec.ifindex); in sel_netif_insert() 133 static int sel_netif_sid_slow(struct net *ns, int ifindex, u32 *sid) in sel_netif_sid_slow() argument 143 dev = dev_get_by_index(ns, ifindex); in sel_netif_sid_slow() 146 __func__, ifindex); in sel_netif_sid_slow() 151 netif = sel_netif_find(ns, ifindex); in sel_netif_sid_slow() [all …]
|
/Linux-v5.10/net/l3mdev/ |
D | l3mdev.c | 81 int ifindex = -EINVAL; in l3mdev_ifindex_lookup_by_table_id() local 96 ifindex = lookup(net, table_id); in l3mdev_ifindex_lookup_by_table_id() 101 return ifindex; in l3mdev_ifindex_lookup_by_table_id() 112 int ifindex = 0; in l3mdev_master_ifindex_rcu() local 118 ifindex = dev->ifindex; in l3mdev_master_ifindex_rcu() 131 ifindex = master->ifindex; in l3mdev_master_ifindex_rcu() 134 return ifindex; in l3mdev_master_ifindex_rcu() 144 int l3mdev_master_upper_ifindex_by_index_rcu(struct net *net, int ifindex) in l3mdev_master_upper_ifindex_by_index_rcu() argument 148 dev = dev_get_by_index_rcu(net, ifindex); in l3mdev_master_upper_ifindex_by_index_rcu() 152 return dev ? dev->ifindex : 0; in l3mdev_master_upper_ifindex_by_index_rcu() [all …]
|
/Linux-v5.10/include/net/ |
D | l3mdev.h | 67 int ifindex; in l3mdev_master_ifindex() local 70 ifindex = l3mdev_master_ifindex_rcu(dev); in l3mdev_master_ifindex() 73 return ifindex; in l3mdev_master_ifindex() 76 static inline int l3mdev_master_ifindex_by_index(struct net *net, int ifindex) in l3mdev_master_ifindex_by_index() argument 81 if (likely(ifindex)) { in l3mdev_master_ifindex_by_index() 84 dev = dev_get_by_index_rcu(net, ifindex); in l3mdev_master_ifindex_by_index() 119 int l3mdev_master_upper_ifindex_by_index_rcu(struct net *net, int ifindex); 121 int l3mdev_master_upper_ifindex_by_index(struct net *net, int ifindex) in l3mdev_master_upper_ifindex_by_index() argument 124 ifindex = l3mdev_master_upper_ifindex_by_index_rcu(net, ifindex); in l3mdev_master_upper_ifindex_by_index() 127 return ifindex; in l3mdev_master_upper_ifindex_by_index() [all …]
|
/Linux-v5.10/tools/testing/selftests/bpf/progs/ |
D | kfree_skb.c | 28 int ifindex; member 52 int ifindex; member 84 meta.ifindex = _(dev->ifindex); in BPF_PROG() 99 meta.ifindex, data, pkt_data); in BPF_PROG() 102 if (users != 1 || pkt_data != bpf_htons(0x86dd) || meta.ifindex != 1) in BPF_PROG() 121 int len, ifindex; in BPF_PROG() local 125 ifindex = dev->ifindex; in BPF_PROG() 129 if (len != 74 || ifindex != 1) in BPF_PROG() 139 int len, ifindex; in BPF_PROG() local 143 ifindex = dev->ifindex; in BPF_PROG() [all …]
|
D | test_xdp_bpf2bpf.c | 12 int ifindex; member 33 int ifindex; member 51 meta.ifindex = xdp->rxq->dev->ifindex; in BPF_PROG() 58 test_result_fentry = xdp->rxq->dev->ifindex; in BPF_PROG()
|
/Linux-v5.10/samples/bpf/ |
D | tc_l2_redirect_kern.c | 65 int key = 0, *ifindex; in _l2_to_iptun_ingress_forward() local 72 ifindex = bpf_map_lookup_elem(&tun_iface, &key); in _l2_to_iptun_ingress_forward() 73 if (!ifindex) in _l2_to_iptun_ingress_forward() 86 bpf_trace_printk(fmt4, sizeof(fmt4), *ifindex, in _l2_to_iptun_ingress_forward() 88 return bpf_redirect(*ifindex, BPF_F_INGRESS); in _l2_to_iptun_ingress_forward() 100 bpf_trace_printk(fmt6, sizeof(fmt6), *ifindex, in _l2_to_iptun_ingress_forward() 103 return bpf_redirect(*ifindex, BPF_F_INGRESS); in _l2_to_iptun_ingress_forward() 116 int key = 0, *ifindex; in _l2_to_iptun_ingress_redirect() local 123 ifindex = bpf_map_lookup_elem(&tun_iface, &key); in _l2_to_iptun_ingress_redirect() 124 if (!ifindex) in _l2_to_iptun_ingress_redirect() [all …]
|
D | xdp_adjust_tail_user.c | 28 static int ifindex = -1; variable 36 if (ifindex > -1) { in int_exit() 37 if (bpf_get_link_xdp_id(ifindex, &curr_prog_id, xdp_flags)) { in int_exit() 42 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in int_exit() 109 ifindex = if_nametoindex(optarg); in main() 110 if (!ifindex) in main() 111 ifindex = atoi(optarg); in main() 151 if (!ifindex) { in main() 182 if (bpf_set_link_xdp_fd(ifindex, prog_fd, xdp_flags) < 0) { in main()
|
D | xdp_tx_iptunnel_user.c | 25 static int ifindex = -1; variable 34 if (ifindex > -1) { in int_exit() 35 if (bpf_get_link_xdp_id(ifindex, &curr_prog_id, xdp_flags)) { in int_exit() 40 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in int_exit() 185 ifindex = if_nametoindex(optarg); in main() 186 if (!ifindex) in main() 187 ifindex = atoi(optarg); in main() 262 if (!ifindex) { in main() 297 if (bpf_set_link_xdp_fd(ifindex, prog_fd, xdp_flags) < 0) { in main() 311 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in main()
|
D | xdp1_user.c | 21 static int ifindex; variable 29 if (bpf_get_link_xdp_id(ifindex, &curr_prog_id, xdp_flags)) { in int_exit() 34 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in int_exit() 125 ifindex = if_nametoindex(argv[optind]); in main() 126 if (!ifindex) { in main() 152 if (bpf_set_link_xdp_fd(ifindex, prog_fd, xdp_flags) < 0) { in main()
|
D | tc_l2_redirect_user.c | 26 int ifindex = -1; in main() local 39 ifindex = atoi(optarg); in main() 47 if (ifindex < 0 || !pinned_file) { in main() 60 ret = bpf_map_update_elem(array_fd, &array_key, &ifindex, 0); in main()
|
D | test_lwt_bpf.c | 50 skb->ingress_ifindex, skb->ifindex); in do_test_ctx() 171 int ret, ifindex = DST_IFINDEX; in __do_push_ll_and_redirect() local 189 return bpf_redirect(ifindex, 0); in __do_push_ll_and_redirect() 201 int ret, ifindex = DST_IFINDEX; in do_push_ll_and_redirect() local 205 printk("redirected to %d\n", ifindex); in do_push_ll_and_redirect() 239 int ifindex = DST_IFINDEX; in do_fill_garbage_and_redirect() local 241 printk("redirected to %d\n", ifindex); in do_fill_garbage_and_redirect() 242 return bpf_redirect(ifindex, 0); in do_fill_garbage_and_redirect()
|
D | xdp_redirect_kern.c | 62 int *ifindex, port = 0; in xdp_redirect_prog() local 71 ifindex = bpf_map_lookup_elem(&tx_port, &port); in xdp_redirect_prog() 72 if (!ifindex) in xdp_redirect_prog() 80 return bpf_redirect(*ifindex, 0); in xdp_redirect_prog()
|
/Linux-v5.10/net/can/ |
D | bcm.c | 101 int ifindex; member 125 int ifindex; member 168 static char *bcm_proc_getifname(struct net *net, char *result, int ifindex) in bcm_proc_getifname() argument 172 if (!ifindex) in bcm_proc_getifname() 176 dev = dev_get_by_index_rcu(net, ifindex); in bcm_proc_getifname() 198 seq_printf(m, " / bound %s", bcm_proc_getifname(net, ifname, bo->ifindex)); in bcm_proc_show() 210 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show() 239 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show() 272 if (!op->ifindex) in bcm_can_tx() 275 dev = dev_get_by_index(sock_net(op->sk), op->ifindex); in bcm_can_tx() [all …]
|
D | raw.c | 83 int ifindex; member 165 addr->can_ifindex = skb->dev->ifindex; in raw_rcv() 277 if (ro->ifindex != dev->ifindex) in raw_notifier() 290 ro->ifindex = 0; in raw_notifier() 315 ro->ifindex = 0; in raw_init() 358 if (ro->ifindex) { in raw_release() 361 dev = dev_get_by_index(sock_net(sk), ro->ifindex); in raw_release() 374 ro->ifindex = 0; in raw_release() 393 int ifindex; in raw_bind() local 404 if (ro->bound && addr->can_ifindex == ro->ifindex) in raw_bind() [all …]
|
/Linux-v5.10/net/ipv6/ |
D | addrlabel.c | 35 int ifindex; member 116 int addrtype, int ifindex) in __ip6addrlbl_match() argument 118 if (p->ifindex && p->ifindex != ifindex) in __ip6addrlbl_match() 129 int type, int ifindex) in __ipv6_addr_label() argument 134 if (__ip6addrlbl_match(p, addr, type, ifindex)) in __ipv6_addr_label() 141 const struct in6_addr *addr, int type, int ifindex) in ipv6_addr_label() argument 149 p = __ipv6_addr_label(net, addr, type, ifindex); in ipv6_addr_label() 154 __func__, addr, type, ifindex, label); in ipv6_addr_label() 161 int prefixlen, int ifindex, in ip6addrlbl_alloc() argument 168 __func__, prefix, prefixlen, ifindex, (unsigned int)label); in ip6addrlbl_alloc() [all …]
|
/Linux-v5.10/tools/bpf/bpftool/ |
D | net.c | 32 int ifindex; member 57 int ifindex; member 214 static int netlink_get_class(int sock, unsigned int nl_pid, int ifindex, in netlink_get_class() argument 225 .t.tcm_ifindex = ifindex, in netlink_get_class() 253 static int netlink_get_qdisc(int sock, unsigned int nl_pid, int ifindex, in netlink_get_qdisc() argument 264 .t.tcm_ifindex = ifindex, in netlink_get_qdisc() 292 static int netlink_get_filter(int sock, unsigned int nl_pid, int ifindex, int handle, in netlink_get_filter() argument 303 .t.tcm_ifindex = ifindex, in netlink_get_filter() 370 netinfo->devices[netinfo->used_len].ifindex = ifinfo->ifi_index; in dump_link_nlmsg() 421 filter_info->devname, filter_info->ifindex); in dump_filter_nlmsg() [all …]
|
D | feature.c | 479 const char *define_prefix, __u32 ifindex) in probe_prog_type() argument 486 if (ifindex) in probe_prog_type() 496 res = bpf_probe_prog_type(prog_type, ifindex); in probe_prog_type() 527 __u32 ifindex) in probe_map_type() argument 534 res = bpf_probe_map_type(map_type, ifindex); in probe_map_type() 561 const char *ptype_name, __u32 ifindex) in probe_helper_for_progtype() argument 566 res = bpf_probe_helper(id, prog_type, ifindex); in probe_helper_for_progtype() 592 const char *define_prefix, __u32 ifindex) in probe_helpers_for_progtype() argument 598 if (ifindex) in probe_helpers_for_progtype() 630 ifindex); in probe_helpers_for_progtype() [all …]
|
/Linux-v5.10/tools/lib/bpf/ |
D | libbpf_probes.c | 25 static int get_vendor_id(int ifindex) in get_vendor_id() argument 31 if (!if_indextoname(ifindex, ifname)) in get_vendor_id() 69 size_t insns_cnt, char *buf, size_t buf_len, __u32 ifindex) in probe_load() argument 120 xattr.prog_ifindex = ifindex; in probe_load() 127 bool bpf_probe_prog_type(enum bpf_prog_type prog_type, __u32 ifindex) in bpf_probe_prog_type() argument 134 if (ifindex && prog_type == BPF_PROG_TYPE_SCHED_CLS) in bpf_probe_prog_type() 139 probe_load(prog_type, insns, ARRAY_SIZE(insns), NULL, 0, ifindex); in bpf_probe_prog_type() 200 bool bpf_probe_map_type(enum bpf_map_type map_type, __u32 ifindex) in bpf_probe_map_type() argument 276 if (ifindex) in bpf_probe_map_type() 293 attr.map_ifindex = ifindex; in bpf_probe_map_type() [all …]
|
D | netlink.c | 28 int ifindex; member 134 static int __bpf_set_link_xdp_fd_replace(int ifindex, int fd, int old_fd, in __bpf_set_link_xdp_fd_replace() argument 157 req.ifinfo.ifi_index = ifindex; in __bpf_set_link_xdp_fd_replace() 202 int bpf_set_link_xdp_fd_opts(int ifindex, int fd, __u32 flags, in bpf_set_link_xdp_fd_opts() argument 215 return __bpf_set_link_xdp_fd_replace(ifindex, fd, in bpf_set_link_xdp_fd_opts() 220 int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags) in bpf_set_link_xdp_fd() argument 222 return __bpf_set_link_xdp_fd_replace(ifindex, fd, 0, flags); in bpf_set_link_xdp_fd() 247 if (xdp_id->ifindex && xdp_id->ifindex != ifinfo->ifi_index) in get_xdp_info() 288 int bpf_get_link_xdp_info(int ifindex, struct xdp_link_info *info, in bpf_get_link_xdp_info() argument 309 xdp_id.ifindex = ifindex; in bpf_get_link_xdp_info() [all …]
|
/Linux-v5.10/net/wimax/ |
D | id-table.c | 73 struct genl_info *info, int ifindex) in wimax_dev_get_by_genl_info() argument 77 d_fnstart(3, NULL, "(info %p ifindex %d)\n", info, ifindex); in wimax_dev_get_by_genl_info() 80 if (wimax_dev->net_dev->ifindex == ifindex) { in wimax_dev_get_by_genl_info() 87 ifindex); in wimax_dev_get_by_genl_info() 91 info, ifindex, wimax_dev); in wimax_dev_get_by_genl_info() 126 __func__, wimax_dev, wimax_dev->net_dev->ifindex); in wimax_id_table_release()
|
/Linux-v5.10/include/trace/events/ |
D | xdp.h | 38 __field(int, ifindex) 44 __entry->ifindex = dev->ifindex; 50 __entry->ifindex) 61 __field(int, ifindex) 69 __entry->ifindex = dev->ifindex; 77 __entry->ifindex, 92 ((struct _bpf_dtab_netdev *)tgt)->dev->ifindex : 0) 106 __field(int, ifindex) 116 __entry->ifindex = dev->ifindex; 128 __entry->ifindex, __entry->to_ifindex, [all …]
|
/Linux-v5.10/tools/testing/selftests/net/ |
D | nettest.c | 76 int ifindex; member 229 if (args->ifindex) { in tcp_md5sig() 233 md5sig.tcpm_ifindex = args->ifindex; in tcp_md5sig() 337 int ifindex = 0; in check_device() local 343 ifindex = get_ifidx(name); in check_device() 346 *name ? name : "<none>", ifindex); in check_device() 351 if (args->expected_ifindex != ifindex) { in check_device() 353 args->expected_ifindex, ifindex); in check_device() 358 args->expected_ifindex, ifindex); in check_device() 411 static int set_unicast_if(int sd, int ifindex, int version) in set_unicast_if() argument [all …]
|
/Linux-v5.10/net/bridge/ |
D | br_mdb.c | 39 if (nla_put_nohdr(skb, sizeof(u32), &p->dev->ifindex) || in br_rports_fill_info() 159 int ifindex; in __mdb_fill_info() local 163 ifindex = p->key.port->dev->ifindex; in __mdb_fill_info() 167 ifindex = mp->br->dev->ifindex; in __mdb_fill_info() 172 e.ifindex = ifindex; in __mdb_fill_info() 308 if (bpm->ifindex) { in br_mdb_valid_dump_req() 355 bpm->ifindex = dev->ifindex; in br_mdb_dump() 393 bpm->ifindex = dev->ifindex; in nlmsg_populate_mdb_fill() 607 int ifindex, u32 pid, in nlmsg_populate_rtr_fill() argument 621 bpm->ifindex = dev->ifindex; in nlmsg_populate_rtr_fill() [all …]
|
/Linux-v5.10/net/netfilter/ |
D | nf_nat_masquerade.c | 50 nat->masq_index = out->ifindex; in nf_nat_masquerade_ipv4() 66 static int device_cmp(struct nf_conn *i, void *ifindex) in device_cmp() argument 72 return nat->masq_index == (int)(long)ifindex; in device_cmp() 89 (void *)(long)dev->ifindex, 0, 0); in masq_device_event() 101 if (!device_cmp(ct, (void *)(long)dev->ifindex)) in inet_cmp() 178 nat->masq_index = out->ifindex; in nf_nat_masquerade_ipv6() 194 int ifindex; member 202 if (!device_cmp(ct, (void *)(long)w->ifindex)) in inet6_cmp() 255 w->ifindex = dev->ifindex; in masq_inet6_event()
|
/Linux-v5.10/net/netlabel/ |
D | netlabel_unlabeled.c | 83 int ifindex; member 186 static u32 netlbl_unlhsh_hash(int ifindex) in netlbl_unlhsh_hash() argument 188 return ifindex & (netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->size - 1); in netlbl_unlhsh_hash() 202 static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex) in netlbl_unlhsh_search_iface() argument 208 bkt = netlbl_unlhsh_hash(ifindex); in netlbl_unlhsh_search_iface() 212 if (iter->valid && iter->ifindex == ifindex) in netlbl_unlhsh_search_iface() 312 static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex) in netlbl_unlhsh_add_iface() argument 321 iface->ifindex = ifindex; in netlbl_unlhsh_add_iface() 327 if (ifindex > 0) { in netlbl_unlhsh_add_iface() 328 bkt = netlbl_unlhsh_hash(ifindex); in netlbl_unlhsh_add_iface() [all …]
|