diff options
Diffstat (limited to 'net-mgmt/ehnt/files')
-rw-r--r-- | net-mgmt/ehnt/files/ehntserv.sh.sample | 25 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-Makefile | 55 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-ProcessASN.pl | 128 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-config-h | 18 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-ehnt-lookup | 11 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-ehnt__client.c | 14 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-ehnt__processflow.c | 14 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-ehntserv.c | 176 |
8 files changed, 0 insertions, 441 deletions
diff --git a/net-mgmt/ehnt/files/ehntserv.sh.sample b/net-mgmt/ehnt/files/ehntserv.sh.sample deleted file mode 100644 index a9db95ed60c9..000000000000 --- a/net-mgmt/ehnt/files/ehntserv.sh.sample +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in -start) - if [ -x ${PREFIX}/sbin/ehntserv ]; then - echo -n ' ehntserv' - ${PREFIX}/sbin/ehntserv - fi - ;; -stop) - echo -n ' ehntserv' - killall ehntserv - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - exit 2 - ;; -esac - -exit 0 diff --git a/net-mgmt/ehnt/files/patch-Makefile b/net-mgmt/ehnt/files/patch-Makefile deleted file mode 100644 index 5c0d61866bdb..000000000000 --- a/net-mgmt/ehnt/files/patch-Makefile +++ /dev/null @@ -1,55 +0,0 @@ ---- Makefile.orig Thu Oct 4 22:18:29 2001 -+++ Makefile Fri Oct 5 21:00:34 2001 -@@ -1,23 +1,14 @@ --PLATFORM = LINUX -+#PLATFORM = LINUX - #PLATFORM = SOLARIS --#PLATFORM = FreeBSD --CC = gcc -+PLATFORM = FreeBSD -+#CC = gcc - #DEBUG = yes - #CFLAGS = -g - #CFLAGS = -O6 --STRIP = strip -+#STRIP = strip - #STRIP = gstrip - LIBS = -lm --CFLAGS = -I/usr/lib/glib/include -- --ifeq ($(PLATFORM),SOLARIS) -- LIBS += -lsocket -lnsl -lresolv --endif -- --ifeq ($(DEBUG),yes) -- CFLAGS += -g --endif -- -+CFLAGS+= -DASNCDIR=\"${PREFIX}/share/ehnt\" - - all: ehntserv ehnt asnc.txt - @echo -@@ -40,11 +31,6 @@ - - ehnt : ehnt_client.o ehnt_lookup.o ehnt_display.o ehnt_processflow.o ehnt_main.o - $(CC) -o ehnt ehnt_client.o ehnt_lookup.o ehnt_display.o ehnt_processflow.o ehnt_main.o $(LIBS) $(CFLAGS) --ifeq ($(DEBUG),yes) -- @echo Debug mode - ehnt not stripped --else -- $(STRIP) ehnt --endif - - - ehntserv.o : ehntserv.c ehnt.h netflowv5.h config.h -@@ -52,11 +38,6 @@ - - ehntserv : ehntserv.o - $(CC) $(CFLAGS) -o ehntserv ehntserv.o $(LIBS) $(CFLAGS) --ifeq ($(DEBUG),yes) -- @echo Debug mode - ehnt not stripped --else -- $(STRIP) ehntserv --endif - - asnc.txt : - perl ./ProcessASN.pl diff --git a/net-mgmt/ehnt/files/patch-ProcessASN.pl b/net-mgmt/ehnt/files/patch-ProcessASN.pl deleted file mode 100644 index 367b4766d102..000000000000 --- a/net-mgmt/ehnt/files/patch-ProcessASN.pl +++ /dev/null @@ -1,128 +0,0 @@ - -$FreeBSD$ - ---- ProcessASN.pl.orig Tue Oct 22 00:21:49 2002 -+++ ProcessASN.pl Tue Oct 22 00:21:53 2002 -@@ -4,7 +4,7 @@ - - #ftp://ftp.arin.net/netinfo/asn.txt - #ftp://ftp.apnic.net/pub/apnic/dbase/data/apnic.an.gz --#ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz -+#ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz - - #and put them all in another file in a dumb format so they can - #be processed by my dumb C program. -@@ -51,28 +51,28 @@ - } - } - --if (! -f "ripe.db.an" ) { -- if (-f "ripe.db.an.gz") { -- system "$gzip -d ripe.db.an.gz"; -+if (! -f "ripe.db.aut-num" ) { -+ if (-f "ripe.db.aut-num.gz") { -+ system "$gzip -d ripe.db.aut-num.gz"; - $r=$?; - if ($r > 0) { -- print "---> Retrieved ripe.db.an.gz, but could not run $gzip!\n"; -+ print "---> Retrieved ripe.db.aut-num.gz, but could not run $gzip!\n"; - print "---> Please get $gzip and try again\n"; - exit(1); - } - } else { -- if ( RetrieveFile("ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz","ripe.db.an.gz")) { -- system "$gzip -d ripe.db.an.gz"; -+ if ( RetrieveFile("ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz","ripe.db.aut-num.gz")) { -+ system "$gzip -d ripe.db.aut-num.gz"; - $r=$?; - if ($r > 0) { -- print "---> Retrieved ripe.db.an.gz, but could not run $gzip!\n"; -+ print "---> Retrieved ripe.db.aut-num.gz, but could not run $gzip!\n"; - print "---> Please get $gzip and try again\n"; - exit(1); - } - } else { -- print "---> Cannot retrieve ripe.db.an.gz\n"; -+ print "---> Cannot retrieve ripe.db.aut-num.gz\n"; - print "---> Please download it from\n"; -- print "---> ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz\n"; -+ print "---> ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz\n"; - $MissingFile=1; - } - } -@@ -109,7 +109,7 @@ - print "Processed $c ASes from asn.txt\n"; - - ProcessRipeDB("apnic.an"); --ProcessRipeDB("ripe.db.an"); -+ProcessRipeDB("ripe.db.aut-num"); - - $c=0; - open OUTPUT,">asnc.txt"; -@@ -124,7 +124,7 @@ - $c=0; - open APNIC,"<$file"; - while (<APNIC>) { -- if (/^\*an: AS(..*)/) { -+ if (/^(\*an|aut-num):\s+AS(..*)/) { - if ($an) { - if ($aa) { $ASNs{$an}=$aa; $c++; } - elsif ($mb) { $ASNs{$an}=$mb; $c++; } -@@ -133,25 +133,25 @@ - - undef $an; undef $aa; undef $mb; undef $de; - } -- $an=$1; -+ $an=$2; - } -- if (/^\*aa: (..*)/) { -+ if (/^(\*aa|as-name):\s+(..*)/) { - if (! $aa) { -- $aa=$1; -+ $aa=$2; - $aa=~ s/ /_/g; - if ($aa eq 'UNSPECIFIED') { - $aa="AS$an"; # 'an:' is always defined here - } - } - } -- if (/^\*mb: MAINT\-(..*)/) { -+ if (/^(\*mb|mnt-by):\s+MAINT\-(..*)/) { - if (! $mb) { -- $mb=$1; -+ $mb=$2; - $mb=~ s/ /_/g; - } -- } elsif (/^\*mb: (..*)/) { -+ } elsif (/^(\*mb|mnt-by):\s+(..*)/) { - if (! $mb) { -- $mb=$1; -+ $mb=$2; - $mb=~ s/ /_/g; - } - } -@@ -176,20 +176,12 @@ - - print "RetrieveFile: getting $location\n"; - -- $wget="wget"; -- $ncftp="ncftp"; -- $curl="curl"; -- system "$wget -q $location"; -- $r=$?; -- if ($r==0) { print "Got file with $wget.\n"; return 1; } -+ $fetch="fetch"; - -- system "$ncftp $location"; -+ system "$fetch $location"; - $r=$?; -- if ($r==0) { print "Got file with $ncftp.\n"; return 1; } -+ if ($r==0) { print "Got file with $fetch.\n"; return 1; } - -- system "$curl -o $filename $location"; -- $r=$?; -- if ($r==0) { print "Got file with $curl\n"; return 1; } -- if ($r > 0) { print "Could not get $filename with $curl, $wget or $ncftp.\n"; } -+ if ($r > 0) { print "Could not get $filename with $fetch, $curl, $wget or $ncftp.\n"; } - return 0; - } diff --git a/net-mgmt/ehnt/files/patch-config-h b/net-mgmt/ehnt/files/patch-config-h deleted file mode 100644 index 0c7607a95b4f..000000000000 --- a/net-mgmt/ehnt/files/patch-config-h +++ /dev/null @@ -1,18 +0,0 @@ - -$FreeBSD$ - ---- config.h.orig Thu Oct 4 22:18:29 2001 -+++ config.h Thu Nov 14 22:20:47 2002 -@@ -32,4 +32,12 @@ - /* The default mode of the client. Can be either EM_REPORT or EM_DUMP.*/ - #define EM_DEFAULT EM_TOP - -+#ifndef ASNCDIR -+#define ASNCDIR "." -+#endif - -+/* Default size of socket buffer. FreeBSD default is Limited to 256k, -+ + * but misteriously enough maximum space available for buf is 233016 */ -+#define DEFAULT_SOCKBUF (192*1024) -+/* Reasonable minimum socket buffer size. I assume it's about 16k */ -+#define MIN_SOCKBUF (16*1024) diff --git a/net-mgmt/ehnt/files/patch-ehnt-lookup b/net-mgmt/ehnt/files/patch-ehnt-lookup deleted file mode 100644 index d6f6d655ef11..000000000000 --- a/net-mgmt/ehnt/files/patch-ehnt-lookup +++ /dev/null @@ -1,11 +0,0 @@ ---- ehnt_lookup.c.orig Wed Jul 18 00:47:37 2001 -+++ ehnt_lookup.c Fri Aug 3 19:54:34 2001 -@@ -36,7 +36,7 @@ - - memset(ASNs,0,sizeof(ASNs)); - -- if ( ! (f=fopen ("asnc.txt","r")) ) { -+ if ( ! (f=fopen (ASNCDIR "/asnc.txt","r")) ) { - perror("fopen"); - } else { - for ( ; ; ) { diff --git a/net-mgmt/ehnt/files/patch-ehnt__client.c b/net-mgmt/ehnt/files/patch-ehnt__client.c deleted file mode 100644 index a518e52f5eca..000000000000 --- a/net-mgmt/ehnt/files/patch-ehnt__client.c +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- ehnt_client.c.orig Thu Oct 4 22:18:29 2001 -+++ ehnt_client.c Thu Nov 14 22:12:07 2002 -@@ -89,7 +89,7 @@ - if (FD_ISSET(sockfd,&read_fds)) { - ehnt_client_processmessage(sockfd,routeraddr,my_ehnt_struct); - } -- if (FD_ISSET(STDIN_FILENO,&read_fds)) { -+ if (e_cfg->mode != EM_COLONDUMP && FD_ISSET(STDIN_FILENO,&read_fds)) { - char key; - key=getkey(); - switch (key) { diff --git a/net-mgmt/ehnt/files/patch-ehnt__processflow.c b/net-mgmt/ehnt/files/patch-ehnt__processflow.c deleted file mode 100644 index 7441034b9ceb..000000000000 --- a/net-mgmt/ehnt/files/patch-ehnt__processflow.c +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- ehnt_processflow.c.orig Thu Oct 4 22:18:29 2001 -+++ ehnt_processflow.c Thu Nov 14 22:17:18 2002 -@@ -218,7 +218,7 @@ - dstip.s_addr=rec->dstaddr; - nexthop.s_addr=rec->nexthop; - -- printf("%.0f:%s",local_flowcount,routeraddr_string); -+ printf("%.0f:%s:",local_flowcount,routeraddr_string); - printf("%d:%s:%d:", - rec->input_index, - inet_ntoa(srcip), diff --git a/net-mgmt/ehnt/files/patch-ehntserv.c b/net-mgmt/ehnt/files/patch-ehntserv.c deleted file mode 100644 index 71703c65150b..000000000000 --- a/net-mgmt/ehnt/files/patch-ehntserv.c +++ /dev/null @@ -1,176 +0,0 @@ - -$FreeBSD$ - ---- ehntserv.c.orig Thu Oct 4 22:18:29 2001 -+++ ehntserv.c Thu Nov 14 22:18:40 2002 -@@ -33,8 +33,8 @@ - #define MAXCLIENTS 256 - #define MAXPACKET 8192 - --int SetUDPOpts(int); --int SetTCPOpts(int); -+int SetUDPOpts(int, int); -+int SetTCPOpts(int, int); - - int debug; - int use_syslog; -@@ -54,6 +54,8 @@ - int packetcounter=0; - extern char *optarg; - int c_udpport, c_tcpport; -+ int one = -1; -+ int bufsize = DEFAULT_SOCKBUF; - - debug=0; - use_syslog=0; -@@ -61,7 +63,7 @@ - c_udpport=DEFAULT_UDP_PORT; - c_tcpport=DEFAULT_TCP_PORT; - -- while( (c=getopt(argc,argv,"u:t:d")) != -1) { -+ while( (c=getopt(argc,argv,"u:t:s:d")) != -1) { - - switch(c) { - case 'u': -@@ -70,6 +72,13 @@ - case 't': - sscanf(optarg,"%d",&c_tcpport); - break; -+ case 's': -+ sscanf(optarg,"%d",&bufsize); -+ if (bufsize < MIN_SOCKBUF) { -+ perror("too low buffer size or bad format: %s", optarg); -+ exit(1); -+ } -+ break; - case 'd': - debug=1; - break; -@@ -77,6 +86,7 @@ - printf("Usage: %s [ -u <udpport> ] [ -t <tcpport> ]\n",argv[0]); - printf(" -u <udpport> Listen on UDP port <udpport> for netflow packets. Default %d\n",DEFAULT_UDP_PORT); - printf(" -t <tcpport> Listen on TCP port <tcpport> for client connections. Default %d\n",DEFAULT_TCP_PORT); -+ printf(" -s <bufsize> Set tcp/udp buffer size. Default %d\n",DEFAULT_SOCKBUF); - printf(" -d Debug. Don't become a daemon, displays all messages on stdout,"); - printf(" displays lots of extra information\n"); - exit(0); -@@ -87,22 +97,22 @@ - - /* set up the netflow udp socket */ - if ( (nf_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) -- { log_error("socket (udp) error"); exit(0); } -+ { log_error("socket (udp) error"); exit(1); } - memset(&nf_servaddr,0,sizeof(nf_servaddr)); - nf_servaddr.sin_family = AF_INET; - nf_servaddr.sin_addr.s_addr = htonl(INADDR_ANY); - nf_servaddr.sin_port = htons(c_udpport); - if ( bind(nf_fd, (struct sockaddr *) &nf_servaddr, sizeof(nf_servaddr)) < 0) -- { log_error("bind UDP error"); exit(0); } -+ { log_error("bind UDP error"); exit(1); } - -- SetUDPOpts(nf_fd); -+ SetUDPOpts(nf_fd, bufsize); - - nf_clilen = (socklen_t) sizeof(nf_cliaddr); - l_clilen = (socklen_t) sizeof(l_cliaddr); - - /* set up the listening tcp socket*/ - if ( (l_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) -- { log_error("socket (tcp) error"); exit(0); } -+ { log_error("socket (tcp) error"); exit(1); } - memset(&l_servaddr,0,sizeof(l_servaddr)); - l_servaddr.sin_family = AF_INET; - l_servaddr.sin_addr.s_addr = htonl(INADDR_ANY); -@@ -112,9 +122,9 @@ - setsockopt(l_fd, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one)); - } - if ( bind(l_fd,(struct sockaddr *) &l_servaddr, sizeof(l_servaddr)) < 0) -- { log_error ("bind TCP error"); exit(0); } -+ { log_error ("bind TCP error"); exit(1); } - if ( listen(l_fd, 32) < 0) -- { log_error("listen error"); exit(0); } -+ { log_error("listen error"); exit(1); } - printf("Listening on UDP port %d and TCP port %d (with a backlog of 32)\n",c_udpport,c_tcpport); - memset(l_clients,0,sizeof(l_clients)); - -@@ -157,7 +167,7 @@ - } - - if ( (c=select(maxfd+1,&read_fds,NULL,NULL,NULL)) < 0) -- { log_error("select (read) error"); exit(0); } -+ { log_error("select (read) error"); exit(1); } - - if (FD_ISSET(nf_fd,&read_fds)) { /*a netflow message is waiting*/ - -@@ -168,7 +178,7 @@ - /* new packet */ - if ( (nf_rcount=recvfrom(nf_fd,(char *)(nf_packet + sizeof(nf_cliaddr.sin_addr.s_addr)), - MAXPACKET,0,(struct sockaddr *)&nf_cliaddr,&nf_clilen)) < 0) -- { log_error("recvfrom error"); exit(0); } -+ { log_error("recvfrom error"); exit(1); } - - /* Here we use a non-blocking select to find out which tcp clients we - can write to. This ensures the write won't block, which would of course -@@ -189,7 +199,7 @@ - timeout.tv_sec=0; - timeout.tv_usec=0; - if ( (c=select(maxfd+1,NULL,&write_fds,NULL,&timeout)) < 0) -- { log_error("select (write) error"); exit(0); } -+ { log_error("select (write) error"); exit(1); } - for (i=0; i<MAXCLIENTS; i++) { - if (l_clients[i] > 0) { - if (FD_ISSET(l_clients[i],&write_fds)) { -@@ -220,9 +230,9 @@ - /* printf("incoming connection on tcp 4444\n");*/ - l_addrlen=sizeof(l_cliaddr); - if ( (l_connfd = accept(l_fd,(struct sockaddr *) l_cliaddr, &l_addrlen)) < 0) -- { log_error("accept error"); exit(0); } -+ { log_error("accept error"); exit(1); } - -- SetTCPOpts(l_connfd); -+ SetTCPOpts(l_connfd, bufsize); - - for (i=0; i<MAXCLIENTS; i++) { - if (l_clients[i]==0) { -@@ -268,25 +278,26 @@ - } - - /* Increase our receive buffer for nf_fd: */ --int SetUDPOpts(int fd){ -- int r,p,n; -+int SetUDPOpts(int fd, int rcvsize){ -+ int r,p; - socklen_t optlen; - -- n=512*1024; - optlen = sizeof(p); - - if (debug) { - r=getsockopt(fd,SOL_SOCKET,SO_RCVBUF,&p,&optlen); - printf("Before setsockopt, SO_RCVBUF is %d\n",p); - } -- r=setsockopt(fd,SOL_SOCKET,SO_RCVBUF,&n,sizeof(n)); -+ if (setsockopt(fd,SOL_SOCKET,SO_RCVBUF,&rcvsize,sizeof(rcvsize)) < 0) { -+ perror("setsockopt SO_RCVBUF:"); -+ } - if (debug) { - r=getsockopt(fd,SOL_SOCKET,SO_RCVBUF,&p,&optlen); - printf("After setsockopt, SO_RCVBUF is %d\n",p); - } - } - --int SetTCPOpts(int fd) { -+int SetTCPOpts(int fd, int bufsize) { - int r,p,n; - socklen_t optlen; - -@@ -296,8 +307,7 @@ - r=getsockopt(fd,SOL_SOCKET,SO_SNDBUF,&p,&optlen); - printf("Before setsockopt, SO_SNDBUF is %d\n",p); - } -- n=512*1024; -- r=setsockopt(fd,SOL_SOCKET,SO_SNDBUF,&n,sizeof(n)); -+ r=setsockopt(fd,SOL_SOCKET,SO_SNDBUF,&bufsize,sizeof(bufsize)); - if (r<0) { log_error("setsockopt SO_SNDBUF"); } - if (debug) { - r=getsockopt(fd,SOL_SOCKET,SO_SNDBUF,&p,&optlen); |