Lines Matching defs:rtmsg
324 } rtmsg;
326 (void) memset(&rtmsg, 0, sizeof (rtmsg));
327 rtmsg.rm_mh.rtm_version = RTM_VERSION;
328 rtmsg.rm_mh.rtm_msglen = sizeof (rtmsg);
329 rtmsg.rm_mh.rtm_type = type;
330 rtmsg.rm_mh.rtm_pid = getpid();
331 rtmsg.rm_mh.rtm_flags = RTF_GATEWAY | RTF_STATIC | flags;
332 rtmsg.rm_mh.rtm_addrs = RTA_GATEWAY | RTA_DST | RTA_NETMASK | RTA_IFP;
334 rtmsg.rm_gw.sin_family = AF_INET;
335 rtmsg.rm_gw.sin_addr = *gateway_nbo;
337 rtmsg.rm_dst.sin_family = AF_INET;
338 rtmsg.rm_dst.sin_addr.s_addr = htonl(INADDR_ANY);
340 rtmsg.rm_mask.sin_family = AF_INET;
341 rtmsg.rm_mask.sin_addr.s_addr = htonl(0);
343 rtmsg.rm_ifp.sdl_family = AF_LINK;
344 rtmsg.rm_ifp.sdl_index = ifindex;
346 return (write(rtsock_fd, &rtmsg, sizeof (rtmsg)) == sizeof (rtmsg));