• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iproute2/lib/

Lines Matching defs:rth

28 void rtnl_close(struct rtnl_handle *rth)
30 close(rth->fd);
33 int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions,
40 memset(rth, 0, sizeof(rth));
42 rth->fd = socket(AF_NETLINK, SOCK_RAW, protocol);
43 if (rth->fd < 0) {
48 if (setsockopt(rth->fd,SOL_SOCKET,SO_SNDBUF,&sndbuf,sizeof(sndbuf)) < 0) {
53 if (setsockopt(rth->fd,SOL_SOCKET,SO_RCVBUF,&rcvbuf,sizeof(rcvbuf)) < 0) {
58 memset(&rth->local, 0, sizeof(rth->local));
59 rth->local.nl_family = AF_NETLINK;
60 rth->local.nl_groups = subscriptions;
62 if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
66 addr_len = sizeof(rth->local);
67 if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
71 if (addr_len != sizeof(rth->local)) {
75 if (rth->local.nl_family != AF_NETLINK) {
76 fprintf(stderr, "Wrong address family %d\n", rth->local.nl_family);
79 rth->seq = time(NULL);
83 int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
85 return rtnl_open_byproto(rth, subscriptions, NETLINK_ROUTE);
88 int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
104 req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
107 return sendto(rth->fd, (void*)&req, sizeof(req), 0,
111 int rtnl_send(struct rtnl_handle *rth, const char *buf, int len)
118 return sendto(rth->fd, buf, len, 0, (struct sockaddr*)&nladdr, sizeof(nladdr));
121 int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len)
143 nlh.nlmsg_seq = rth->dump = ++rth->seq;
145 return sendmsg(rth->fd, &msg, 0);
148 int rtnl_dump_filter(struct rtnl_handle *rth,
170 status = recvmsg(rth->fd, &msg, 0);
189 h->nlmsg_pid != rth->local.nl_pid ||
190 h->nlmsg_seq != rth->dump) {