Lines Matching refs:sock
28 int sock, sock_arp, flags = XDP_FLAGS_UPDATE_IF_NOEXIST; variable
66 close(sock); in close_and_exit()
92 static int recv_msg(struct sockaddr_nl sock_addr, int sock) in recv_msg() argument
100 len = recv(sock, buf_ptr, sizeof(buf) - nll, 0); in recv_msg()
316 int sock, seq = 0; in get_route_table() local
328 sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); in get_route_table()
329 if (sock < 0) { in get_route_table()
335 if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0) { in get_route_table()
354 ret = sendmsg(sock, &msg, 0); in get_route_table()
361 nll = recv_msg(sa, sock); in get_route_table()
370 close(sock); in get_route_table()
456 int sock, seq = 0; in get_arp_table() local
467 sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); in get_arp_table()
468 if (sock < 0) { in get_arp_table()
474 if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0) { in get_arp_table()
492 ret = sendmsg(sock, &msg, 0); in get_arp_table()
499 nll = recv_msg(sa, sock); in get_arp_table()
508 close(sock); in get_arp_table()
529 sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); in monitor_route()
530 if (sock < 0) { in monitor_route()
535 fcntl(sock, F_SETFL, O_NONBLOCK); in monitor_route()
539 if (bind(sock, (struct sockaddr *)&lr, sizeof(lr)) < 0) { in monitor_route()
544 fds_route.fd = sock; in monitor_route()
586 nll = recv_msg(lr, sock); in monitor_route()
612 close(sock); in monitor_route()