-/* $OpenBSD: pfctl.c,v 1.352 2018/02/06 23:47:47 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.353 2018/02/08 02:26:39 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
pfctl_show_status(int dev, int opts)
{
struct pf_status status;
+ struct pfctl_watermarks wats;
+ struct pfioc_synflwats iocwats;
if (ioctl(dev, DIOCGETSTATUS, &status)) {
warn("DIOCGETSTATUS");
return (-1);
}
+ if (ioctl(dev, DIOCGETSYNFLWATS, &iocwats)) {
+ warn("DIOCGETSYNFLWATS");
+ return (-1);
+ }
+ wats.hi = iocwats.hiwat;
+ wats.lo = iocwats.lowat;
if (opts & PF_OPT_SHOWALL)
pfctl_print_title("INFO:");
- print_status(&status, opts);
+ print_status(&status, &wats, opts);
return (0);
}
-/* $OpenBSD: pfctl_parser.c,v 1.318 2017/11/28 16:05:47 bluhm Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.319 2018/02/08 02:26:39 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
const char *pf_scounters[FCNT_MAX+1] = FCNT_NAMES;
void
-print_status(struct pf_status *s, int opts)
+print_status(struct pf_status *s, struct pfctl_watermarks *synflwats, int opts)
{
char statline[80], *running, *debug;
time_t runtime = 0;
printf("%14s\n", "");
}
}
+ if (opts & PF_OPT_VERBOSE) {
+ printf("Adaptive Syncookies Watermarks\n");
+ printf(" %-25s %14d states\n", "start", synflwats->hi);
+ printf(" %-25s %14d states\n", "end", synflwats->lo);
+ }
}
void
-/* $OpenBSD: pfctl_parser.h,v 1.108 2018/02/06 23:47:47 henning Exp $ */
+/* $OpenBSD: pfctl_parser.h,v 1.109 2018/02/08 02:26:39 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
int matches;
};
+struct pfctl_watermarks {
+ u_int32_t hi;
+ u_int32_t lo;
+};
int pfctl_rules(int, char *, int, int, char *, struct pfr_buffer *);
int pfctl_optimize_ruleset(struct pfctl *, struct pf_ruleset *);
void print_src_node(struct pf_src_node *, int);
void print_rule(struct pf_rule *, const char *, int);
void print_tabledef(const char *, int, int, struct node_tinithead *);
-void print_status(struct pf_status *, int);
+void print_status(struct pf_status *, struct pfctl_watermarks *, int);
void print_queuespec(struct pf_queuespec *);
int pfctl_define_table(char *, int, int, const char *, struct pfr_buffer *,