From owner-svn-ports-all@FreeBSD.ORG Thu Sep 12 11:40:31 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77F2E9A9; Thu, 12 Sep 2013 11:40:31 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 654472B6D; Thu, 12 Sep 2013 11:40:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8CBeV0M073174; Thu, 12 Sep 2013 11:40:31 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8CBeUPF073148; Thu, 12 Sep 2013 11:40:30 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201309121140.r8CBeUPF073148@svn.freebsd.org> From: Dmitry Morozovsky Date: Thu, 12 Sep 2013 11:40:30 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r327054 - head/net-mgmt/ehnt/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2013 11:40:31 -0000 Author: marck (doc committer) Date: Thu Sep 12 11:40:30 2013 New Revision: 327054 URL: http://svnweb.freebsd.org/changeset/ports/327054 Log: Complete r326363 by including more complete set of headers. Fix one incorrecr usage of perror(3). No functional changes. Notified by: pkg-fallout Modified: head/net-mgmt/ehnt/files/patch-ehnt.h head/net-mgmt/ehnt/files/patch-ehnt__client.c head/net-mgmt/ehnt/files/patch-ehntserv.c Modified: head/net-mgmt/ehnt/files/patch-ehnt.h ============================================================================== --- head/net-mgmt/ehnt/files/patch-ehnt.h Thu Sep 12 11:34:39 2013 (r327053) +++ head/net-mgmt/ehnt/files/patch-ehnt.h Thu Sep 12 11:40:30 2013 (r327054) @@ -1,9 +1,17 @@ $FreeBSD$ ---- ehnt.h.orig Thu Oct 4 22:18:29 2001 -+++ ehnt.h Wed Jun 23 14:35:08 2004 -@@ -59,6 +59,7 @@ +--- ehnt.h.orig ++++ ehnt.h +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -59,6 +60,7 @@ struct ehnt_stats { double InBoundTotal, OutBoundTotal; @@ -11,7 +19,7 @@ $FreeBSD$ double *InBoundSrcAS, *InBoundDstAS, *OutBoundSrcAS, *OutBoundDstAS; double *InBoundProto, *OutBoundProto; double *InBoundSrcTcpPort, *InBoundDstTcpPort, -@@ -93,7 +94,7 @@ +@@ -93,7 +95,7 @@ int ProcessFlow(struct flow_ver5_rec *, struct in_addr *, struct ehnt_struct *); int Init_ASN_Lookups(void); char * ASN_Lookup(int); Modified: head/net-mgmt/ehnt/files/patch-ehnt__client.c ============================================================================== --- head/net-mgmt/ehnt/files/patch-ehnt__client.c Thu Sep 12 11:34:39 2013 (r327053) +++ head/net-mgmt/ehnt/files/patch-ehnt__client.c Thu Sep 12 11:40:30 2013 (r327054) @@ -3,17 +3,19 @@ $FreeBSD$ --- ehnt_client.c.orig +++ ehnt_client.c -@@ -27,6 +27,9 @@ +@@ -27,6 +27,11 @@ static void sig_int (int); char getkey(); + +ssize_t read_n(int fd, void *vptr, size_t n); + ++void ehnt_client_processmessage(int sockfd,struct in_addr routeraddr, struct ehnt_struct *my_ehnt_struct); ++ int ehnt_client(char * servername, int serverport, struct ehnt_struct *my_ehnt_struct ) { char ips[100]; int c; -@@ -69,7 +72,8 @@ +@@ -69,7 +74,8 @@ printf("Warning: can't catch interrupt signal\n"); } fflush(stdout); @@ -23,7 +25,7 @@ $FreeBSD$ setbuf(stdout,NULL); for ( ; ; ) { -@@ -78,7 +82,8 @@ +@@ -78,7 +84,8 @@ int maxfd=sockfd; FD_ZERO(&read_fds); @@ -33,7 +35,7 @@ $FreeBSD$ FD_SET(sockfd,&read_fds); fflush(stdout); -@@ -89,7 +94,7 @@ +@@ -89,7 +96,7 @@ if (FD_ISSET(sockfd,&read_fds)) { ehnt_client_processmessage(sockfd,routeraddr,my_ehnt_struct); } @@ -42,7 +44,7 @@ $FreeBSD$ char key; key=getkey(); switch (key) { -@@ -125,7 +130,7 @@ +@@ -125,7 +132,7 @@ } /* for ( ; ; ) */ } Modified: head/net-mgmt/ehnt/files/patch-ehntserv.c ============================================================================== --- head/net-mgmt/ehnt/files/patch-ehntserv.c Thu Sep 12 11:34:39 2013 (r327053) +++ head/net-mgmt/ehnt/files/patch-ehntserv.c Thu Sep 12 11:40:30 2013 (r327054) @@ -1,9 +1,23 @@ $FreeBSD$ ---- ehntserv.c.orig Thu Oct 4 22:18:29 2001 -+++ ehntserv.c Fri May 30 14:16:22 2003 -@@ -33,8 +33,8 @@ +--- ehntserv.c.orig ++++ ehntserv.c +@@ -23,9 +23,13 @@ + #include + #include + #include ++#include + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include "config.h" +@@ -33,8 +37,8 @@ #define MAXCLIENTS 256 #define MAXPACKET 8192 @@ -14,7 +28,7 @@ $FreeBSD$ int debug; int use_syslog; -@@ -54,6 +54,8 @@ +@@ -54,6 +58,8 @@ int packetcounter=0; extern char *optarg; int c_udpport, c_tcpport; @@ -23,7 +37,7 @@ $FreeBSD$ debug=0; use_syslog=0; -@@ -61,7 +63,7 @@ +@@ -61,7 +67,7 @@ c_udpport=DEFAULT_UDP_PORT; c_tcpport=DEFAULT_TCP_PORT; @@ -32,21 +46,20 @@ $FreeBSD$ switch(c) { case 'u': -@@ -70,6 +72,13 @@ +@@ -70,6 +76,12 @@ 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); ++ err(1, "too low buffer size or bad format: %s", optarg); + } + break; case 'd': debug=1; break; -@@ -77,6 +86,7 @@ +@@ -77,6 +89,7 @@ printf("Usage: %s [ -u ] [ -t ]\n",argv[0]); printf(" -u Listen on UDP port for netflow packets. Default %d\n",DEFAULT_UDP_PORT); printf(" -t Listen on TCP port for client connections. Default %d\n",DEFAULT_TCP_PORT); @@ -54,7 +67,7 @@ $FreeBSD$ 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 @@ +@@ -87,22 +100,22 @@ /* set up the netflow udp socket */ if ( (nf_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) @@ -81,7 +94,7 @@ $FreeBSD$ 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 @@ +@@ -112,9 +125,9 @@ setsockopt(l_fd, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one)); } if ( bind(l_fd,(struct sockaddr *) &l_servaddr, sizeof(l_servaddr)) < 0) @@ -93,7 +106,7 @@ $FreeBSD$ 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 @@ +@@ -157,7 +170,7 @@ } if ( (c=select(maxfd+1,&read_fds,NULL,NULL,NULL)) < 0) @@ -102,7 +115,7 @@ $FreeBSD$ if (FD_ISSET(nf_fd,&read_fds)) { /*a netflow message is waiting*/ -@@ -168,7 +178,7 @@ +@@ -168,7 +181,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) @@ -111,7 +124,7 @@ $FreeBSD$ /* 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 @@ +@@ -189,7 +202,7 @@ timeout.tv_sec=0; timeout.tv_usec=0; if ( (c=select(maxfd+1,NULL,&write_fds,NULL,&timeout)) < 0) @@ -120,7 +133,7 @@ $FreeBSD$ for (i=0; i 0) { if (FD_ISSET(l_clients[i],&write_fds)) { -@@ -215,14 +225,14 @@ +@@ -215,14 +228,14 @@ if (FD_ISSET(l_fd,&read_fds)) { /*we have a new TCP client*/ int l_connfd,new_index=-1; socklen_t l_addrlen; @@ -139,7 +152,7 @@ $FreeBSD$ for (i=0; i