diff options
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r-- | sys/net/rtsock.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index c55d765..88c9cc6 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -595,6 +595,10 @@ rt_msg1(type, rtinfo) len = sizeof(struct if_msghdr); break; + case RTM_IFANNOUNCE: + len = sizeof(struct if_announcemsghdr); + break; + default: len = sizeof(struct rt_msghdr); } @@ -861,6 +865,34 @@ rt_newmaddrmsg(cmd, ifma) } /* + * This is called to generate routing socket messages indicating + * network interface arrival and departure. + */ +void +rt_ifannouncemsg(ifp, what) + struct ifnet *ifp; + int what; +{ + struct if_announcemsghdr *ifan; + struct mbuf *m; + struct rt_addrinfo info; + + if (route_cb.any_count == 0) + return; + bzero((caddr_t)&info, sizeof(info)); + m = rt_msg1(RTM_IFANNOUNCE, &info); + if (m == NULL) + return; + ifan = mtod(m, struct if_announcemsghdr *); + ifan->ifan_index = ifp->if_index; + snprintf(ifan->ifan_name, sizeof(ifan->ifan_name), + "%s%d", ifp->if_name, ifp->if_unit); + ifan->ifan_what = what; + route_proto.sp_protocol = 0; + raw_input(m, &route_proto, &route_src, &route_dst); + } + +/* * This is used in dumping the kernel table via sysctl(). */ int |