Lines Matching +full:use +full:- +full:rtm

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
7 * Redistribution and use in source and binary forms, with or without
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 #include "un-namespace.h"
44 #define SALIGN (sizeof(long) - 1)
45 #define SA_RLEN(sa) ((sa)->sa_len ? (((sa)->sa_len + SALIGN) & ~SALIGN) : \
66 struct rt_msghdr *rtm; in getifmaddrs() local
77 return (-1); in getifmaddrs()
79 return (-1); in getifmaddrs()
83 return (-1); in getifmaddrs()
90 for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { in getifmaddrs()
91 rtm = (struct rt_msghdr *)(void *)next; in getifmaddrs()
92 if (rtm->rtm_version != RTM_VERSION) in getifmaddrs()
94 switch (rtm->rtm_type) { in getifmaddrs()
96 ifmam = (struct ifma_msghdr *)(void *)rtm; in getifmaddrs()
97 if ((ifmam->ifmam_addrs & RTA_IFA) == 0) in getifmaddrs()
102 if ((RTA_MASKS & ifmam->ifmam_addrs & in getifmaddrs()
117 return (-1); in getifmaddrs()
126 for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { in getifmaddrs()
127 rtm = (struct rt_msghdr *)(void *)next; in getifmaddrs()
128 if (rtm->rtm_version != RTM_VERSION) in getifmaddrs()
131 switch (rtm->rtm_type) { in getifmaddrs()
133 ifmam = (struct ifma_msghdr *)(void *)rtm; in getifmaddrs()
134 if ((ifmam->ifmam_addrs & RTA_IFA) == 0) in getifmaddrs()
139 if ((RTA_MASKS & ifmam->ifmam_addrs & in getifmaddrs()
146 ift->ifma_lladdr = in getifmaddrs()
153 ift->ifma_name = in getifmaddrs()
160 ift->ifma_addr = in getifmaddrs()
172 ift->ifma_next = ift + 1; in getifmaddrs()
173 ift = ift->ifma_next; in getifmaddrs()
181 ift--; in getifmaddrs()
182 ift->ifma_next = NULL; in getifmaddrs()