Searched refs:ifindex (Results 1 - 25 of 433) sorted by relevance

1234567891011>>

/linux-master/tools/testing/selftests/bpf/progs/
H A Dempty_skb.c8 int ifindex; variable
14 ret = bpf_clone_redirect(skb, ifindex, BPF_F_INGRESS);
21 ret = bpf_clone_redirect(skb, ifindex, 0);
28 ret = bpf_clone_redirect(skb, ifindex, BPF_F_INGRESS);
35 ret = bpf_clone_redirect(skb, ifindex, 0);
H A Dkfree_skb.c28 int ifindex; member in struct:net_device
52 int ifindex; member in struct:meta
84 meta.ifindex = _(dev->ifindex);
98 bpf_printk("dev->ifindex %d data %llx pkt_data %x\n",
99 meta.ifindex, data, pkt_data);
102 if (users != 1 || pkt_data != bpf_htons(0x86dd) || meta.ifindex != 1)
121 int len, ifindex; local
125 ifindex = dev->ifindex;
139 int len, ifindex; local
[all...]
H A Dtest_check_mtu.c37 __u32 ifindex = 0; local
40 /* When ifindex is zero, save net_device lookup and use ctx netdev */
42 ifindex = GLOBAL_USER_IFINDEX;
44 if (bpf_check_mtu(ctx, ifindex, &mtu_len, delta, 0)) {
63 __u32 ifindex = GLOBAL_USER_IFINDEX; local
73 err = bpf_check_mtu(ctx, ifindex, &mtu_len, delta, 0);
90 __u32 ifindex = GLOBAL_USER_IFINDEX; local
101 if (bpf_check_mtu(ctx, ifindex, &mtu_len, delta, 0))
114 __u32 ifindex = GLOBAL_USER_IFINDEX; local
125 if (bpf_check_mtu(ctx, ifindex,
136 __u32 ifindex = GLOBAL_USER_IFINDEX; local
178 __u32 ifindex = GLOBAL_USER_IFINDEX; local
205 __u32 ifindex = GLOBAL_USER_IFINDEX; local
230 __u32 ifindex = GLOBAL_USER_IFINDEX; local
252 __u32 ifindex = GLOBAL_USER_IFINDEX; local
272 __u32 ifindex = GLOBAL_USER_IFINDEX; local
[all...]
H A Dtest_xdp_bpf2bpf.c12 int ifindex; member in struct:net_device
33 int ifindex; member in struct:meta
49 meta.ifindex = xdp->rxq->dev->ifindex;
56 test_result_fentry = xdp->rxq->dev->ifindex;
/linux-master/security/selinux/include/
H A Dnetif.h22 int sel_netif_sid(struct net *ns, int ifindex, u32 *sid);
/linux-master/security/selinux/
H A Dnetif.c45 * @ifindex: the network interface
52 static inline u32 sel_netif_hashfn(const struct net *ns, int ifindex) argument
54 return (((uintptr_t)ns + ifindex) & (SEL_NETIF_HASH_SIZE - 1));
60 * @ifindex: the network interface
63 * Search the network interface table and return the record matching @ifindex.
68 int ifindex)
70 u32 idx = sel_netif_hashfn(ns, ifindex);
75 netif->nsec.ifindex == ifindex)
97 idx = sel_netif_hashfn(netif->nsec.ns, netif->nsec.ifindex);
67 sel_netif_find(const struct net *ns, int ifindex) argument
132 sel_netif_sid_slow(struct net *ns, int ifindex, u32 *sid) argument
191 sel_netif_sid(struct net *ns, int ifindex, u32 *sid) argument
217 sel_netif_kill(const struct net *ns, int ifindex) argument
[all...]
/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dxdp_dev_bound_only.c8 static int load_dummy_prog(char *name, __u32 ifindex, __u32 flags) argument
14 opts.prog_ifindex = ifindex;
28 __u32 ifindex; local
37 ifindex = if_nametoindex("eth42");
38 if (!ASSERT_NEQ(ifindex, 0, "if_nametoindex")) {
42 fd1 = load_dummy_prog("dummy1", ifindex, BPF_F_XDP_DEV_BOUND_ONLY);
47 /* Program with ifindex is considered offloaded, however veth
50 fd2 = load_dummy_prog("dummy2", ifindex, 0);
H A Dempty_skb.c24 int *ifindex; member in struct:__anon375
37 .ifindex = &veth_ifindex,
45 .ifindex = &ipip_ifindex,
59 .ifindex = &veth_ifindex,
73 .ifindex = &ipip_ifindex,
84 .ifindex = &veth_ifindex,
91 .ifindex = &ipip_ifindex,
126 bpf_obj->bss->ifindex = *tests[i].ifindex;
H A Dtc_helpers.h49 return link_info.tcx.ifindex;
52 static inline void __assert_mprog_count(int target, int expected, int ifindex) argument
57 err = bpf_prog_query(ifindex, target, 0, &attach_flags,
68 static inline void assert_mprog_count_ifindex(int ifindex, int target, int expected) argument
70 __assert_mprog_count(target, expected, ifindex);
H A Dtc_netkit.c35 static int create_netkit(int mode, int policy, int peer_policy, int *ifindex, argument
68 *ifindex = if_nametoindex(netkit_name);
70 ASSERT_GT(*ifindex, 0, "retrieve_ifindex");
151 int err, ifindex; local
154 &ifindex, false);
176 assert_mprog_count_ifindex(ifindex, BPF_NETKIT_PRIMARY, 0);
177 assert_mprog_count_ifindex(ifindex, BPF_NETKIT_PEER, 0);
182 link = bpf_program__attach_netkit(skel->progs.tc1, ifindex, &optl);
190 assert_mprog_count_ifindex(ifindex, BPF_NETKIT_PRIMARY, 1);
191 assert_mprog_count_ifindex(ifindex, BPF_NETKIT_PEE
265 int err, ifindex; local
393 int err, ifindex; local
507 int err, ifindex, ifindex2; local
618 int err, ifindex; local
[all...]
H A Dtest_tunnel.c407 int key = 0, ifindex = -1; local
422 ifindex = if_nametoindex(VXLAN_TUNL_DEV1);
423 if (!ASSERT_NEQ(ifindex, 0, "vxlan11 ifindex"))
425 tc_hook.ifindex = ifindex;
436 ifindex = if_nametoindex("veth1");
437 if (!ASSERT_NEQ(ifindex, 0, "veth1 ifindex"))
439 tc_hook.ifindex
491 int key = 0, ifindex = -1; local
562 int ifindex = -1; local
636 int ifindex; local
[all...]
H A Dlwt_reroute.c189 int ifindex = -1; local
200 ifindex = if_nametoindex(tun_dev);
201 if (!ASSERT_GE(ifindex, 0, "if_nametoindex"))
204 snprintf(ip, 256, "10.0.0.%d", ifindex);
222 int ifindex = -1; local
231 ifindex = if_nametoindex(tun_dev);
232 if (!ASSERT_GE(ifindex, 0, "if_nametoindex"))
235 snprintf(ip, 256, "10.0.0.%d", ifindex);
/linux-master/samples/bpf/
H A Dtc_l2_redirect_user.c19 printf(" -i <ifindex> Interface index\n");
26 int ifindex = -1; local
39 ifindex = atoi(optarg);
47 if (ifindex < 0 || !pinned_file) {
60 ret = bpf_map_update_elem(array_fd, &array_key, &ifindex, 0);
H A Dtc_l2_redirect_kern.c65 int key = 0, *ifindex; local
72 ifindex = bpf_map_lookup_elem(&tun_iface, &key);
73 if (!ifindex)
77 char fmt4[] = "ingress forward to ifindex:%d daddr4:%x\n";
86 bpf_trace_printk(fmt4, sizeof(fmt4), *ifindex,
88 return bpf_redirect(*ifindex, BPF_F_INGRESS);
90 char fmt6[] = "ingress forward to ifindex:%d daddr6:%x::%x\n";
100 bpf_trace_printk(fmt6, sizeof(fmt6), *ifindex,
103 return bpf_redirect(*ifindex, BPF_F_INGRESS);
116 int key = 0, *ifindex; local
157 int key = 0, *ifindex; local
[all...]
H A Dxdp_adjust_tail_user.c27 static int ifindex = -1; variable
35 if (ifindex > -1) {
36 if (bpf_xdp_query_id(ifindex, xdp_flags, &curr_prog_id)) {
41 bpf_xdp_detach(ifindex, xdp_flags, NULL);
73 printf(" -i <ifname|ifindex> Interface\n");
105 ifindex = if_nametoindex(optarg);
106 if (!ifindex)
107 ifindex = atoi(optarg);
142 if (!ifindex) {
182 if (bpf_xdp_attach(ifindex, prog_f
[all...]
/linux-master/tools/net/ynl/samples/
H A Dnetdev.c24 if (!d->_present.ifindex)
27 name = if_indextoname(d->ifindex, ifname);
30 printf("[%d]\t", d->ifindex);
67 int ifindex = 0; local
70 ifindex = strtol(argv[1], NULL, 0);
81 printf("Select ifc ($ifindex; or 0 = dump; or -2 ntf check): ");
82 scanf("%d", &ifindex);
84 if (ifindex > 0) {
89 netdev_dev_get_req_set_ifindex(req, ifindex);
98 } else if (!ifindex) {
[all...]
/linux-master/include/net/
H A Dl3mdev.h67 int ifindex; local
70 ifindex = l3mdev_master_ifindex_rcu(dev);
73 return ifindex;
76 static inline int l3mdev_master_ifindex_by_index(struct net *net, int ifindex) argument
81 if (likely(ifindex)) {
84 dev = dev_get_by_index_rcu(net, ifindex);
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) argument
124 ifindex = l3mdev_master_upper_ifindex_by_index_rcu(net, ifindex);
143 netif_index_is_l3_master(struct net *net, int ifindex) argument
232 l3mdev_master_ifindex_by_index(struct net *net, int ifindex) argument
238 l3mdev_master_upper_ifindex_by_index_rcu(struct net *net, int ifindex) argument
243 l3mdev_master_upper_ifindex_by_index(struct net *net, int ifindex) argument
262 l3mdev_fib_table_by_index(struct net *net, int ifindex) argument
267 netif_index_is_l3_master(struct net *net, int ifindex) argument
[all...]
/linux-master/tools/testing/selftests/bpf/
H A Dxdp_redirect_multi.c45 static int get_mac_addr(unsigned int ifindex, void *mac_addr) argument
55 if (!if_indextoname(ifindex, ifname))
93 unsigned int ifindex; local
187 ifindex = ifaces[i];
190 ret = get_mac_addr(ifindex, mac_addr);
192 printf("get interface %d mac failed\n", ifindex);
195 ret = bpf_map_update_elem(mac_map, &ifindex, mac_addr, 0);
203 devmap_val.ifindex = ifindex;
205 ret = bpf_map_update_elem(group_all, &ifindex,
[all...]
/linux-master/include/net/netfilter/
H A Dnf_conntrack_act_ct.h11 int ifindex[IP_CT_DIR_MAX]; member in struct:nf_conn_act_ct_ext
31 act_ct_ext->ifindex[CTINFO2DIR(ctinfo)] = skb->dev->ifindex;
/linux-master/include/uapi/linux/tc_act/
H A Dtc_mirred.h16 __u32 ifindex; /* ifindex of egress port */ member in struct:tc_mirred
/linux-master/net/l3mdev/
H A Dl3mdev.c81 int ifindex = -EINVAL; local
96 ifindex = lookup(net, table_id);
101 return ifindex;
112 int ifindex = 0; local
118 ifindex = dev->ifindex;
131 ifindex = master->ifindex;
134 return ifindex;
142 * @ifindex
144 l3mdev_master_upper_ifindex_by_index_rcu(struct net *net, int ifindex) argument
189 l3mdev_fib_table_by_index(struct net *net, int ifindex) argument
[all...]
/linux-master/drivers/net/vxlan/
H A Dvxlan_multicast.c21 int ifindex = (rifindex ? : vxlan->default_dst.remote_ifindex); local
29 .imr_ifindex = ifindex,
42 ret = ipv6_stub->ipv6_sock_mc_join(sk, ifindex,
55 int ifindex = (rifindex ? : vxlan->default_dst.remote_ifindex); local
63 .imr_ifindex = ifindex,
76 ret = ipv6_stub->ipv6_sock_mc_drop(sk, ifindex,
85 static bool vxlan_group_used_match(union vxlan_addr *ip, int ifindex, argument
94 if (rifindex != ifindex)
101 union vxlan_addr *ip, int ifindex)
106 if (vxlan_group_used_match(ip, ifindex,
100 vxlan_group_used_by_vnifilter(struct vxlan_dev *vxlan, union vxlan_addr *ip, int ifindex) argument
129 int ifindex = (rifindex ? : dev->default_dst.remote_ifindex); local
[all...]
/linux-master/tools/bpf/bpftool/
H A Dfeature.c144 static int get_vendor_id(int ifindex) argument
150 if (!if_indextoname(ifindex, ifname))
516 __u32 ifindex)
522 .prog_ifindex = ifindex,
534 static bool probe_prog_type_ifindex(enum bpf_prog_type prog_type, __u32 ifindex) argument
543 NULL, 0, ifindex);
548 bool *supported_types, const char *define_prefix, __u32 ifindex)
555 if (ifindex) {
564 res = probe_prog_type_ifindex(prog_type, ifindex);
593 static bool probe_map_type_ifindex(enum bpf_map_type map_type, __u32 ifindex) argument
513 probe_prog_load_ifindex(enum bpf_prog_type prog_type, const struct bpf_insn *insns, size_t insns_cnt, char *log_buf, size_t log_buf_sz, __u32 ifindex) argument
547 probe_prog_type(enum bpf_prog_type prog_type, const char *prog_type_str, bool *supported_types, const char *define_prefix, __u32 ifindex) argument
614 probe_map_type(enum bpf_map_type map_type, char const *map_type_str, const char *define_prefix, __u32 ifindex) argument
655 probe_helper_ifindex(enum bpf_func_id id, enum bpf_prog_type prog_type, __u32 ifindex) argument
682 probe_helper_for_progtype(enum bpf_prog_type prog_type, bool supported_type, const char *define_prefix, unsigned int id, const char *ptype_name, __u32 ifindex) argument
719 probe_helpers_for_progtype(enum bpf_prog_type prog_type, const char *prog_type_str, bool supported_type, const char *define_prefix, __u32 ifindex) argument
780 probe_misc_feature(struct bpf_insn *insns, size_t len, const char *define_prefix, __u32 ifindex, const char *feat_name, const char *plain_name, const char *define_name) argument
808 probe_large_insn_limit(const char *define_prefix, __u32 ifindex) argument
829 probe_bounded_loops(const char *define_prefix, __u32 ifindex) argument
850 probe_v2_isa_extension(const char *define_prefix, __u32 ifindex) argument
871 probe_v3_isa_extension(const char *define_prefix, __u32 ifindex) argument
931 section_program_types(bool *supported_types, const char *define_prefix, __u32 ifindex) argument
956 section_map_types(const char *define_prefix, __u32 ifindex) argument
980 section_helpers(bool *supported_types, const char *define_prefix, __u32 ifindex) argument
1021 section_misc(const char *define_prefix, __u32 ifindex) argument
1163 __u32 ifindex = 0; local
[all...]
/linux-master/include/trace/events/
H A Dxdp.h39 __field(int, ifindex)
45 __entry->ifindex = dev->ifindex;
48 TP_printk("prog_id=%d action=%s ifindex=%d",
51 __entry->ifindex)
62 __field(int, ifindex)
70 __entry->ifindex = dev->ifindex;
77 TP_printk("ifindex=%d action=%s sent=%d drops=%d err=%d",
78 __entry->ifindex,
[all...]
/linux-master/net/ipv6/
H A Daddrlabel.c35 int ifindex; member in struct:ip6addrlbl_entry
116 int addrtype, int ifindex)
118 if (p->ifindex && p->ifindex != ifindex)
129 int type, int ifindex)
134 if (__ip6addrlbl_match(p, addr, type, ifindex))
141 const struct in6_addr *addr, int type, int ifindex)
149 p = __ipv6_addr_label(net, addr, type, ifindex);
153 ADDRLABEL(KERN_DEBUG "%s(addr=%pI6, type=%d, ifindex
114 __ip6addrlbl_match(const struct ip6addrlbl_entry *p, const struct in6_addr *addr, int addrtype, int ifindex) argument
127 __ipv6_addr_label(struct net *net, const struct in6_addr *addr, int type, int ifindex) argument
140 ipv6_addr_label(struct net *net, const struct in6_addr *addr, int type, int ifindex) argument
160 ip6addrlbl_alloc(const struct in6_addr *prefix, int prefixlen, int ifindex, u32 label) argument
242 ip6addrlbl_add(struct net *net, const struct in6_addr *prefix, int prefixlen, int ifindex, u32 label, int replace) argument
265 __ip6addrlbl_del(struct net *net, const struct in6_addr *prefix, int prefixlen, int ifindex) argument
289 ip6addrlbl_del(struct net *net, const struct in6_addr *prefix, int prefixlen, int ifindex) argument
372 addrlbl_ifindex_exists(struct net *net, int ifindex) argument
435 ip6addrlbl_putmsg(struct nlmsghdr *nlh, int prefixlen, int ifindex, u32 lseq) argument
[all...]

Completed in 500 milliseconds

1234567891011>>