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

Function rt_ifmsg

freebsd/net/rtsock.c:1810–1829  ·  view source on GitHub ↗

* This routine is called to generate a message from the routing * socket indicating that the status of a network interface has changed. */

Source from the content-addressed store, hash-verified

1808 * socket indicating that the status of a network interface has changed.
1809 */
1810void
1811rt_ifmsg(struct ifnet *ifp)
1812{
1813 struct if_msghdr *ifm;
1814 struct mbuf *m;
1815 struct rt_addrinfo info;
1816
1817 if (V_route_cb.any_count == 0)
1818 return;
1819 bzero((caddr_t)&info, sizeof(info));
1820 m = rtsock_msg_mbuf(RTM_IFINFO, &info);
1821 if (m == NULL)
1822 return;
1823 ifm = mtod(m, struct if_msghdr *);
1824 ifm->ifm_index = ifp->if_index;
1825 ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags;
1826 if_data_copy(ifp, &ifm->ifm_data);
1827 ifm->ifm_addrs = 0;
1828 rt_dispatch(m, AF_UNSPEC);
1829}
1830
1831/*
1832 * Announce interface address arrival/withdraw.

Callers 6

if_unrouteFunction · 0.85
if_routeFunction · 0.85
do_link_state_changeFunction · 0.85
ifhwioctlFunction · 0.85
if_setflagFunction · 0.85

Calls 4

bzeroFunction · 0.85
rtsock_msg_mbufFunction · 0.85
if_data_copyFunction · 0.85
rt_dispatchFunction · 0.85

Tested by

no test coverage detected