Home
last modified time | relevance | path

Searched refs:rth (Results 1 – 10 of 10) sorted by relevance

/busybox-1.35.0/networking/libiproute/
Dlibnetlink.h21 extern void xrtnl_open(struct rtnl_handle *rth) FAST_FUNC;
22 #define rtnl_close(rth) (close((rth)->fd)) argument
23 extern void xrtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type) FAST_FUNC;
24 extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len) FAST_FUNC;
25 extern int xrtnl_dump_filter(struct rtnl_handle *rth,
37 int rtnl_send_check(struct rtnl_handle *rth, const void *buf, int len) FAST_FUNC;
39 static ALWAYS_INLINE void rtnl_send(struct rtnl_handle *rth, const void *buf, int len) in rtnl_send() argument
51 xwrite(rth->fd, buf, len); in rtnl_send()
Dlibnetlink.c16 void FAST_FUNC xrtnl_open(struct rtnl_handle *rth/*, unsigned subscriptions*/) in xrtnl_open() argument
18 memset(rth, 0, sizeof(*rth)); in xrtnl_open()
19 rth->fd = xsocket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); in xrtnl_open()
20 rth->local.nl_family = AF_NETLINK; in xrtnl_open()
23 xbind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)); in xrtnl_open()
24 bb_getsockname(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)); in xrtnl_open()
34 rth->seq = time(NULL); in xrtnl_open()
37 void FAST_FUNC xrtnl_wilddump_request(struct rtnl_handle *rth, int family, int type) in xrtnl_wilddump_request() argument
48 req.nlh.nlmsg_seq = rth->dump = ++rth->seq; in xrtnl_wilddump_request()
51 rtnl_send(rth, (void*)&req, sizeof(req)); in xrtnl_wilddump_request()
[all …]
Dipneigh.c42 struct rtnl_handle *rth; member
51 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) { in flush_update()
152 fn->nlmsg_seq = ++(G_filter.rth->seq); in print_neigh()
235 struct rtnl_handle rth; in ipneigh_list_or_flush() local
285 xrtnl_open(&rth); in ipneigh_list_or_flush()
286 ll_init_map(&rth); in ipneigh_list_or_flush()
302 G_filter.rth = &rth; in ipneigh_list_or_flush()
305 xrtnl_wilddump_request(&rth, G_filter.family, RTM_GETNEIGH); in ipneigh_list_or_flush()
307 if (xrtnl_dump_filter(&rth, print_neigh, NULL) < 0) { in ipneigh_list_or_flush()
327 if (rtnl_dump_request(&rth, RTM_GETNEIGH, &ndm, sizeof(struct ndmsg)) < 0) { in ipneigh_list_or_flush()
[all …]
Diproute.c36 struct rtnl_handle *rth; member
59 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) { in flush_update()
223 fn->nlmsg_seq = ++G_filter.rth->seq; in print_route()
380 struct rtnl_handle rth; in iproute_modify() local
674 xrtnl_open(&rth);
679 ll_init_map(&rth);
716 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) {
723 static int rtnl_rtcache_request(struct rtnl_handle *rth, int family) in rtnl_rtcache_request() argument
741 req.nlh.nlmsg_seq = rth->dump = ++rth->seq; in rtnl_rtcache_request()
746 return xsendto(rth->fd, (void*)&req, sizeof(req), (struct sockaddr*)&nladdr, sizeof(nladdr)); in rtnl_rtcache_request()
[all …]
Dipaddress.c39 struct rtnl_handle *rth; member
218 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) { in flush_update()
291 fn->nlmsg_seq = ++G_filter.rth->seq; in print_addrinfo()
444 struct rtnl_handle rth; in ipaddr_list_or_flush() local
497 xrtnl_open(&rth); in ipaddr_list_or_flush()
499 xrtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK); in ipaddr_list_or_flush()
500 xrtnl_dump_filter(&rth, store_nlmsg, &linfo); in ipaddr_list_or_flush()
512 G_filter.rth = &rth; in ipaddr_list_or_flush()
515 xrtnl_wilddump_request(&rth, G_filter.family, RTM_GETADDR); in ipaddr_list_or_flush()
517 xrtnl_dump_filter(&rth, print_addrinfo, NULL); in ipaddr_list_or_flush()
[all …]
Dll_map.h8 int ll_init_map(struct rtnl_handle *rth) FAST_FUNC;
Diprule.c190 struct rtnl_handle rth; in iprule_list() local
202 xrtnl_open(&rth); in iprule_list()
204 xrtnl_wilddump_request(&rth, af, RTM_GETRULE); in iprule_list()
205 xrtnl_dump_filter(&rth, print_rule, NULL); in iprule_list()
214 struct rtnl_handle rth; in iprule_modify() local
348 xrtnl_open(&rth); in iprule_modify()
350 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) in iprule_modify()
Dll_map.c173 int FAST_FUNC ll_init_map(struct rtnl_handle *rth) in ll_init_map() argument
175 xrtnl_wilddump_request(rth, AF_UNSPEC, RTM_GETLINK); in ll_init_map()
176 xrtnl_dump_filter(rth, ll_remember_index, NULL); in ll_init_map()
Diplink.c133 struct rtnl_handle rth; in set_master() local
147 xrtnl_open(&rth); in set_master()
151 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) in set_master()
158 struct rtnl_handle rth; in set_netns() local
171 xrtnl_open(&rth); in set_netns()
175 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) in set_netns()
629 struct rtnl_handle rth; in do_add_or_delete() local
684 xrtnl_open(&rth); in do_add_or_delete()
685 ll_init_map(&rth); in do_add_or_delete()
739 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) in do_add_or_delete()
/busybox-1.35.0/networking/
Dtc.c503 struct rtnl_handle rth; in tc_main() local
512 xrtnl_open(&rth); in tc_main()
530 ll_init_map(&rth); in tc_main()
616 if (rtnl_dump_request(&rth, obj == OBJ_qdisc ? RTM_GETQDISC : in tc_main()
621 xrtnl_dump_filter(&rth, obj == OBJ_qdisc ? print_qdisc : in tc_main()
626 rtnl_close(&rth); in tc_main()