Changeset View
Changeset View
Standalone View
Standalone View
sbin/pfctl/pfctl.c
Show First 20 Lines • Show All 1,014 Lines • ▼ Show 20 Lines | printf(" [ Evaluations: %-8llu Packets: %-8llu " | ||||
rule->packets[1]), | rule->packets[1]), | ||||
(unsigned long long)(rule->bytes[0] + | (unsigned long long)(rule->bytes[0] + | ||||
rule->bytes[1])); | rule->bytes[1])); | ||||
} | } | ||||
if (opts & PF_OPT_VERBOSE2) { | if (opts & PF_OPT_VERBOSE2) { | ||||
char timestr[30]; | char timestr[30]; | ||||
if (rule->last_active_timestamp != 0) { | if (rule->last_active_timestamp != 0) { | ||||
time_t last_active = rule->last_active_timestamp; | bcopy(ctime(&rule->last_active_timestamp), timestr, | ||||
bcopy(ctime(&last_active), timestr, sizeof(timestr)); | sizeof(timestr)); | ||||
*strchr(timestr, '\n') = '\0'; | *strchr(timestr, '\n') = '\0'; | ||||
} else { | } else { | ||||
snprintf(timestr, sizeof(timestr), "N/A"); | snprintf(timestr, sizeof(timestr), "N/A"); | ||||
} | } | ||||
printf(" [ Last Active Time: %s ]\n", timestr); | printf(" [ Last Active Time: %s ]\n", timestr); | ||||
} | } | ||||
} | } | ||||
Show All 32 Lines | if (!(opts & PF_OPT_DEBUG)) | ||||
printf(" [ Inserted: uid %u pid %u " | printf(" [ Inserted: uid %u pid %u " | ||||
"State Creations: %-6ju]\n", | "State Creations: %-6ju]\n", | ||||
(unsigned)rule->cuid, (unsigned)rule->cpid, | (unsigned)rule->cuid, (unsigned)rule->cpid, | ||||
(uintmax_t)rule->states_tot); | (uintmax_t)rule->states_tot); | ||||
} | } | ||||
if (opts & PF_OPT_VERBOSE2) { | if (opts & PF_OPT_VERBOSE2) { | ||||
char timestr[30]; | char timestr[30]; | ||||
if (rule->last_active_timestamp != 0) { | if (rule->last_active_timestamp != 0) { | ||||
time_t last_active = rule->last_active_timestamp; | bcopy(ctime(&rule->last_active_timestamp), timestr, | ||||
bcopy(ctime(&last_active), timestr, sizeof(timestr)); | sizeof(timestr)); | ||||
*strchr(timestr, '\n') = '\0'; | *strchr(timestr, '\n') = '\0'; | ||||
} else { | } else { | ||||
snprintf(timestr, sizeof(timestr), "N/A"); | snprintf(timestr, sizeof(timestr), "N/A"); | ||||
} | } | ||||
printf(" [ Last Active Time: %s ]\n", timestr); | printf(" [ Last Active Time: %s ]\n", timestr); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,131 Lines • Show Last 20 Lines |