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

Function setifgrekey

tools/ifconfig/ifgre.c:89–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89static void
90setifgrekey(const char *val, int dummy __unused, int s,
91 const struct afswtch *afp)
92{
93 uint32_t grekey = strtol(val, NULL, 0);
94
95 strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
96 ifr.ifr_data = (caddr_t)&grekey;
97#ifndef FSTACK
98 if (ioctl(s, GRESKEY, (caddr_t)&ifr) < 0)
99#else
100 size_t offset = (char *)&(ifr.ifr_data) - (char *)&(ifr);
101 size_t clen = sizeof(uint32_t);
102 if (ioctl_va(s, GRESKEY, (caddr_t)&ifr, 3, offset, ifr.ifr_data, clen) < 0)
103#endif
104 warn("ioctl (set grekey)");
105}
106
107static void
108setifgreport(const char *val, int dummy __unused, int s,

Callers

nothing calls this directly

Calls 4

strtolFunction · 0.85
ioctl_vaFunction · 0.85
strlcpyFunction · 0.50
ioctlFunction · 0.50

Tested by

no test coverage detected