MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rt_dumpentry_ddb

Function rt_dumpentry_ddb

freebsd/net/route/route_ddb.c:129–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129static int
130rt_dumpentry_ddb(struct radix_node *rn, void *arg __unused)
131{
132 struct sockaddr_storage ss;
133 struct rtentry *rt;
134 struct nhop_object *nh;
135 int flags, idx;
136
137 /* If RNTORT is important, put it in a header. */
138 rt = (void *)rn;
139 nh = (struct nhop_object *)rt->rt_nhop;
140
141 rt_dumpaddr_ddb("dst", rt_key(rt));
142 rt_dumpaddr_ddb("gateway", &rt->rt_nhop->gw_sa);
143 rt_dumpaddr_ddb("netmask", rtsock_fix_netmask(rt_key(rt), rt_mask(rt),
144 &ss));
145 if ((nh->nh_ifp->if_flags & IFF_DYING) == 0) {
146 rt_dumpaddr_ddb("ifp", nh->nh_ifp->if_addr->ifa_addr);
147 rt_dumpaddr_ddb("ifa", nh->nh_ifa->ifa_addr);
148 }
149
150 db_printf("flags ");
151 flags = rt->rte_flags | nhop_get_rtflags(nh);
152 if (flags == 0)
153 db_printf("none");
154
155 while ((idx = ffs(flags)) > 0) {
156 idx--;
157
158 db_printf("%s", rt_flag_name(idx));
159 flags &= ~(1ul << idx);
160 if (flags != 0)
161 db_printf(",");
162 }
163
164 db_printf("\n");
165 return (0);
166}
167
168DB_SHOW_COMMAND(routetable, db_show_routetable_cmd)
169{

Callers 1

route_ddb.cFile · 0.85

Calls 6

rt_dumpaddr_ddbFunction · 0.85
db_printfFunction · 0.85
nhop_get_rtflagsFunction · 0.85
rt_flag_nameFunction · 0.85
rtsock_fix_netmaskFunction · 0.50
ffsFunction · 0.50

Tested by

no test coverage detected