Lines Matching refs:ifindex

91 	int ifindex;  member
277 if ((args->ifindex && args->bind_key_ifindex >= 0) || args->bind_key_ifindex >= 1) { in tcp_md5sig()
281 md5sig.tcpm_ifindex = args->ifindex; in tcp_md5sig()
388 int ifindex = 0; in check_device() local
394 ifindex = get_ifidx(name); in check_device()
397 *name ? name : "<none>", ifindex); in check_device()
402 if (args->expected_ifindex != ifindex) { in check_device()
404 args->expected_ifindex, ifindex); in check_device()
409 args->expected_ifindex, ifindex); in check_device()
462 static int set_unicast_if(int sd, int ifindex, int version) in set_unicast_if() argument
468 ifindex = htonl(ifindex); in set_unicast_if()
474 rc = setsockopt(sd, level, opt, &ifindex, sizeof(ifindex)); in set_unicast_if()
481 static int set_multicast_if(int sd, int ifindex) in set_multicast_if() argument
483 struct ip_mreqn mreq = { .imr_ifindex = ifindex }; in set_multicast_if()
493 static int set_membership(int sd, uint32_t grp, uint32_t addr, int ifindex) in set_membership() argument
499 if (addr == htonl(INADDR_ANY) && !ifindex) { in set_membership()
506 mreq.imr_ifindex = ifindex; in set_membership()
579 args->ifindex = get_ifidx(args->dev); in resolve_devices()
580 if (args->ifindex < 0) { in resolve_devices()
837 int ifindex = 0; in get_index_from_cmsg() local
850 ifindex = pi->ipi_ifindex; in get_index_from_cmsg()
857 ifindex = pi6->ipi6_ifindex; in get_index_from_cmsg()
861 if (ifindex) { in get_index_from_cmsg()
863 ifindex, buf); in get_index_from_cmsg()
865 return ifindex; in get_index_from_cmsg()
890 int ifindex, int version) in send_msg_cmsg() argument
916 pi->ipi_ifindex = ifindex; in send_msg_cmsg()
928 pi6->ipi6_ifindex = ifindex; in send_msg_cmsg()
958 } else if (args->ifindex && args->use_cmsg) { in send_msg()
959 if (send_msg_cmsg(sd, addr, alen, args->ifindex, args->version)) in send_msg()
987 int ifindex; in socket_read_dgram() local
1012 ifindex = get_index_from_cmsg(&m); in socket_read_dgram()
1014 if (args->expected_ifindex != ifindex) { in socket_read_dgram()
1016 args->expected_ifindex, ifindex); in socket_read_dgram()
1020 args->expected_ifindex, ifindex); in socket_read_dgram()
1039 ifindex, AF_INET) < 0) in socket_read_dgram()
1059 s6->sin6_scope_id = ifindex; in socket_read_dgram()
1291 set_multicast_if(sd, args->ifindex)) in msock_init()
1303 args->local_addr.in.s_addr, args->ifindex)) in msock_init()
1419 set_unicast_if(sd, args->ifindex, args->version)) in lsock_init()
1629 set_unicast_if(sd, args->ifindex, args->version)) in connectsock()
1693 if ((args->use_setsockopt || args->use_cmsg) && !args->ifindex) { in do_client()