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

Function next_ifma

tools/netstat/if.c:252–266  ·  view source on GitHub ↗

* Find next multiaddr for a given interface name. */

Source from the content-addressed store, hash-verified

250 * Find next multiaddr for a given interface name.
251 */
252static struct ifmaddrs *
253next_ifma(struct ifmaddrs *ifma, const char *name, const sa_family_t family)
254{
255
256 for(; ifma != NULL; ifma = ifma->ifma_next) {
257 struct sockaddr_dl *sdl;
258
259 sdl = (struct sockaddr_dl *)ifma->ifma_name;
260 if (ifma->ifma_addr->sa_family == family &&
261 strcmp(sdl->sdl_data, name) == 0)
262 break;
263 }
264
265 return (ifma);
266}
267
268/*
269 * Print a description of the network interfaces.

Callers 1

intprFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected