Lines Matching full:ss

49 nl_init_socket(struct snl_state *ss)  in nl_init_socket()  argument
51 if (snl_init(ss, NETLINK_ROUTE)) in nl_init_socket()
58 if (snl_init(ss, NETLINK_ROUTE)) in nl_init_socket()
66 get_link_info(struct snl_state *ss, uint32_t ifindex, in get_link_info() argument
71 snl_init_writer(ss, &nw); in get_link_info()
77 if (! (hdr = snl_finalize_msg(&nw)) || !snl_send_message(ss, hdr)) in get_link_info()
80 hdr = snl_read_reply(ss, hdr->nlmsg_seq); in get_link_info()
85 if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_link_parser_simple, link)) 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()
134 guess_ifindex(struct snl_state *ss, uint32_t fibnum, const struct sockaddr_in6 *dst) in guess_ifindex() argument
144 snl_init_writer(ss, &nw); in guess_ifindex()
153 if (! (hdr = snl_finalize_msg(&nw)) || !snl_send_message(ss, hdr)) in guess_ifindex()
156 hdr = snl_read_reply(ss, hdr->nlmsg_seq); in guess_ifindex()
164 if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_route_parser, &r)) in guess_ifindex()
171 if (has_l2(ss, r.rta_oif)) in guess_ifindex()
175 snl_init_writer(ss, &nw); in guess_ifindex()
185 if (! (hdr = snl_finalize_msg(&nw)) || !snl_send_message(ss, hdr)) in guess_ifindex()
188 hdr = snl_read_reply(ss, hdr->nlmsg_seq); in guess_ifindex()
196 if (!snl_parse_nlmsg(ss, hdr, &snl_nhmsg_parser, &nh)) in guess_ifindex()
203 fix_ifindex(struct snl_state *ss, uint32_t ifindex, const struct sockaddr_in6 *sa) in fix_ifindex() argument
206 ifindex = guess_ifindex(ss, get_myfib(), sa); in fix_ifindex()
406 struct snl_state ss = {}; in delete_nl() local
416 nl_init_socket(&ss); in delete_nl()
418 ifindex = fix_ifindex(&ss, ifindex, &dst); in delete_nl()
421 snl_free(&ss); in delete_nl()
425 snl_init_writer(&ss, &nw); in delete_nl()
434 if (! (hdr = snl_finalize_msg(&nw)) || !snl_send_message(&ss, hdr)) { in delete_nl()
435 snl_free(&ss); in delete_nl()
440 snl_read_reply_code(&ss, hdr->nlmsg_seq, &e); in delete_nl()
468 snl_free(&ss); in delete_nl()
477 struct snl_state ss = {}; in set_nl() local
480 nl_init_socket(&ss); in set_nl()
482 ifindex = fix_ifindex(&ss, ifindex, dst); in set_nl()
485 snl_free(&ss); in set_nl()
489 snl_init_writer(&ss, &nw); in set_nl()
507 if (! (hdr = snl_finalize_msg(&nw)) || !snl_send_message(&ss, hdr)) { in set_nl()
508 snl_free(&ss); in set_nl()
513 snl_read_reply_code(&ss, hdr->nlmsg_seq, &e); in set_nl()
520 snl_free(&ss); in set_nl()