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

Function do_cmd

tools/ifconfig/ifvxlan.c:81–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81static int
82do_cmd(int sock, u_long op, void *arg, size_t argsize, int set)
83{
84 struct ifdrv ifd;
85
86 bzero(&ifd, sizeof(ifd));
87
88 strlcpy(ifd.ifd_name, ifr.ifr_name, sizeof(ifd.ifd_name));
89 ifd.ifd_cmd = op;
90 ifd.ifd_len = argsize;
91 ifd.ifd_data = arg;
92
93#ifndef FSTACK
94 return (ioctl(sock, set ? SIOCSDRVSPEC : SIOCGDRVSPEC, &ifd));
95#else
96 size_t offset = (char *)&(ifd.ifd_data) - (char *)&(ifd);
97 return (ioctl_va(sock, set ? SIOCSDRVSPEC : SIOCGDRVSPEC, &ifd,
98 3, offset, ifd.ifd_data, argsize));
99#endif
100}
101
102static int
103vxlan_exists(int sock)

Callers 4

vxlan_existsFunction · 0.70
vxlan_statusFunction · 0.70
ifvxlan.cFile · 0.70
setvxlan_flushFunction · 0.70

Calls 4

bzeroFunction · 0.85
ioctl_vaFunction · 0.85
strlcpyFunction · 0.50
ioctlFunction · 0.50

Tested by

no test coverage detected