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

Function vlan_create

tools/ifconfig/ifvlan.c:157–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157static void
158vlan_create(int s, struct ifreq *ifr)
159{
160 vlan_parse_ethervid(ifr->ifr_name);
161
162 if (params.vlr_tag != NOTAG || params.vlr_parent[0] != '\0') {
163 /*
164 * One or both parameters were specified, make sure both.
165 */
166 if (params.vlr_tag == NOTAG)
167 errx(1, "must specify a tag for vlan create");
168 if (params.vlr_parent[0] == '\0')
169 errx(1, "must specify a parent device for vlan create");
170 ifr->ifr_data = (caddr_t) &params;
171#ifdef FSTACK
172 size_t offset = (char *)&(ifr->ifr_data) - (char *)ifr;
173 size_t clen = sizeof(params);
174 if (ioctl_va(s, SIOCIFCREATE2, ifr, 3, offset, ifr->ifr_data, clen) < 0)
175 err(1, "SIOCIFCREATE2");
176 return;
177#endif
178 }
179 ioctl_ifcreate(s, ifr);
180}
181
182static void
183vlan_cb(int s, void *arg)

Callers

nothing calls this directly

Calls 3

vlan_parse_ethervidFunction · 0.85
ioctl_vaFunction · 0.85
ioctl_ifcreateFunction · 0.85

Tested by

no test coverage detected