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

Function setifcap

tools/ifconfig/ifconfig.c:1323–1345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1321}
1322
1323void
1324setifcap(const char *vname, int value, int s, const struct afswtch *afp)
1325{
1326 int flags;
1327
1328 if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) < 0) {
1329 Perror("ioctl (SIOCGIFCAP)");
1330#ifdef FSTACK
1331 ff_ipc_exit();
1332#endif
1333 exit(1);
1334 }
1335 flags = ifr.ifr_curcap;
1336 if (value < 0) {
1337 value = -value;
1338 flags &= ~value;
1339 } else
1340 flags |= value;
1341 flags &= ifr.ifr_reqcap;
1342 ifr.ifr_reqcap = flags;
1343 if (ioctl(s, SIOCSIFCAP, (caddr_t)&ifr) < 0)
1344 Perror(vname);
1345}
1346
1347static void
1348setifmetric(const char *val, int dummy __unused, int s,

Callers

nothing calls this directly

Calls 3

PerrorFunction · 0.85
ff_ipc_exitFunction · 0.85
ioctlFunction · 0.50

Tested by

no test coverage detected