Historic archive of defunct list bismark-commits@lists.bufferbloat.net
 help / color / mirror / Atom feed
From: bismark@svn.comics.unina.it
To: bismark-commits@lists.bufferbloat.net
Subject: [Bismark-commits] rev 320 - trunk/device/src/shaperprobe
Date: Thu, 14 Apr 2011 18:35:33 +0200	[thread overview]
Message-ID: <E1QAPW1-0001Qh-6o@svn.comics.unina.it> (raw)

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;


                 reply	other threads:[~2011-04-15  0:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1QAPW1-0001Qh-6o@svn.comics.unina.it \
    --to=bismark@svn.comics.unina.it \
    --cc=bismark-commits@lists.bufferbloat.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox