head 1.4; access; symbols pkgsrc-2026Q1:1.4.0.90 pkgsrc-2026Q1-base:1.4 pkgsrc-2025Q4:1.4.0.88 pkgsrc-2025Q4-base:1.4 pkgsrc-2025Q3:1.4.0.86 pkgsrc-2025Q3-base:1.4 pkgsrc-2025Q2:1.4.0.84 pkgsrc-2025Q2-base:1.4 pkgsrc-2025Q1:1.4.0.82 pkgsrc-2025Q1-base:1.4 pkgsrc-2024Q4:1.4.0.80 pkgsrc-2024Q4-base:1.4 pkgsrc-2024Q3:1.4.0.78 pkgsrc-2024Q3-base:1.4 pkgsrc-2024Q2:1.4.0.76 pkgsrc-2024Q2-base:1.4 pkgsrc-2024Q1:1.4.0.74 pkgsrc-2024Q1-base:1.4 pkgsrc-2023Q4:1.4.0.72 pkgsrc-2023Q4-base:1.4 pkgsrc-2023Q3:1.4.0.70 pkgsrc-2023Q3-base:1.4 pkgsrc-2023Q2:1.4.0.68 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.66 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.64 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.62 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.60 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.58 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.56 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.54 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.4.0.52 pkgsrc-2021Q2-base:1.4 pkgsrc-2021Q1:1.4.0.50 pkgsrc-2021Q1-base:1.4 pkgsrc-2020Q4:1.4.0.48 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.46 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.42 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.22 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.4.0.44 pkgsrc-2019Q4-base:1.4 pkgsrc-2019Q3:1.4.0.40 pkgsrc-2019Q3-base:1.4 pkgsrc-2019Q2:1.4.0.38 pkgsrc-2019Q2-base:1.4 pkgsrc-2019Q1:1.4.0.36 pkgsrc-2019Q1-base:1.4 pkgsrc-2018Q4:1.4.0.34 pkgsrc-2018Q4-base:1.4 pkgsrc-2018Q3:1.4.0.32 pkgsrc-2018Q3-base:1.4 pkgsrc-2018Q2:1.4.0.30 pkgsrc-2018Q2-base:1.4 pkgsrc-2018Q1:1.4.0.28 pkgsrc-2018Q1-base:1.4 pkgsrc-2017Q4:1.4.0.26 pkgsrc-2017Q4-base:1.4 pkgsrc-2017Q3:1.4.0.24 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.20 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.18 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.4.0.16 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.14 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.12 pkgsrc-2016Q2-base:1.4 pkgsrc-2016Q1:1.4.0.10 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.8 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.6 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.4 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.2 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.3.0.32 pkgsrc-2014Q4-base:1.3 pkgsrc-2014Q3:1.3.0.30 pkgsrc-2014Q3-base:1.3 pkgsrc-2014Q2:1.3.0.28 pkgsrc-2014Q2-base:1.3 pkgsrc-2014Q1:1.3.0.26 pkgsrc-2014Q1-base:1.3 pkgsrc-2013Q4:1.3.0.24 pkgsrc-2013Q4-base:1.3 pkgsrc-2013Q3:1.3.0.22 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.3.0.20 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.18 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.3.0.16 pkgsrc-2012Q4-base:1.3 pkgsrc-2012Q3:1.3.0.14 pkgsrc-2012Q3-base:1.3 pkgsrc-2012Q2:1.3.0.12 pkgsrc-2012Q2-base:1.3 pkgsrc-2012Q1:1.3.0.10 pkgsrc-2012Q1-base:1.3 pkgsrc-2011Q4:1.3.0.8 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.6 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.4 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.2 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.2.0.4 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.2.0.2 pkgsrc-2010Q3-base:1.2 pkgsrc-2010Q2:1.1.0.22 pkgsrc-2010Q2-base:1.1 pkgsrc-2010Q1:1.1.0.20 pkgsrc-2010Q1-base:1.1 pkgsrc-2009Q4:1.1.0.18 pkgsrc-2009Q4-base:1.1 pkgsrc-2009Q3:1.1.0.16 pkgsrc-2009Q3-base:1.1 pkgsrc-2009Q2:1.1.0.14 pkgsrc-2009Q2-base:1.1 pkgsrc-2009Q1:1.1.0.12 pkgsrc-2009Q1-base:1.1 pkgsrc-2008Q4:1.1.0.10 pkgsrc-2008Q4-base:1.1 pkgsrc-2008Q3:1.1.0.8 pkgsrc-2008Q3-base:1.1 cube-native-xorg:1.1.0.6 cube-native-xorg-base:1.1 pkgsrc-2008Q2:1.1.0.4 pkgsrc-2008Q2-base:1.1 cwrapper:1.1.0.2; locks; strict; comment @# @; 1.4 date 2015.01.14.20.39.42; author rumko; state Exp; branches; next 1.3; commitid wRuoyQBTwzZ0826y; 1.3 date 2011.02.09.22.51.38; author rumko; state Exp; branches; next 1.2; 1.2 date 2010.09.18.20.48.23; author wiz; state Exp; branches; next 1.1; 1.1 date 2008.06.15.14.09.04; author peter; state Exp; branches; next ; desc @@ 1.4 log @sysutils/pftop: fix build on fbsd >= 10 Ok@@ wiz @ text @$NetBSD: patch-ah,v 1.3 2011/02/09 22:51:38 rumko Exp $ $OpenBSD: patch-sf-gencode_c,v 1.1 2008/06/13 00:38:12 canacar Exp $ * DragonFly and FreeBSD compatibility * Patches to support PF > 4.1 taken from OpenBSD's ports. --- sf-gencode.c.orig 2007-11-07 06:34:18.000000000 +0000 +++ sf-gencode.c @@@@ -32,8 +32,12 @@@@ #include #include -#include +#ifdef __DragonFly__ +#include +#include +#else #include +#endif /* !__DragonFly__ */ #include #include @@@@ -44,7 +48,7 @@@@ #define INET6 -#include +#include "pcap-int.h" #include #include "sf-gencode.h" @@@@ -60,7 +64,11 @@@@ static jmp_buf top_ctx; static char sf_errbuf[PFTOP_ERRBUF_SIZE]; /* VARARGS */ +#if defined(__DragonFly__) || defined(__FreeBSD__) +void +#else __dead void +#endif sf_error(const char *fmt, ...) { va_list ap; @@@@ -474,6 +482,106 @@@@ gen_proto(int proto) (bpf_int32)proto)); } +#ifdef HAVE_PFSYNC_KEY +static struct block * +gen_hostop(bpf_u_int32 addr, bpf_u_int32 mask, int dir) +{ + struct block *b0, *b1, *b2, *bi, *bo; + const static int isrc_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[0].v4); + const static int osrc_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[1].v4); + const static int idst_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[1].v4); + const static int odst_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[0].v4); + + const static int igwy1_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[0].v4); + const static int ogwy1_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[1].v4); + const static int igwy2_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[1].v4); + const static int ogwy2_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[0].v4); + +#if !defined(__DragonFly__) + addr = ntohl(addr); + mask = ntohl(mask); +#endif + + bi = gen_cmp(offsetof(pf_state_t, direction), BPF_B, (bpf_int32)PF_IN); + bo = gen_cmp(offsetof(pf_state_t, direction), BPF_B, (bpf_int32)PF_OUT); + + switch (dir) { + + case Q_SRC: + b1 = gen_mcmp(osrc_off, BPF_W, addr, mask); + gen_and(bo, b1); + b0 = gen_mcmp(isrc_off, BPF_W, addr, mask); + gen_and(bi, b0); + gen_or(b0, b1); + break; + + case Q_DST: + b1 = gen_mcmp(odst_off, BPF_W, addr, mask); + gen_and(bo, b1); + b0 = gen_mcmp(idst_off, BPF_W, addr, mask); + gen_and(bi, b0); + gen_or(b0, b1); + break; + + case Q_GATEWAY: + /* (in && (addr == igwy1 || addr == igwy2)) || + (out && (addr == ogwy1 || addr == ogwy2)) phew! */ + b1 = gen_mcmp(igwy1_off, BPF_W, addr, mask); + b0 = gen_mcmp(igwy2_off, BPF_W, addr, mask); + gen_or(b0, b1); + gen_and(bi, b1); + b2 = gen_mcmp(ogwy1_off, BPF_W, addr, mask); + b0 = gen_mcmp(ogwy2_off, BPF_W, addr, mask); + gen_or(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_AND: + b1 = gen_mcmp(isrc_off, BPF_W, addr, mask); + b0 = gen_mcmp(idst_off, BPF_W, addr, mask); + gen_and(b0, b1); + gen_and(bi, b1); + b2 = gen_mcmp(osrc_off, BPF_W, addr, mask); + b0 = gen_mcmp(odst_off, BPF_W, addr, mask); + gen_and(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_OR: + b1 = gen_mcmp(isrc_off, BPF_W, addr, mask); + b0 = gen_mcmp(idst_off, BPF_W, addr, mask); + gen_or(b0, b1); + gen_and(bi, b1); + b2 = gen_mcmp(osrc_off, BPF_W, addr, mask); + b0 = gen_mcmp(odst_off, BPF_W, addr, mask); + gen_or(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_DEFAULT: + b1 = gen_mcmp(isrc_off, BPF_W, addr, mask); + b0 = gen_mcmp(idst_off, BPF_W, addr, mask); + gen_or(b0, b1); + b0 = gen_mcmp(osrc_off, BPF_W, addr, mask); + gen_or(b0, b1); + b0 = gen_mcmp(odst_off, BPF_W, addr, mask); + gen_or(b0, b1); + break; + + default: + sf_error("Internal error: Invalid direcion specifier: %d", dir); + } + + b0 = gen_linktype(ETHERTYPE_IP); + gen_and(b0, b1); + + return b1; +} + +#else static struct block * gen_hostop(bpf_u_int32 addr, bpf_u_int32 mask, int dir) { @@@@ -482,8 +590,10 @@@@ gen_hostop(bpf_u_int32 addr, bpf_u_int32 const static int gwy_off = offsetof(pf_state_t, gwy.addr.v4); const static int ext_off = offsetof(pf_state_t, ext.addr.v4); +#if !defined(__DragonFly__) addr = ntohl(addr); mask = ntohl(mask); +#endif switch (dir) { @@@@ -542,6 +652,7 @@@@ gen_hostop(bpf_u_int32 addr, bpf_u_int32 return b1; } +#endif static struct block * gen_hostcmp6(u_int off, u_int32_t *a, u_int32_t *m) @@@@ -560,6 +671,105 @@@@ gen_hostcmp6(u_int off, u_int32_t *a, u_ return b1; } +#ifdef HAVE_PFSYNC_KEY +static struct block * +gen_hostop6(struct in6_addr *addr, struct in6_addr *mask, int dir) + +{ + struct block *b0, *b1, *b2, *bi, *bo; + u_int32_t *a, *m; + const static int isrc_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[0].v6); + const static int osrc_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[1].v6); + const static int idst_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[1].v6); + const static int odst_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[0].v6); + + const static int igwy1_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[0].v6); + const static int ogwy1_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[1].v6); + const static int igwy2_off = offsetof(pf_state_t, key[PF_SK_WIRE].addr[1].v6); + const static int ogwy2_off = offsetof(pf_state_t, key[PF_SK_STACK].addr[0].v6); + + a = (u_int32_t *)addr; + m = (u_int32_t *)mask; + + bi = gen_cmp(offsetof(pf_state_t, direction), BPF_B, (bpf_int32)PF_IN); + bo = gen_cmp(offsetof(pf_state_t, direction), BPF_B, (bpf_int32)PF_OUT); + + switch (dir) { + + case Q_SRC: + b1 = gen_hostcmp6(osrc_off, a, m); + gen_and(bo, b1); + b0 = gen_hostcmp6(isrc_off, a, m); + gen_and(bi, b0); + gen_or(b0, b1); + break; + + case Q_DST: + b1 = gen_hostcmp6(odst_off, a, m); + gen_and(bo, b1); + b0 = gen_hostcmp6(idst_off, a, m); + gen_and(bi, b0); + gen_or(b0, b1); + break; + + case Q_GATEWAY: + /* (in && (addr == igwy1 || addr == igwy2)) || + (out && (addr == ogwy1 || addr == ogwy2)) phew! */ + b1 = gen_hostcmp6(igwy1_off, a, m); + b0 = gen_hostcmp6(igwy2_off, a, m); + gen_or(b0, b1); + gen_and(bi, b1); + b2 = gen_hostcmp6(ogwy1_off, a, m); + b0 = gen_hostcmp6(ogwy2_off, a, m); + gen_or(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_AND: + b1 = gen_hostcmp6(isrc_off, a, m); + b0 = gen_hostcmp6(idst_off, a, m); + gen_and(b0, b1); + gen_and(bi, b1); + b2 = gen_hostcmp6(osrc_off, a, m); + b0 = gen_hostcmp6(odst_off, a, m); + gen_and(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_OR: + b1 = gen_hostcmp6(isrc_off, a, m); + b0 = gen_hostcmp6(idst_off, a, m); + gen_or(b0, b1); + gen_and(bi, b1); + b2 = gen_hostcmp6(osrc_off, a, m); + b0 = gen_hostcmp6(odst_off, a, m); + gen_or(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_DEFAULT: + b1 = gen_hostcmp6(isrc_off, a, m); + b0 = gen_hostcmp6(idst_off, a, m); + gen_or(b0, b1); + b0 = gen_hostcmp6(osrc_off, a, m); + gen_or(b0, b1); + b0 = gen_hostcmp6(odst_off, a, m); + gen_or(b0, b1); + break; + + default: + sf_error("Internal error: Invalid direcion specifier: %d", dir); + } + + b0 = gen_linktype(ETHERTYPE_IPV6); + gen_and(b0, b1); + + return b1; +} +#else static struct block * gen_hostop6(struct in6_addr *addr, struct in6_addr *mask, int dir) { @@@@ -630,6 +840,7 @@@@ gen_hostop6(struct in6_addr *addr, struc gen_and(b0, b1); return b1; } +#endif static const char * get_modifier_by_id(int id) @@@@ -733,13 +944,17 @@@@ gen_proto_abbrev(proto) b1 = gen_proto(IPPROTO_ESP); break; +#ifdef IPPROTO_PFSYNC case Q_PFSYNC: b1 = gen_proto(IPPROTO_PFSYNC); break; +#endif /* IPPROTO_PFSYNC */ +#ifdef IPPROTO_CARP case Q_CARP: b1 = gen_proto(IPPROTO_CARP); break; +#endif /* IPPROTO_CARP */ default: sf_error("Unknown protocol abbreviation"); @@@@ -748,6 +963,106 @@@@ gen_proto_abbrev(proto) return b1; } +#ifdef HAVE_PFSYNC_KEY +struct block * +gen_portop(int port, int proto, int dir) +{ + struct block *b0, *b1, *b2, *bi, *bo; + const static int isrc_off = offsetof(pf_state_t, key[PF_SK_STACK].port[0]); + const static int osrc_off = offsetof(pf_state_t, key[PF_SK_WIRE].port[1]); + const static int idst_off = offsetof(pf_state_t, key[PF_SK_STACK].port[1]); + const static int odst_off = offsetof(pf_state_t, key[PF_SK_WIRE].port[0]); + + const static int igwy1_off = offsetof(pf_state_t, key[PF_SK_WIRE].port[0]); + const static int ogwy1_off = offsetof(pf_state_t, key[PF_SK_STACK].port[1]); + const static int igwy2_off = offsetof(pf_state_t, key[PF_SK_WIRE].port[1]); + const static int ogwy2_off = offsetof(pf_state_t, key[PF_SK_STACK].port[0]); + +#if !defined(__DragonFly__) + port = ntohs(port); +#endif + + bi = gen_cmp(offsetof(pf_state_t, direction), BPF_B, (bpf_int32)PF_IN); + bo = gen_cmp(offsetof(pf_state_t, direction), BPF_B, (bpf_int32)PF_OUT); + + switch (dir) { + + case Q_SRC: + b1 = gen_cmp(osrc_off, BPF_H, (bpf_int32)port); + gen_and(bo, b1); + b0 = gen_cmp(isrc_off, BPF_H, (bpf_int32)port); + gen_and(bi, b0); + gen_or(b0, b1); + break; + + case Q_DST: + b1 = gen_cmp(odst_off, BPF_H, (bpf_int32)port); + gen_and(bo, b1); + b0 = gen_cmp(idst_off, BPF_H, (bpf_int32)port); + gen_and(bi, b0); + gen_or(b0, b1); + break; + + case Q_GATEWAY: + /* (in && (addr == igwy1 || addr == igwy2)) || + (out && (addr == ogwy1 || addr == ogwy2)) phew! */ + b1 = gen_cmp(igwy1_off, BPF_H, (bpf_int32)port); + b0 = gen_cmp(igwy2_off, BPF_H, (bpf_int32)port); + gen_or(b0, b1); + gen_and(bi, b1); + b2 = gen_cmp(ogwy1_off, BPF_H, (bpf_int32)port); + b0 = gen_cmp(ogwy2_off, BPF_H, (bpf_int32)port); + gen_or(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_AND: + b1 = gen_cmp(isrc_off, BPF_H, (bpf_int32)port); + b0 = gen_cmp(idst_off, BPF_H, (bpf_int32)port); + gen_and(b0, b1); + gen_and(bi, b1); + b2 = gen_cmp(osrc_off, BPF_H, (bpf_int32)port); + b0 = gen_cmp(odst_off, BPF_H, (bpf_int32)port); + gen_and(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_OR: + b1 = gen_cmp(isrc_off, BPF_H, (bpf_int32)port); + b0 = gen_cmp(idst_off, BPF_H, (bpf_int32)port); + gen_or(b0, b1); + gen_and(bi, b1); + b2 = gen_cmp(osrc_off, BPF_H, (bpf_int32)port); + b0 = gen_cmp(odst_off, BPF_H, (bpf_int32)port); + gen_or(b2, b0); + gen_and(bo, b0); + gen_or(b0, b1); + break; + + case Q_DEFAULT: + b1 = gen_cmp(isrc_off, BPF_H, (bpf_int32)port); + b0 = gen_cmp(idst_off, BPF_H, (bpf_int32)port); + gen_or(b0, b1); + b0 = gen_cmp(osrc_off, BPF_H, (bpf_int32)port); + gen_or(b0, b1); + b0 = gen_cmp(odst_off, BPF_H, (bpf_int32)port); + gen_or(b0, b1); + break; + + default: + sf_error("Internal error: Invalid direcion specifier: %d", dir); + } + + + + b0 = gen_proto(proto); + gen_and(b0, b1); + + return b1; +} +#else struct block * gen_portop(int port, int proto, int dir) { @@@@ -756,7 +1071,9 @@@@ gen_portop(int port, int proto, int dir) const static int gwy_off = offsetof(pf_state_t, gwy.port); const static int ext_off = offsetof(pf_state_t, ext.port); +#if !defined(__DragonFly__) port = ntohs(port); +#endif switch (dir) { @@@@ -815,6 +1132,7 @@@@ gen_portop(int port, int proto, int dir) return b1; } +#endif static struct block * gen_port(int port, int ip_proto, int dir) @@@@ -1560,7 +1878,7 @@@@ gen_ifname(char *ifname) /* NOTREACHED */ } - b0 = gen_bcmp(off, strlen(ifname), ifname); + b0 = gen_bcmp(off, strlen(ifname), (const u_char *)ifname); return (b0); #else sf_error("ifname not supported in this OpenBSD release"); @ 1.3 log @sysutils/pftop: support newer PF and depend on osabi * In order for pftop to be built successfully with newer PF versions (> 4.1), additional patches are necessary which were taken from OpenBSD's ports as seen in PR pkg/44339 * Pftop compiled for another PF version will not work (properly), so to avoid any problems we must depend on the OS version ok@@ wiz @ text @d1 1 a1 1 $NetBSD: patch-ah,v 1.2 2010/09/18 20:48:23 wiz Exp $ d4 1 a4 1 * DragonFly compatibility d7 2 a8 2 --- sf-gencode.c.orig 2007-11-07 07:34:18 +0100 +++ sf-gencode.c 2010-09-16 01:35:22 +0200 d32 1 a32 1 @@@@ -60,7 +64,11 @@@@ d36 1 a36 1 +#ifdef __DragonFly__ d44 1 a44 1 @@@@ -474,6 +482,106 @@@@ d151 1 a151 1 @@@@ -482,8 +590,10 @@@@ d162 1 a162 1 @@@@ -542,6 +652,7 @@@@ d170 1 a170 1 @@@@ -560,6 +671,105 @@@@ d276 1 a276 1 @@@@ -630,6 +840,7 @@@@ d284 1 a284 1 @@@@ -733,13 +944,17 @@@@ d302 1 a302 1 @@@@ -748,6 +963,106 @@@@ d409 1 a409 1 @@@@ -756,7 +1071,9 @@@@ d419 1 a419 1 @@@@ -815,6 +1132,7 @@@@ d427 1 a427 1 @@@@ -1560,7 +1878,7 @@@@ @ 1.2 log @DragonFly fixes from Rumko in PR 42345. @ text @d1 5 a5 1 $NetBSD: patch-ah,v 1.1 2008/06/15 14:09:04 peter Exp $ d44 108 a151 1 @@@@ -482,8 +490,10 @@@@ d162 123 a284 1 @@@@ -733,13 +743,17 @@@@ d302 108 a409 1 @@@@ -756,7 +770,9 @@@@ d419 9 a427 1 @@@@ -1560,7 +1576,7 @@@@ @ 1.1 log @Update pftop to version 0.7. Tested on NetBSD 3.1, 4.0 and yamt-pf42. Changes in version 0.7: This version adds state filtering, which is funded by backcountry.com, many thanks. It is now possible to select which states are displayed using a tcpdump(8) like filtering language. The filter can be specified on the command line, using the '-f' switch. It is also possible to change the filter interactively using the 'f' command key. Some sample, not necessarily practical, filters are given below: - Do not show pfsync or carp traffic: not (pfsync or carp) not pfsync and not carp - DNS traffic not going to or coming from the DNS servers: port 53 and not host (10.0.0.10 or 10.0.0.11) - States with input bytes greater than 1M: inb > 1000000 - Traffic with very small average packet size: ((inb / inp) + (outb / outp))/2 < 100 inb / inp + outb / outp < 200 Changes in version 0.6: No functional changes. It now compiles and runs on OpenBSD 4.1-current after pf interface changes. This version also contains separated pf and display code. This should make adding new views easier. Changes in version 0.5: This version displays all active pf rules by traversing the ruleset tree. In addition HFSC queues are now displayed correctly thanks to Jared Spiegel. This version also incorporates other patches and comments I have received since the previous release. Many thanks to all who have contributed. - New command-line switch 'S' to start the display at a given state. - Display HFCS statistics in the queue page. - Fixed state and rule byte and packet counters - Fixed state sorting by packets and bytes - Fixed some minor display problems - The rule view now traverses all rulesets, and displays all active rules, together with anchor (ruleset) names. - Anchor and Label fields dynamically resize themselves @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- sf-gencode.c.old 2008-06-14 17:44:52.000000000 +0200 +++ sf-gencode.c 2008-06-15 01:19:43.000000000 +0200 @@@@ -32,8 +32,11 @@@@ d11 1 d19 1 a19 1 @@@@ -44,7 +47,7 @@@@ d28 24 a51 1 @@@@ -733,13 +736,17 @@@@ d69 11 a79 1 @@@@ -1560,7 +1567,7 @@@@ @