Lines Matching refs:rtm
372 struct rt_msghdr rtm; in test93_route_cmd() local
378 memset(&rtm, 0, sizeof(rtm)); in test93_route_cmd()
379 rtm.rtm_version = RTM_VERSION; in test93_route_cmd()
380 rtm.rtm_type = cmd; in test93_route_cmd()
381 rtm.rtm_flags = flags; in test93_route_cmd()
382 rtm.rtm_addrs = RTA_DST | RTA_NETMASK; in test93_route_cmd()
383 rtm.rtm_seq = ++seq; in test93_route_cmd()
386 iov[iovlen].iov_base = &rtm; in test93_route_cmd()
387 iov[iovlen++].iov_len = sizeof(rtm); in test93_route_cmd()
402 rtm.rtm_addrs |= RTA_GATEWAY; in test93_route_cmd()
448 rtm.rtm_addrs |= RTA_IFP; in test93_route_cmd()
460 rtm.rtm_msglen += iov[i].iov_len; in test93_route_cmd()
463 if (r != rtm.rtm_msglen && r != -1) e(0); in test93_route_cmd()
470 rtm.rtm_seq = 0; in test93_route_cmd()
472 iov[0].iov_base = &rtm; in test93_route_cmd()
473 iov[0].iov_len = sizeof(rtm); in test93_route_cmd()
476 } while (rtm.rtm_pid != getpid() || rtm.rtm_seq != seq); in test93_route_cmd()
479 if (rtm.rtm_errno != err) e(0); in test93_route_cmd()
480 if (rtm.rtm_flags & RTF_DONE) e(0); in test93_route_cmd()
482 if (rtm.rtm_errno != 0) e(0); in test93_route_cmd()
483 if (!(rtm.rtm_flags & RTF_DONE)) e(0); in test93_route_cmd()