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

Function altq_set_enabled

tools/ipfw/altq.c:53–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 TAILQ_HEAD_INITIALIZER(altq_entries);
52
53void
54altq_set_enabled(int enabled)
55{
56 int pffd;
57
58 pffd = open("/dev/pf", O_RDWR);
59 if (pffd == -1)
60 err(EX_UNAVAILABLE,
61 "altq support opening pf(4) control device");
62 if (enabled) {
63 if (ioctl(pffd, DIOCSTARTALTQ) != 0 && errno != EEXIST)
64 err(EX_UNAVAILABLE, "enabling altq");
65 } else {
66 if (ioctl(pffd, DIOCSTOPALTQ) != 0 && errno != ENOENT)
67 err(EX_UNAVAILABLE, "disabling altq");
68 }
69 close(pffd);
70}
71
72static void
73altq_fetch(void)

Callers 1

ipfw_sysctl_handlerFunction · 0.85

Calls 2

ioctlFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected