| 51 | TAILQ_HEAD_INITIALIZER(altq_entries); |
| 52 | |
| 53 | void |
| 54 | altq_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 | |
| 72 | static void |
| 73 | altq_fetch(void) |
no test coverage detected