Lines Matching refs:sock

16 static int netlink_sock(int *sock, uint32_t *seq_nr, int proto)  in netlink_sock()  argument
18 if (*sock > 0) { in netlink_sock()
23 *sock = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, proto); in netlink_sock()
24 if (*sock < 0) { in netlink_sock()
34 static int netlink_check_answer(int sock, bool quite) in netlink_check_answer() argument
42 if (recv(sock, &answer, sizeof(answer), 0) < 0) { in netlink_check_answer()
134 static int __add_veth(int sock, uint32_t seq, const char *name, in __add_veth() argument
177 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __add_veth()
181 return netlink_check_answer(sock, false); in __add_veth()
197 static int __ip_addr_add(int sock, uint32_t seq, const char *intf, in __ip_addr_add() argument
222 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __ip_addr_add()
226 return netlink_check_answer(sock, true); in __ip_addr_add()
245 static int __ip_route_add(int sock, uint32_t seq, const char *intf, int family, in __ip_route_add() argument
278 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __ip_route_add()
283 return netlink_check_answer(sock, true); in __ip_route_add()
308 static int __link_set_up(int sock, uint32_t seq, const char *intf) in __link_set_up() argument
327 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __link_set_up()
331 return netlink_check_answer(sock, false); in __link_set_up()
348 static int __add_vrf(int sock, uint32_t seq, const char *name, in __add_vrf() argument
395 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __add_vrf()
399 return netlink_check_answer(sock, true); in __add_vrf()