Wed Mar 7 18:27:30 2012 UTC ()
Fix build on SunOS.
(hans)
diff -r1.14 -r1.15 pkgsrc/net/tcpdstat/Makefile
diff -r1.4 -r1.5 pkgsrc/net/tcpdstat/distinfo
diff -r0 -r1.1 pkgsrc/net/tcpdstat/patches/patch-Makefile
diff -r0 -r1.1 pkgsrc/net/tcpdstat/patches/patch-ip_flow.c
diff -r1.1 -r1.2 pkgsrc/net/tcpdstat/patches/patch-aa
--- pkgsrc/net/tcpdstat/Makefile 2011/03/17 22:08:37 1.14
+++ pkgsrc/net/tcpdstat/Makefile 2012/03/07 18:27:30 1.15
| @@ -1,22 +1,30 @@ | | | @@ -1,22 +1,30 @@ |
1 | # $NetBSD: Makefile,v 1.14 2011/03/17 22:08:37 zafer Exp $ | | 1 | # $NetBSD: Makefile,v 1.15 2012/03/07 18:27:30 hans Exp $ |
2 | | | 2 | |
3 | DISTNAME= tcpd-tools-0.8 | | 3 | DISTNAME= tcpd-tools-0.8 |
4 | PKGNAME= tcpdstat-0.8 | | 4 | PKGNAME= tcpdstat-0.8 |
5 | CATEGORIES= net | | 5 | CATEGORIES= net |
6 | MASTER_SITES= # ftp://tracer.csl.sony.co.jp/pub/mawi/tools/ | | 6 | MASTER_SITES= # ftp://tracer.csl.sony.co.jp/pub/mawi/tools/ |
7 | | | 7 | |
8 | MAINTAINER= pkgsrc-users@NetBSD.org | | 8 | MAINTAINER= pkgsrc-users@NetBSD.org |
9 | COMMENT= Analyze tcpdump output | | 9 | COMMENT= Analyze tcpdump output |
10 | | | 10 | |
11 | PKG_DESTDIR_SUPPORT= user-destdir | | 11 | PKG_DESTDIR_SUPPORT= user-destdir |
12 | | | 12 | |
13 | NOT_FOR_PLATFORM= Interix-*-* | | 13 | NOT_FOR_PLATFORM= Interix-*-* |
14 | | | 14 | |
| | | 15 | CFLAGS.SunOS+= -Du_int64_t=uint64_t -Du_int32_t=uint32_t |
| | | 16 | CFLAGS.SunOS+= -Du_int16_t=uint16_t -Du_int8_t=uint8_t |
| | | 17 | |
| | | 18 | LIBS.SunOS+= -lsocket -lnsl |
| | | 19 | |
| | | 20 | MAKE_ENV+= SYS_LIBS=${LIBS:Q} |
| | | 21 | |
15 | WRKSRC= ${WRKDIR}/${DISTNAME}/tcpdstat | | 22 | WRKSRC= ${WRKDIR}/${DISTNAME}/tcpdstat |
16 | | | 23 | |
17 | INSTALLATION_DIRS= bin | | 24 | INSTALLATION_DIRS= bin |
18 | | | 25 | |
19 | do-install: | | 26 | do-install: |
20 | ${INSTALL_PROGRAM} ${WRKSRC}/tcpdstat ${DESTDIR}${PREFIX}/bin | | 27 | ${INSTALL_PROGRAM} ${WRKSRC}/tcpdstat ${DESTDIR}${PREFIX}/bin |
21 | | | 28 | |
| | | 29 | .include "../../net/libpcap/buildlink3.mk" |
22 | .include "../../mk/bsd.pkg.mk" | | 30 | .include "../../mk/bsd.pkg.mk" |
--- pkgsrc/net/tcpdstat/distinfo 2007/05/30 17:47:04 1.4
+++ pkgsrc/net/tcpdstat/distinfo 2012/03/07 18:27:30 1.5
| @@ -1,6 +1,8 @@ | | | @@ -1,6 +1,8 @@ |
1 | $NetBSD: distinfo,v 1.4 2007/05/30 17:47:04 minskim Exp $ | | 1 | $NetBSD: distinfo,v 1.5 2012/03/07 18:27:30 hans Exp $ |
2 | | | 2 | |
3 | SHA1 (tcpd-tools-0.8.tar.gz) = fe2abe15bbf9062833af9bec3745c751a8aa06df | | 3 | SHA1 (tcpd-tools-0.8.tar.gz) = fe2abe15bbf9062833af9bec3745c751a8aa06df |
4 | RMD160 (tcpd-tools-0.8.tar.gz) = 876842cbb37ca65d4b955718abd5ef5c14810dee | | 4 | RMD160 (tcpd-tools-0.8.tar.gz) = 876842cbb37ca65d4b955718abd5ef5c14810dee |
5 | Size (tcpd-tools-0.8.tar.gz) = 468856 bytes | | 5 | Size (tcpd-tools-0.8.tar.gz) = 468856 bytes |
6 | SHA1 (patch-aa) = 9895d6f2386ef561ac8502b787035f79fa44e771 | | 6 | SHA1 (patch-Makefile) = b77ceb25ed320a221ce3a8fd3b0ccc64d35b4b25 |
| | | 7 | SHA1 (patch-aa) = 1d4eb35cc8231321325e40b5bc265eaa0e78ff0f |
| | | 8 | SHA1 (patch-ip_flow.c) = a1b35b10b055e6da0a4e12b6226a1fa6b06c1154 |
$NetBSD: patch-Makefile,v 1.1 2012/03/07 18:27:30 hans Exp $
--- Makefile.orig 2000-04-16 18:26:25.000000000 +0200
+++ Makefile 2012-03-07 18:55:43.383385719 +0100
@@ -4,7 +4,6 @@ OBJS= stat.o net_read.o ip_flow.o
SYS_DEFINES?= -DINET6
-CFLAGS= -g -Wall
DEFINES= $(SYS_DEFINES)
INCLUDES= -I. $(SYS_INCLUDES)
$NetBSD: patch-ip_flow.c,v 1.1 2012/03/07 18:27:30 hans Exp $
--- ip_flow.c.orig 2000-06-30 13:16:26.000000000 +0200
+++ ip_flow.c 2012-03-07 19:03:35.308708989 +0100
@@ -66,14 +66,14 @@ struct flow_entry {
struct flow f_flow;
int f_packets;
- quad_t f_bytes;
+ int64_t f_bytes;
};
#define FLOW_HASHSIZE 256
static LIST_HEAD(flow_head, flow_entry) flow_hash[FLOW_HASHSIZE];
int total_packets;
-quad_t total_bytes;
+int64_t total_bytes;
static __inline int ip_hash4 __P((struct in_addr *, struct in_addr *));
#ifdef INET6
@@ -229,7 +229,7 @@ void ipflow_show(void)
*/
for (j = 0; j < NTOP; j++) {
if (big_flows[j] == NULL ||
- (quad_t)flow->f_bytes > big_flows[j]->f_bytes) {
+ (int64_t)flow->f_bytes > big_flows[j]->f_bytes) {
/* insert the entry */
for (k = NTOP-1; k > j; k--)
big_flows[k] = big_flows[k-1];
@@ -312,7 +312,7 @@ struct addr_entry {
#endif
} a_un;
int addr_packets;
- quad_t addr_bytes;
+ int64_t addr_bytes;
};
#define addr_ip a_un.ua_ip
@@ -324,18 +324,18 @@ struct addr_entry {
static LIST_HEAD(addr_head, addr_entry) addr_hash[FLOW_HASHSIZE];
static int total_addr = 0;
-static quad_t v4_total_bytes = 0;
+static int64_t v4_total_bytes = 0;
#ifdef INET6
static LIST_HEAD(addr_head6, addr_entry) addr_hash6[FLOW_HASHSIZE];
static int total_addr6 = 0;
-static quad_t v6_total_bytes = 0;
+static int64_t v6_total_bytes = 0;
#endif
static int addr_count(af, ip_addr, packets, bytes)
int af;
struct in_addr *ip_addr;
int packets;
- quad_t bytes;
+ int64_t bytes;
{
struct addr_entry *addr;
int hash;
--- pkgsrc/net/tcpdstat/patches/patch-aa 2007/05/30 17:47:04 1.1
+++ pkgsrc/net/tcpdstat/patches/patch-aa 2012/03/07 18:27:30 1.2
| @@ -1,12 +1,21 @@ | | | @@ -1,12 +1,21 @@ |
1 | $NetBSD: patch-aa,v 1.1 2007/05/30 17:47:04 minskim Exp $ | | 1 | $NetBSD: patch-aa,v 1.2 2012/03/07 18:27:30 hans Exp $ |
2 | | | 2 | |
3 | --- tcpdstat.h.orig 2000-06-30 04:16:39.000000000 -0700 | | 3 | --- tcpdstat.h.orig 2000-06-30 04:16:39.000000000 -0700 |
4 | +++ tcpdstat.h | | 4 | +++ tcpdstat.h |
| | | 5 | @@ -28,7 +28,7 @@ |
| | | 6 | |
| | | 7 | struct pkt_cnt { |
| | | 8 | int packets; |
| | | 9 | - quad_t bytes; |
| | | 10 | + int64_t bytes; |
| | | 11 | }; |
| | | 12 | |
| | | 13 | enum protos { |
5 | @@ -70,7 +70,6 @@ enum protos { | | 14 | @@ -70,7 +70,6 @@ enum protos { |
6 | extern int read_count; | | 15 | extern int read_count; |
7 | extern struct timeval start_time, end_time; | | 16 | extern struct timeval start_time, end_time; |
8 | extern struct pkt_cnt tcpdstat[PROTOTYPE_MAX]; | | 17 | extern struct pkt_cnt tcpdstat[PROTOTYPE_MAX]; |
9 | -extern int packet_length; | | 18 | -extern int packet_length; |
10 | extern int caplen_total; | | 19 | extern int caplen_total; |
11 | extern int caplen_max; | | 20 | extern int caplen_max; |
12 | extern int use_ipflow; | | 21 | extern int use_ipflow; |