Changeset View
Changeset View
Standalone View
Standalone View
sbin/pfctl/pfctl_parser.c
Show First 20 Lines • Show All 491 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
const char * const pf_reasons[PFRES_MAX+1] = PFRES_NAMES; | const char * const pf_reasons[PFRES_MAX+1] = PFRES_NAMES; | ||||
const char * const pf_lcounters[LCNT_MAX+1] = LCNT_NAMES; | const char * const pf_lcounters[LCNT_MAX+1] = LCNT_NAMES; | ||||
const char * const pf_fcounters[FCNT_MAX+1] = FCNT_NAMES; | const char * const pf_fcounters[FCNT_MAX+1] = FCNT_NAMES; | ||||
const char * const pf_scounters[FCNT_MAX+1] = FCNT_NAMES; | const char * const pf_scounters[FCNT_MAX+1] = FCNT_NAMES; | ||||
void | void | ||||
print_status(struct pf_status *s, int opts) | print_status(struct pf_status *s, struct pfctl_syncookies *cookies, int opts) | ||||
{ | { | ||||
char statline[80], *running; | char statline[80], *running; | ||||
time_t runtime; | time_t runtime; | ||||
int i; | int i; | ||||
char buf[PF_MD5_DIGEST_LENGTH * 2 + 1]; | char buf[PF_MD5_DIGEST_LENGTH * 2 + 1]; | ||||
static const char hex[] = "0123456789abcdef"; | static const char hex[] = "0123456789abcdef"; | ||||
runtime = time(NULL) - s->since; | runtime = time(NULL) - s->since; | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | #else | ||||
s->lcounters[i]); | s->lcounters[i]); | ||||
#endif | #endif | ||||
if (runtime > 0) | if (runtime > 0) | ||||
printf("%14.1f/s\n", | printf("%14.1f/s\n", | ||||
(double)s->lcounters[i] / (double)runtime); | (double)s->lcounters[i] / (double)runtime); | ||||
else | else | ||||
printf("%14s\n", ""); | printf("%14s\n", ""); | ||||
} | } | ||||
printf("Syncookies\n"); | |||||
printf(" %-25s %s\n", "mode", | |||||
cookies->mode == PFCTL_SYNCOOKIES_NEVER ? | |||||
"never" : "always"); | |||||
} | } | ||||
} | } | ||||
void | void | ||||
print_running(struct pf_status *status) | print_running(struct pf_status *status) | ||||
{ | { | ||||
printf("%s\n", status->running ? "Enabled" : "Disabled"); | printf("%s\n", status->running ? "Enabled" : "Disabled"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,244 Lines • Show Last 20 Lines |