Lines Matching defs:rt
303 struct rtentry *rt = NULL;
502 rt = saved_nrt;
517 rt = rt_lookup(TRUE, dst, netmask, rnh, ifscope);
518 if (rt == NULL)
526 dst = rt_key(rt);
527 gate = rt->rt_gateway;
528 netmask = rt_mask(rt);
529 genmask = rt->rt_genmask;
531 ifp = rt->rt_ifp;
537 ifaaddr = rt->rt_ifa->ifa_addr;
557 rtm->rtm_flags = rt->rt_flags;
558 rtm->rtm_rmx = rt->rt_rmx;
564 if (gate && (error = rt_setgate(rt, rt_key(rt), gate)))
574 if ((rt->rt_flags & RTF_GATEWAY) && !gate)
575 gate = rt->rt_gateway;
583 rt_setif(rt, ifpaddr, ifaaddr, gate,
588 &rt->rt_rmx);
591 if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest)
592 rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, gate);
595 rt->rt_genmask = genmask;
600 rt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
601 rt->rt_rmx.rmx_locks |=
617 if (rt)
618 rtfree_locked(rt);
688 rt_setif(struct rtentry *rt, struct sockaddr *Ifpaddr, struct sockaddr *Ifaaddr,
727 (ifa = ifa_ifwithroute_scoped_locked(rt->rt_flags,
728 rt_key(rt), Gate, ifscope))) {
733 struct ifaddr *oifa = rt->rt_ifa;
736 oifa->ifa_rtrequest(RTM_DELETE, rt, Gate);
737 rtsetifa(rt, ifa);
738 rt->rt_ifp = ifp;
743 if (rt_inet_default(rt, rt_key(rt)))
744 set_primary_ifscope(rt->rt_ifp->if_index);
745 rt->rt_rmx.rmx_mtu = ifp->if_mtu;
746 if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest)
747 rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, Gate);
757 if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest)
758 rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, Gate);
1025 rt_newaddrmsg(int cmd, struct ifaddr *ifa, int error, struct rtentry *rt)
1058 if (rt == 0)
1060 netmask = rt_mask(rt);
1061 dst = sa = rt_key(rt);
1062 gate = rt->rt_gateway;
1067 rtm->rtm_flags |= rt->rt_flags;
1119 struct rtentry *rt = (struct rtentry *)rn;
1123 if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg))
1126 dst = rt_key(rt);
1127 gate = rt->rt_gateway;
1128 netmask = rt_mask(rt);
1129 genmask = rt->rt_genmask;
1135 rtm->rtm_flags = rt->rt_flags;
1136 rtm->rtm_use = rt->rt_use;
1137 rtm->rtm_rmx = rt->rt_rmx;
1138 rtm->rtm_index = rt->rt_ifp->if_index;
1151 rtm->rtm_flags = rt->rt_flags;
1152 rtm->rtm_use = rt->rt_use;
1153 rtm->rtm_rmx = rt->rt_rmx;
1154 rtm->rtm_index = rt->rt_ifp->if_index;
1155 rtm->rtm_refcnt = rt->rt_refcnt;
1156 if (rt->rt_parent)
1157 rtm->rtm_parentflags = rt->rt_parent->rt_flags;