From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-21-ewr.dyndns.com (mxout-115-ewr.mailhop.org [216.146.33.115]) by lists.bufferbloat.net (Postfix) with ESMTP id 7F34D2E06FF for ; Thu, 14 Apr 2011 17:48:52 -0700 (PDT) Received: from scan-22-ewr.mailhop.org (scan-22-ewr.local [10.0.141.244]) by mail-21-ewr.dyndns.com (Postfix) with ESMTP id DEC91132D for ; Thu, 14 Apr 2011 16:32:01 +0000 (UTC) X-Spam-Score: 0.1 () X-Mail-Handler: MailHop by DynDNS X-Originating-IP: 143.225.229.147 Received: from svn.comics.unina.it (unknown [143.225.229.147]) by mail-21-ewr.dyndns.com (Postfix) with ESMTP id 3B01610A1 for ; Thu, 14 Apr 2011 16:31:56 +0000 (UTC) Received: from www-data by svn.comics.unina.it with local (Exim 4.69) (envelope-from ) id 1QAPW1-0001Qh-6o for bismark-commits@lists.bufferbloat.net; Thu, 14 Apr 2011 18:35:33 +0200 To: bismark-commits@lists.bufferbloat.net From: bismark@svn.comics.unina.it Message-Id: Date: Thu, 14 Apr 2011 18:35:33 +0200 Subject: [Bismark-commits] rev 320 - trunk/device/src/shaperprobe X-BeenThere: bismark-commits@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Commit log for the bismark source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 00:48:52 -0000 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 \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;