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

Function ether_str

tools/ndp/ndp.c:873–888  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873static char *
874ether_str(struct sockaddr_dl *sdl)
875{
876 static char hbuf[NI_MAXHOST];
877
878 if (sdl->sdl_alen == ETHER_ADDR_LEN) {
879 strlcpy(hbuf, ether_ntoa((struct ether_addr *)LLADDR(sdl)),
880 sizeof(hbuf));
881 } else if (sdl->sdl_alen) {
882 int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
883 snprintf(hbuf, sizeof(hbuf), "%s", link_ntoa(sdl) + n);
884 } else
885 snprintf(hbuf, sizeof(hbuf), "(incomplete)");
886
887 return(hbuf);
888}
889
890static int
891ndp_ether_aton(char *a, u_char *n)

Callers 1

dumpFunction · 0.85

Calls 3

snprintfFunction · 0.85
link_ntoaFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected