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

Function setifgreport

tools/ifconfig/ifgre.c:107–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107static void
108setifgreport(const char *val, int dummy __unused, int s,
109 const struct afswtch *afp)
110{
111 uint32_t udpport = strtol(val, NULL, 0);
112
113 strlcpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
114 ifr.ifr_data = (caddr_t)&udpport;
115#ifndef FSTACK
116 if (ioctl(s, GRESPORT, (caddr_t)&ifr) < 0)
117#else
118 size_t offset = (char *)&(ifr.ifr_data) - (char *)&(ifr);
119 size_t clen = sizeof(uint32_t);
120 if (ioctl_va(s, GRESPORT, (caddr_t)&ifr, 3, offset, ifr.ifr_data, clen) < 0)
121#endif
122 warn("ioctl (set udpport)");
123}
124
125static void
126setifgreopts(const char *val, int d, int s, const struct afswtch *afp)

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