-/* $OpenBSD: pftop.c,v 1.25 2014/04/26 11:27:23 sthen Exp $ */
+/* $OpenBSD: pftop.c,v 1.26 2014/04/26 11:28:49 sthen Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
return sortdir;
if (e2 == NULL)
return -sortdir;
-
+
if (e2->rate > e1 -> rate)
return sortdir;
if (e2->rate < e1 -> rate)
return -sortdir;
if (e1 == NULL || e2 == NULL)
return 0;
-
+
if (e2->peak > e1 -> peak)
return sortdir;
if (e2->peak < e1 -> peak)
return -1;
break;
}
-
+
return 0;
}
if (s1->key[side].af < s2->key[side].af)
return -sortdir;
- ii = io = 0;
+ ii = io = 0;
if (dir == PF_OUT) /* looking for source addr */
io = 1;
if (s1->key[side].af < s2->key[side].af)
return -sortdir;
- ii = io = 0;
+ ii = io = 0;
if (dir == PF_OUT) /* looking for source addr */
io = 1;
void
tb_print_addr(struct pf_addr * addr, struct pf_addr * mask, int af)
{
- switch (af) {
- case AF_INET: {
+ switch (af) {
+ case AF_INET: {
tbprintf("%s", inetname(addr->v4));
break;
- }
- case AF_INET6: {
+ }
+ case AF_INET6: {
tbprintf("%s", inet6name(&addr->v6));
break;
- }
+ }
}
if (mask != NULL) {
unsigned int s1, unsigned int s2)
{
int len;
-
+
if (fld == NULL)
return;
len = fld->width;
if (len < 1)
return;
-
+
tb_start();
if (proto == IPPROTO_TCP) {
tb_print_port(src->port_op, src->port[0],
src->port[1],
proto == IPPROTO_TCP ? "tcp" : "udp");
-
+
tbprintf("to ");
if (PT_NOROUTE(dst))
tbprintf("no-route ");
print_rules(void)
{
u_int32_t n, count = 0;
-
+
for (n = dispstart; n < num_rules; n++) {
print_rule(rules + n);
count ++;