Historic archive of defunct list bismark-commits@lists.bufferbloat.net
 help / color / mirror / Atom feed
* [Bismark-commits] rev 320 - trunk/device/src/shaperprobe
@ 2011-04-14 16:35 bismark
  0 siblings, 0 replies; only message in thread
From: bismark @ 2011-04-14 16:35 UTC (permalink / raw)
  To: bismark-commits

Author: bismark
Date: 2011-04-14 18:35:33 +0200 (Thu, 14 Apr 2011)
New Revision: 320

Modified:
   trunk/device/src/shaperprobe/Makefile
   trunk/device/src/shaperprobe/prober.c
   trunk/device/src/shaperprobe/tcp_client.c
   trunk/device/src/shaperprobe/tcpserver.c
Log:


Modified: trunk/device/src/shaperprobe/Makefile
===================================================================
--- trunk/device/src/shaperprobe/Makefile	2011-04-14 16:27:55 UTC (rev 319)
+++ trunk/device/src/shaperprobe/Makefile	2011-04-14 16:35:33 UTC (rev 320)
@@ -1,7 +1,7 @@
 
 CC=gcc
 
-CFLAGS=-c -Wall -O3 -fno-strict-aliasing
+CFLAGS=-c -Wall -O3 -fno-strict-aliasing -DOSX
 LDFLAGS=-lm
 
 SOURCES=prober.c tcp_client.c tcpserver.c wrappers.c tbdetect.c measflow.c

Modified: trunk/device/src/shaperprobe/prober.c
===================================================================
--- trunk/device/src/shaperprobe/prober.c	2011-04-14 16:27:55 UTC (rev 319)
+++ trunk/device/src/shaperprobe/prober.c	2011-04-14 16:35:33 UTC (rev 320)
@@ -59,6 +59,7 @@
 
 /* Global paremeters from config.  */
 unsigned int serverip = 0;
+unsigned short int serv_port = 0;
 unsigned int clientip = 0;
 
 unsigned int verbose = 0;
@@ -216,13 +217,20 @@
   int c = 0;
   opterr = 0;
 
+  serv_port = SERV_PORT_UDP;
   serverip = htonl(str2ip("143.215.131.173"));
   //serverip = htonl(str2ip("38.102.0.111"));
 
-  while ((c = getopt (argc, argv, "vh")) != -1)
+  while ((c = getopt (argc, argv, "s:p:vh")) != -1)
   {
   switch (c)
   {
+  case 's':
+	  serverip = htonl(str2ip(optarg));
+	  break;
+  case 'p':
+	  serv_port = atoi(optarg);
+	  break;
   case 'v':
 	  verbose = 1;
 	  break;
@@ -231,10 +239,13 @@
   case 'h':
   default:
 	  fprintf(stderr, "ShaperProbe beta candidate.\n\n");
-	  fprintf(stderr, "Usage: %s\n", argv[0]);
+	  fprintf(stderr, "Usage: %s -s <server>\n", argv[0]);
 	  return -1;
   }
   }
+  //printf("serv_port: %u\n",serv_port);
+  //printf("serverint: %u\n",serverip);
+  //exit(1);
   return 0;
 }
 
@@ -328,7 +339,8 @@
 
   memset(&from, 0, sizeof(from));
   from.sin_family      = PF_INET;
-  from.sin_port        = htons(SERV_PORT_UDP);
+  //from.sin_port        = htons(SERV_PORT_UDP);
+  from.sin_port        = htons(serv_port);
   from.sin_addr.s_addr = serverip;
 
   gettimeofday(&tv, NULL);
@@ -338,7 +350,8 @@
   //fp = fopen(filename, "w");
   //fprintf(fp, "sleep time resolution: %.2f ms.\n", sleepRes*1000);
 
-  udpsock = udpclient(serverip, SERV_PORT_UDP);
+  //udpsock = udpclient(serverip, SERV_PORT_UDP);
+  udpsock = udpclient(serverip, serv_port);
   CHKRET(udpsock);
   sin_addr.s_addr = serverip;
   printf("Connected to server %s.\n", inet_ntoa(sin_addr));

Modified: trunk/device/src/shaperprobe/tcp_client.c
===================================================================
--- trunk/device/src/shaperprobe/tcp_client.c	2011-04-14 16:27:55 UTC (rev 319)
+++ trunk/device/src/shaperprobe/tcp_client.c	2011-04-14 16:35:33 UTC (rev 320)
@@ -100,7 +100,9 @@
 {
 	int       conn_s;
 	struct    sockaddr_in servaddr;
-	short int port = SERV_PORT;
+	//short int port = SERV_PORT;
+	extern short int serv_port;
+	short int port = serv_port;
 	int ret = 0;
 	int sndsize = 1024*1024;
 	extern double TB_RATE_AVG_INTERVAL;

Modified: trunk/device/src/shaperprobe/tcpserver.c
===================================================================
--- trunk/device/src/shaperprobe/tcpserver.c	2011-04-14 16:27:55 UTC (rev 319)
+++ trunk/device/src/shaperprobe/tcpserver.c	2011-04-14 16:35:33 UTC (rev 320)
@@ -82,7 +82,9 @@
 int create_server()
 {
 	int list_s;
-	short int port = SERV_PORT;
+	//short int port = SERV_PORT;
+	extern short int serv_port;
+	short int port = serv_port;
 	struct sockaddr_in servaddr;
 	int optval = 1;
 	int ret = 0;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-15  0:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-14 16:35 [Bismark-commits] rev 320 - trunk/device/src/shaperprobe bismark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox