commit: r585 - trunk/daemon

[email protected] Thu, 08 Aug 2013 10:31:37 -0400
Newsgroups gmane.network.spread.cvs
Message-ID <[email protected]>
Author: jschultz
Date: 2013-08-08 10:31:37 -0400 (Thu, 08 Aug 2013)
New Revision: 585

Modified:
   trunk/daemon/r.c
   trunk/daemon/s.c
Log:
Make s and r use int16u's for ports


Modified: trunk/daemon/r.c
===================================================================
--- trunk/daemon/r.c	2013-08-08 14:30:43 UTC (rev 584)
+++ trunk/daemon/r.c	2013-08-08 14:31:37 UTC (rev 585)
@@ -49,7 +49,7 @@
 #endif	/* ARCH_PC_WIN95 */
 
 static	char	IP[16];
-static	int16	Port;
+static	int16u	Port;
 static	int32	Address;
 static 	int32	Interface_addr;
 static	int	Detailed_report;
@@ -95,7 +95,7 @@
 	corrupt = 0;
 	total_missed = 0;
 
-printf("Ready to receive on port %d\n", Port );
+printf("Ready to receive on port %hu\n", Port );
 
 	for(i=0; ; i++ )
 	{
@@ -168,7 +168,7 @@
 			Detailed_report = 1;
 			argc--;
 		}else if( !strncmp( *argv, "-p", 2 ) ){
-			sscanf(argv[1], "%hd", &Port );
+			sscanf(argv[1], "%hu", &Port );
 			argc--; argv++;
                 }else if( !strncmp( *argv, "-a", 2 ) ){
 			sscanf(argv[1], "%s", IP );

Modified: trunk/daemon/s.c
===================================================================
--- trunk/daemon/s.c	2013-08-08 14:30:43 UTC (rev 584)
+++ trunk/daemon/s.c	2013-08-08 14:31:37 UTC (rev 585)
@@ -52,7 +52,7 @@
 static  int     Num_bytes;
 static  int     Num_packets;
 static	char	IP[16];
-static	int16	Port;
+static	int16u	Port;
 static	sp_time	Delay;
 static	int	Burst;
 
@@ -93,7 +93,7 @@
 	sscanf( IP ,"%d.%d.%d.%d",&i1, &i2, &i3, &i4);
 	address = ( (i1 << 24 ) | (i2 << 16) | (i3 << 8) | i4 );
 
-	printf("Checking (%d.%d.%d.%d, %d). Each burst has %d packets, %d bytes each with %ld msec delay in between, for a total of %d packets\n",i1,i2,i3,i4, Port, Burst, Num_bytes, Delay.usec/1000+Delay.sec*1000, Num_packets );
+	printf("Checking (%d.%d.%d.%d, %hu). Each burst has %d packets, %d bytes each with %ld msec delay in between, for a total of %d packets\n",i1,i2,i3,i4, Port, Burst, Num_bytes, Delay.usec/1000+Delay.sec*1000, Num_packets );
 
 	type  = (int32 *)buf;
 	count = (int32 *)&buf[4];
@@ -152,7 +152,7 @@
 			}
 			argc--; argv++;
 		}else if( !strncmp( *argv, "-p", 2 ) ){
-			sscanf(argv[1], "%hd", &Port );
+			sscanf(argv[1], "%hu", &Port );
 			argc--; argv++;
 		}else if( !strncmp( *argv, "-b", 2 ) ){
 			sscanf(argv[1], "%d", &Burst );