MCPcopy Index your code
hub / github.com/F-Stack/f-stack / nd6_status

Function nd6_status

tools/ifconfig/af_nd6.c:169–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void
170nd6_status(int s)
171{
172 struct in6_ndireq nd;
173 int s6;
174 int error;
175 int isdefif;
176
177 memset(&nd, 0, sizeof(nd));
178 strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
179 if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
180 if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
181 warn("socket(AF_INET6, SOCK_DGRAM)");
182 return;
183 }
184
185#ifndef FSTACK
186 error = ioctl(s6, SIOCGIFINFO_IN6, &nd);
187#else
188 error = ioctl_va(s, SIOCGIFINFO_IN6, (caddr_t)&nd, 1, AF_INET6);
189#endif
190 if (error) {
191 if (errno != EPFNOSUPPORT)
192 warn("ioctl(SIOCGIFINFO_IN6)");
193 close(s6);
194 return;
195 }
196 isdefif = isnd6defif(s6);
197 close(s6);
198 if (nd.ndi.flags == 0 && !isdefif)
199 return;
200 printb("\tnd6 options",
201 (unsigned int)(nd.ndi.flags | (isdefif << 15)), ND6BITS);
202 putchar('\n');
203}

Callers

nothing calls this directly

Calls 9

memsetFunction · 0.85
ioctl_vaFunction · 0.85
isnd6defifFunction · 0.85
putcharFunction · 0.85
printbFunction · 0.70
strlcpyFunction · 0.50
socketClass · 0.50
ioctlFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected