diff options
author | Sergey Skvortsov <skv@FreeBSD.org> | 2006-09-14 16:40:18 +0000 |
---|---|---|
committer | Sergey Skvortsov <skv@FreeBSD.org> | 2006-09-14 16:40:18 +0000 |
commit | c4203a8dce1d2582c506dcf529bb2bbaff5b230f (patch) | |
tree | 85489abc3fa294c08253b722daf031adc706d87b /net-mgmt | |
parent | 447d38aa802bf8ea39746e42b39c2ccb7a35f60c (diff) |
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/ng_ipacct/Makefile | 5 | ||||
-rw-r--r-- | net-mgmt/ng_ipacct/files/patch-ipacctctl.c | 66 | ||||
-rw-r--r-- | net-mgmt/ng_ipacct/pkg-plist | 2 |
3 files changed, 70 insertions, 3 deletions
diff --git a/net-mgmt/ng_ipacct/Makefile b/net-mgmt/ng_ipacct/Makefile index 9ea2f99b7c78..9134de012432 100644 --- a/net-mgmt/ng_ipacct/Makefile +++ b/net-mgmt/ng_ipacct/Makefile @@ -7,7 +7,7 @@ PORTNAME= ng_ipacct PORTVERSION= 20050731 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_LOCAL:S!$!skv/!} \ ftp://ftp.wuppy.net.ru/pub/FreeBSD/local/kernel/ng_ipacct/ @@ -40,7 +40,8 @@ CFLAGS+= -DMEM_USE_ZONE post-install: @${MKDIR} ${PREFIX}/include/netgraph ${INSTALL_DATA} ${WRKSRC}/ng_ipacct/ng_ipacct.h ${PREFIX}/include/netgraph - ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf ${PREFIX}/etc/ + ${INSTALL_DATA} ${FILESDIR}/ng_ipacct.conf \ + ${PREFIX}/etc/ng_ipacct.conf.sample @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/net-mgmt/ng_ipacct/files/patch-ipacctctl.c b/net-mgmt/ng_ipacct/files/patch-ipacctctl.c new file mode 100644 index 000000000000..31438adb31ed --- /dev/null +++ b/net-mgmt/ng_ipacct/files/patch-ipacctctl.c @@ -0,0 +1,66 @@ +--- ipacctctl/ipacctctl.c.orig 2006-02-07 19:55:24.406250000 +0300 ++++ ipacctctl/ipacctctl.c 2006-02-07 20:13:25.734375000 +0300 +@@ -36,6 +36,7 @@ + #include <sys/socket.h> + #include <sys/queue.h> + #include <sys/select.h> ++#include <inttypes.h> + + #include <net/bpf.h> /* for DLT_XXX consts */ + #include <netinet/in.h> +@@ -56,6 +57,10 @@ + #define IN_HOOK 0 + #define OUT_HOOK 1 + ++#ifndef PRIu64 ++#define PRIu64 "qu" ++#endif ++ + int main(int, char **); + + static int ip_account_get_info(int _type, void *_buf, int _len, int _out); +@@ -459,7 +464,7 @@ + (hi->hi_thrs_when) ? stime : "Never"); + printf("total number of packets:\t%u\n", + hi->hi_packets); +- printf("total number of bytes:\t\t%qu\n", ++ printf("total number of bytes:\t\t%" PRIu64 "\n", + hi->hi_bytes); + return; + } +@@ -473,9 +478,9 @@ + ng_hookprefix, (outgoing) ? "out" : "in"); + printf("database type:\t\t%s\n", + (type == NGM_IPACCT_CINFO) ? "checkpointed" : "active"); +- printf("accounted:\t\tpackets: %u\tbytes: %qu\n", ++ printf("accounted:\t\tpackets: %u\tbytes: %" PRIu64 "\n", + ai->ai_packets, ai->ai_bytes); +- printf("exceed threshold:\tpackets: %u\tbytes: %qu\n", ++ printf("exceed threshold:\tpackets: %u\tbytes: %" PRIu64 "\n", + ai->ai_th_packets, ai->ai_th_bytes); + strftime(stime, sizeof(stime), TIME_FMT, localtime(&ai->ai_start)); + printf("database was created:\t%s\n", +@@ -642,7 +647,7 @@ + ip_account_print(data, hi.hi_flags); + } + if (ci.ai_th_packets) +- printf(" Accounting exceed threshold by %u packets (%qu bytes)\n", ++ printf(" Accounting exceed threshold by %u packets (%" PRIu64 " bytes)\n", + ci.ai_th_packets, ci.ai_th_bytes); + + return (0); +@@ -707,12 +712,12 @@ + inet_ntop(AF_INET, &pr->s.r_dst, dst, sizeof(dst)); + } + if (flags & HI_VERBOSE_MODE) { +- printf("%s\t%d\t%s\t%d\t%d\t%u\t%qu", ++ printf("%s\t%d\t%s\t%d\t%d\t%u\t%" PRIu64, + src, ntohs(pr->s.r_sport), + dst, ntohs(pr->s.r_dport), + pr->s.r_ip_p, pr->packets, pr->bytes); + } else { +- printf("%s\t%s\t%u\t%qu", ++ printf("%s\t%s\t%u\t%" PRIu64, + src, dst, pr->packets, pr->bytes); + } + if (flags & HI_SAVE_UID) { diff --git a/net-mgmt/ng_ipacct/pkg-plist b/net-mgmt/ng_ipacct/pkg-plist index 1c1bb2cc8b04..671d46e7e664 100644 --- a/net-mgmt/ng_ipacct/pkg-plist +++ b/net-mgmt/ng_ipacct/pkg-plist @@ -1,5 +1,5 @@ include/netgraph/ng_ipacct.h -etc/ng_ipacct.conf +etc/ng_ipacct.conf.sample sbin/ipacctctl @dirrmtry include/netgraph @cwd / |