Home
last modified time | relevance | path

Searched refs:ifindex (Results 1 – 25 of 128) sorted by relevance

123456

/freebsd/usr.sbin/arp/
H A Darp_netlink.c54 get_link_info(struct snl_state *ss, uint32_t ifindex, in get_link_info() argument
64 ifmsg->ifi_index = ifindex; in get_link_info()
82 has_l2(struct snl_state *ss, uint32_t ifindex) in has_l2() argument
86 if (!get_link_info(ss, ifindex, &link)) in has_l2()
168 fix_ifindex(struct snl_state *ss, uint32_t ifindex, struct in_addr addr) in fix_ifindex() argument
170 if (ifindex == 0) in fix_ifindex()
171 ifindex = guess_ifindex(ss, get_myfib(), addr); in fix_ifindex()
172 return (ifindex); in fix_ifindex()
270 print_entries_nl(uint32_t ifindex, struct in_addr addr) in print_entries_nl() argument
284 ndmsg->ndm_ifindex = ifindex; in print_entries_nl()
[all …]
H A Darp.h6 int print_entries_nl(uint32_t ifindex, struct in_addr addr);
18 int print_entries_nl(uint32_t ifindex, struct in_addr addr);
19 int delete_nl(uint32_t ifindex, char *host);
20 int set_nl(uint32_t ifindex, struct sockaddr_in *dst, struct sockaddr_dl *sdl,
/freebsd/sys/netpfil/ipfw/
H A Dip_fw_iface.c65 uint16_t ifindex);
67 uint16_t ifindex);
187 int ifindex; in ipfw_kiflookup() local
189 ifindex = 0; in ipfw_kiflookup()
192 ifindex = ifp->if_index; in ipfw_kiflookup()
196 return (ifindex); in ipfw_kiflookup()
350 iif->ifindex = ipfw_kiflookup(name); in ipfw_iface_ref()
351 if (iif->ifindex != 0) in ipfw_iface_ref()
379 ic->cb(ch, ic->cbdata, iif->ifindex); in ipfw_iface_add_notify()
420 uint16_t ifindex) in handle_ifattach() argument
[all …]
/freebsd/usr.sbin/ndp/
H A Dndp_netlink.c66 get_link_info(struct snl_state *ss, uint32_t ifindex, in get_link_info() argument
76 ifmsg->ifi_index = ifindex; in get_link_info()
94 has_l2(struct snl_state *ss, uint32_t ifindex) in has_l2() argument
98 if (!get_link_info(ss, ifindex, &link)) in has_l2()
203 fix_ifindex(struct snl_state *ss, uint32_t ifindex, const struct sockaddr_in6 *sa) in fix_ifindex() argument
205 if (ifindex == 0) in fix_ifindex()
206 ifindex = guess_ifindex(ss, get_myfib(), sa); in fix_ifindex()
207 return (ifindex); in fix_ifindex()
312 print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag) in print_entries_nl() argument
337 ndmsg->ndm_ifindex = ifindex; in print_entries_nl()
[all …]
H A Dndp.h23 int print_entries_nl(uint32_t ifindex, struct sockaddr_in6 *addr, bool cflag);
24 int delete_nl(uint32_t ifindex, char *host, bool warn);
25 int set_nl(uint32_t ifindex, struct sockaddr_in6 *dst, struct sockaddr_dl *sdl,
/freebsd/usr.sbin/mtest/
H A Dmtest.c154 __ifindex_to_primary_ip(const uint32_t ifindex, struct in_addr *pina) in __ifindex_to_primary_ip() argument
162 assert(ifindex != 0); in __ifindex_to_primary_ip()
165 if (if_indextoname(ifindex, ifname) == NULL) in __ifindex_to_primary_ip()
289 uint32_t ifindex; in parse_cmd_args() local
298 ifindex = if_nametoindex(str2); in parse_cmd_args()
299 if (ifindex == 0) in parse_cmd_args()
330 ifindex = 0; in parse_cmd_args()
334 ifindex = 0; in parse_cmd_args()
341 return (ifindex); in parse_cmd_args()
386 uint32_t fmode, ifindex; in process_cmd() local
[all …]
/freebsd/usr.bin/netstat/
H A Dcommon.c90 int ifindex = 0, size; in prepare_ifmap() local
110 ifindex = sdl->sdl_index; in prepare_ifmap()
112 if (ifindex >= ifmap_size) { in prepare_ifmap()
113 size = roundup2(ifindex + 1, 32) * in prepare_ifmap()
121 ifmap_size = roundup2(ifindex + 1, 32); in prepare_ifmap()
124 if (*ifmap[ifindex].ifname != '\0') in prepare_ifmap()
127 strlcpy(ifmap[ifindex].ifname, ifa->ifa_name, IFNAMSIZ); in prepare_ifmap()
/freebsd/usr.sbin/rtadvd/
H A Dif.c164 get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter) in get_next_msg() argument
210 if (ifindex && SDL(gw)->sdl_index != ifindex) in get_next_msg()
237 if (ifindex && ifam->ifam_index != ifindex) in get_next_msg()
342 int ifindex; in update_persist_ifinfo() local
345 ifindex = if_nametoindex(ifname); in update_persist_ifinfo()
347 if (ifindex != 0) { in update_persist_ifinfo()
348 if (ifindex == ifi->ifi_ifindex) in update_persist_ifinfo()
411 update_ifinfo(struct ifilist_head_t *ifi_head, int ifindex) in update_ifinfo() argument
658 sock_mc_join(struct sockinfo * s,int ifindex) sock_mc_join() argument
695 sock_mc_leave(struct sockinfo * s,int ifindex) sock_mc_leave() argument
[all...]
H A Drrenum.c144 struct in6_rrenumreq *irr, int ifindex) in do_use_prefix() argument
214 ifi = if_indextoifinfo(ifindex); in do_use_prefix()
259 int ifindex = 0; in do_pco() local
281 while (if_indextoname(++ifindex, irr.irr_name)) { in do_pco()
282 ifi = if_indextoifinfo(ifindex); in do_pco()
296 do_use_prefix(len, rpm, &irr, ifindex); in do_pco()
/freebsd/usr.sbin/rtsold/
H A Dcap_sendmsg.c83 sendpacket(int sock, struct sockaddr_in6 *dst, uint32_t ifindex, int hoplimit, in sendpacket() argument
111 pi->ipi6_ifindex = ifindex; in sendpacket()
124 probe_defrouters(uint32_t ifindex, uint32_t linkid) in probe_defrouters() argument
133 if (ifindex == 0) in probe_defrouters()
158 if (ifindex != p->if_index) in probe_defrouters()
164 (void)sendpacket(probesock, &dst, ifindex, 1, NULL, 0); in probe_defrouters()
172 rssend(uint32_t ifindex, uint32_t linkid, const void *data, size_t len) in rssend() argument
187 n = sendpacket(rssock, &dst, ifindex, 255, data, len); in rssend()
259 uint32_t ifindex, linkid; in sendmsg_command() local
266 ifindex = (uint32_t)nvlist_get_number(nvlin, "ifindex"); in sendmsg_command()
[all …]
/freebsd/lib/libc/net/
H A Dsourcefilter.c86 int ifindex; in __inaddr_to_index() local
92 ifindex = 0; in __inaddr_to_index()
121 ifindex = LLINDEX(&psu->sdl); in __inaddr_to_index()
125 assert(ifindex != 0); in __inaddr_to_index()
129 return (ifindex); in __inaddr_to_index()
149 uint32_t ifindex; in setipv4sourcefilter() local
161 ifindex = __inaddr_to_index(interface.s_addr); in setipv4sourcefilter()
162 if (ifindex == 0) { in setipv4sourcefilter()
188 err = setsourcefilter(s, ifindex, (struct sockaddr *)&tmpgroup, in setipv4sourcefilter()
218 uint32_t ifindex, onumsrc; in getipv4sourcefilter() local
[all …]
H A Dif_indextoname.c61 if_indextoname(unsigned int ifindex, char *ifname) in if_indextoname() argument
66 if (ifindex == 0) { in if_indextoname()
77 ifindex == LLINDEX((struct sockaddr_dl*)ifa->ifa_addr)) in if_indextoname()
/freebsd/contrib/wpa/src/drivers/
H A Dlinux_ioctl.c153 int ifindex; in linux_br_add_if() local
155 ifindex = if_nametoindex(ifname); in linux_br_add_if()
156 if (ifindex == 0) in linux_br_add_if()
161 ifr.ifr_ifindex = ifindex; in linux_br_add_if()
187 int ifindex; in linux_br_del_if() local
189 ifindex = if_nametoindex(ifname); in linux_br_del_if()
190 if (ifindex == 0) in linux_br_del_if()
195 ifr.ifr_ifindex = ifindex; in linux_br_del_if()
/freebsd/sys/netlink/route/
H A Diface_drivers.c123 uint32_t ifindex = (uint32_t)if_getindex(ifp); in _nl_store_ifp_cookie() local
126 sizeof(ifindex) + NL_ITEM_ALIGN(ifname_len + 1); in _nl_store_ifp_cookie()
134 nla->nla_len = sizeof(struct nlattr) + sizeof(ifindex); in _nl_store_ifp_cookie()
136 memcpy(NLA_DATA(nla), &ifindex, sizeof(ifindex)); in _nl_store_ifp_cookie()
/freebsd/tests/sys/netlink/
H A Dtest_rtnl_ifaddr.py199 msg.base_hdr.ifa_index = iface.ifindex
203 def get_ifa_list(self, ifindex=0, family=0): argument
207 msg.base_hdr.ifa_index = ifindex
217 def setup_dummy_carp(self, ifindex: int, vhid: int):
226 msg.add_nla(NlAttrU32(CarpAttrType.CARP_NL_IFINDEX, ifindex))
246 lst = self.get_ifa_list(iface.ifindex, self.get_family_from_ip(ifa.ip))
281 lst = self.get_ifa_list(iface.ifindex, self.get_family_from_ip(ifa.ip))
301 lst = self.get_ifa_list(iface.ifindex, self.get_family_from_ip(ifa.ip))
316 self.setup_dummy_carp(iface.ifindex, vhid)
326 lst = self.get_ifa_list(iface.ifindex, self.get_family_from_ip(ifa.ip))
[all …]
H A Dtest_rtnl_iface.py275 ifindex = nla_map[IflattrType.IFLA_NEW_IFINDEX.value].u32
276 assert ifindex > 0
277 assert ifindex not in ifmap
278 ifmap[ifindex] = ifname
300 ifindex = rx_msg.base_hdr.ifi_index
301 assert ifindex == rx_msg.base_hdr.ifi_index
304 kernel_ifmap[ifindex] = ifname
322 ifindex = socket.if_nametoindex(os_ifname)
329 msg.base_hdr.ifi_index = ifindex
331 msg.add_nla(NlAttrU32(IflattrType.IFLA_LINK, ifindex))
/freebsd/contrib/bsnmp/snmp_mibII/
H A DmibII_ipaddr.c53 u_int ifindex; member
92 if ((ifa = mib_create_ifa(upd->ifindex, upd->addr, upd->mask, bcast)) in create()
109 if ((ifp = mib_find_if(ifa->ifindex)) == NULL) in modify()
111 if ((upd->set & UPD_IFINDEX) && upd->ifindex != ifa->ifindex) in modify()
174 if ((upd->set & UPD_IFINDEX) && upd->ifindex == 0) { in update_func()
272 if (ifa->ifindex != (u_int)value->v.integer && in op_ipaddr()
277 upd->ifindex = (u_int)value->v.integer; in op_ipaddr()
320 value->v.integer = ifa->ifindex; in op_ipaddr()
H A DmibII_rcvaddr.c40 mib_find_rcvaddr(u_int ifindex, const u_char *addr, size_t addrlen) in mib_find_rcvaddr() argument
45 if (rcv->ifindex == ifindex && in mib_find_rcvaddr()
66 rcv->ifindex = ifp->index; in mib_rcvaddr_create()
H A DmibII.c293 struct snmp_value ifindex; in link_trap() local
295 ifindex.var = oid_ifIndex; in link_trap()
296 ifindex.var.subs[ifindex.var.len++] = ifp->index; in link_trap()
297 ifindex.syntax = SNMP_SYNTAX_INTEGER; in link_trap()
298 ifindex.v.integer = ifp->index; in link_trap()
300 snmp_send_trap(up ? &oid_linkUp : &oid_linkDown, &ifindex, in link_trap()
595 if (ifp->index == ifa->ifindex) in mib_first_ififa()
607 if (ifa->ifindex == ifa0->ifindex) in mib_next_ififa()
616 alloc_ifa(u_int ifindex, struct in_addr addr) in alloc_ifa() argument
626 ifa->ifindex = ifindex; in alloc_ifa()
[all …]
/freebsd/tests/sys/net/routing/
H A Dtest_rtsock_l3.c47 c->ifindex = if_nametoindex(c->ifname); in jump_vnet()
210 verify_route_message_extra(struct rt_msghdr *rtm, int ifindex, int rtm_flags) in verify_route_message_extra() argument
212 RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_index == ifindex, in verify_route_message_extra()
213 "expected ifindex %d, got %d", ifindex, rtm->rtm_index); in verify_route_message_extra()
230 verify_link_gateway(struct rt_msghdr *rtm, int ifindex) in verify_link_gateway() argument
239 RTSOCK_ATF_REQUIRE_MSG(rtm, sdl->sdl_index == ifindex, "GW ifindex is %d", sdl->sdl_index); in verify_link_gateway()
296 verify_route_message_extra(rtm, c->ifindex, RTF_UP | RTF_DONE | RTF_PINNED); in ATF_TC_BODY()
299 verify_link_gateway(rtm, c->ifindex); in ATF_TC_BODY()
304 RTSOCK_ATF_REQUIRE_MSG(rtm, sdl->sdl_index == c->ifindex, "GW ifindex is %d", sdl->sdl_index); in ATF_TC_BODY()
340 verify_route_message_extra(rtm, c->ifindex, RTF_UP | RTF_DONE | RTF_PINNED); in ATF_TC_BODY()
[all …]
/freebsd/sys/netlink/
H A Dnetlink_message_parser.c408 uint32_t ifindex = *((const uint32_t *)NLA_DATA_CONST(nla)); in nlattr_get_ifp_internal() local
410 if (ifindex == 0 && zero_ok) { in nlattr_get_ifp_internal()
417 struct ifnet *ifp = ifnet_byindex(ifindex); in nlattr_get_ifp_internal()
420 nla->nla_type, ifindex); in nlattr_get_ifp_internal()
425 ifindex, if_name(ifp)); in nlattr_get_ifp_internal()
535 int ifindex = *((const int *)src); in nlf_get_ifp() local
539 struct ifnet *ifp = ifnet_byindex(ifindex); in nlf_get_ifp()
541 NL_LOG(LOG_DEBUG, "ifindex %u invalid", ifindex); in nlf_get_ifp()
552 int ifindex = *((const int *)src); in nlf_get_ifpz() local
556 struct ifnet *ifp = ifnet_byindex(ifindex); in nlf_get_ifpz()
[all …]
/freebsd/tests/sys/netinet6/
H A Dtest_ip6_output.py34 ifindex = socket.if_nametoindex(ifname)
35 addr_tuple = (ip, port, 0, ifindex)
37 ifindex = socket.if_nametoindex(ifname)
38 mreq = socket.inet_pton(socket.AF_INET6, ip) + struct.pack("I", ifindex)
41 addr_tuple = ("::", port, 0, ifindex)
422 ifindex = socket.if_nametoindex(os_ifname)
423 optval = struct.pack("I", ifindex)
466 ifindex = socket.if_nametoindex(os_ifname)
469 addr_tuple = (ip, self.DEFAULT_PORT, 0, ifindex)
473 ifindex = socket.if_nametoindex("lo0")
[all …]
/freebsd/usr.sbin/mld6query/
H A Dmld6.c80 u_short ifindex; variable
134 ifindex = (u_short)if_nametoindex(argv[0]); in main()
135 if (ifindex == 0) in main()
157 mreq.ipv6mr_interface = ifindex; in main()
170 make_msg(ifindex, &maddr, type, qaddr); in main()
334 mreq.ipv6mr_interface = ifindex; in quit()
/freebsd/contrib/ntp/libntp/lib/isc/unix/
H A Dinterfaceiter.c193 unsigned int ifindex; in linux_if_inet6_current() local
208 address, &ifindex, &prefix, &scope, &flags, name); in linux_if_inet6_current()
241 iter->current.ifindex = ifindex; in linux_if_inet6_current()
244 (isc_uint32_t)ifindex); in linux_if_inet6_current()
/freebsd/lib/libifconfig/
H A Dlibifconfig.c62 unsigned int ifindex; in isnd6defif() local
66 ifindex = if_nametoindex(ndifreq.ifname); in isnd6defif()
71 return (ndifreq.ifindex == ifindex); in isnd6defif()
300 unsigned int ifindex; in ifconfig_get_orig_name() local
303 ifindex = if_nametoindex(ifname); in ifconfig_get_orig_name()
304 if (ifindex == 0) { in ifconfig_get_orig_name()
312 name[4] = ifindex; in ifconfig_get_orig_name()

123456