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

Function vxlan_ioctl

freebsd/net/if_vxlan.c:2323–2377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2321}
2322
2323static int
2324vxlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
2325{
2326 struct vxlan_softc *sc;
2327 struct ifreq *ifr;
2328 struct ifdrv *ifd;
2329 int error;
2330
2331 sc = ifp->if_softc;
2332 ifr = (struct ifreq *) data;
2333 ifd = (struct ifdrv *) data;
2334
2335 error = 0;
2336
2337 switch (cmd) {
2338 case SIOCADDMULTI:
2339 case SIOCDELMULTI:
2340 break;
2341
2342 case SIOCGDRVSPEC:
2343 case SIOCSDRVSPEC:
2344 error = vxlan_ioctl_drvspec(sc, ifd, cmd == SIOCGDRVSPEC);
2345 break;
2346
2347 case SIOCSIFFLAGS:
2348 error = vxlan_ioctl_ifflags(sc);
2349 break;
2350
2351 case SIOCSIFMEDIA:
2352 case SIOCGIFMEDIA:
2353 error = ifmedia_ioctl(ifp, ifr, &sc->vxl_media, cmd);
2354 break;
2355
2356 case SIOCSIFMTU:
2357 if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > VXLAN_MAX_MTU)
2358 error = EINVAL;
2359 else
2360 ifp->if_mtu = ifr->ifr_mtu;
2361 break;
2362
2363 case SIOCSIFCAP:
2364 VXLAN_WLOCK(sc);
2365 error = vxlan_set_reqcap(sc, ifp, ifr->ifr_reqcap);
2366 if (error == 0)
2367 vxlan_set_hwcaps(sc);
2368 VXLAN_WUNLOCK(sc);
2369 break;
2370
2371 default:
2372 error = ether_ioctl(ifp, cmd, data);
2373 break;
2374 }
2375
2376 return (error);
2377}
2378
2379#if defined(INET) || defined(INET6)
2380static uint16_t

Callers

nothing calls this directly

Calls 6

vxlan_ioctl_drvspecFunction · 0.85
vxlan_ioctl_ifflagsFunction · 0.85
ifmedia_ioctlFunction · 0.85
vxlan_set_reqcapFunction · 0.85
vxlan_set_hwcapsFunction · 0.85
ether_ioctlFunction · 0.85

Tested by

no test coverage detected