Changeset View
Changeset View
Standalone View
Standalone View
sbin/pfctl/pfctl_parser.c
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | ||||
#include <netinet/ip.h> | #include <netinet/ip.h> | ||||
#include <netinet/ip_icmp.h> | #include <netinet/ip_icmp.h> | ||||
#include <netinet/icmp6.h> | #include <netinet/icmp6.h> | ||||
#include <net/pfvar.h> | #include <net/pfvar.h> | ||||
#include <arpa/inet.h> | #include <arpa/inet.h> | ||||
#include <assert.h> | |||||
#include <search.h> | #include <search.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <netdb.h> | #include <netdb.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
▲ Show 20 Lines • Show All 552 Lines • ▼ Show 20 Lines | TAILQ_FOREACH(c, &s->lcounters, entry) { | ||||
if (runtime > 0) | if (runtime > 0) | ||||
printf("%14.1f/s\n", | printf("%14.1f/s\n", | ||||
(double)c->counter / (double)runtime); | (double)c->counter / (double)runtime); | ||||
else | else | ||||
printf("%14s\n", ""); | printf("%14s\n", ""); | ||||
} | } | ||||
printf("Syncookies\n"); | printf("Syncookies\n"); | ||||
assert(cookies->mode <= PFCTL_SYNCOOKIES_ADAPTIVE); | |||||
printf(" %-25s %s\n", "mode", | printf(" %-25s %s\n", "mode", | ||||
cookies->mode == PFCTL_SYNCOOKIES_NEVER ? | PFCTL_SYNCOOKIES_MODE_NAMES[cookies->mode]); | ||||
"never" : "always"); | |||||
} | } | ||||
} | } | ||||
void | void | ||||
print_running(struct pfctl_status *status) | print_running(struct pfctl_status *status) | ||||
{ | { | ||||
printf("%s\n", status->running ? "Enabled" : "Disabled"); | printf("%s\n", status->running ? "Enabled" : "Disabled"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,253 Lines • Show Last 20 Lines |