summaryrefslogtreecommitdiff
path: root/src/tools/cbr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/cbr')
-rw-r--r--src/tools/cbr/cbr.c9
-rw-r--r--src/tools/cbr/cbr_client.c2
-rw-r--r--src/tools/cbr/cbr_server.c9
3 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/cbr/cbr.c b/src/tools/cbr/cbr.c
index 2317cd62..d7077e9c 100644
--- a/src/tools/cbr/cbr.c
+++ b/src/tools/cbr/cbr.c
@@ -31,10 +31,7 @@
#include <stdbool.h>
#define SERVER_AP_NAME "cbr-server"
-#define CLIENT_AP_NAME "echo-client"
-
-#define MILLION 1000000
-#define BILLION 1000000000
+#define CLIENT_AP_NAME "cbr-client"
#define BUF_SIZE 1500
@@ -92,7 +89,7 @@ int main(int argc, char ** argv)
duration = strtol(*(++argv), &rem, 10);
--argc;
} else if (strcmp(*argv, "-s") == 0 ||
- strcmp(*argv, "--size") == 0) {
+ strcmp(*argv, "--size") == 0) {
size = strtol(*(++argv), &rem, 10);
--argc;
} else if (strcmp(*argv, "-r") == 0 ||
@@ -106,7 +103,7 @@ int main(int argc, char ** argv)
rate *= BILLION;
--argc;
} else if (strcmp(*argv, "-l") == 0 ||
- strcmp(*argv, "--listen") == 0) {
+ strcmp(*argv, "--listen") == 0) {
server = true;
} else {
usage();
diff --git a/src/tools/cbr/cbr_client.c b/src/tools/cbr/cbr_client.c
index 7b8e8b3f..330cfa43 100644
--- a/src/tools/cbr/cbr_client.c
+++ b/src/tools/cbr/cbr_client.c
@@ -31,7 +31,7 @@ int client_main(int duration, int size, long rate)
bool stop = false;
char buf[size];
long seqnr = 0;
- long long gap = size * 8 * (BILLION / rate); /* ns */
+ unsigned long gap = size * 8 * (BILLION / rate); /* ns */
struct timespec start;
struct timespec end;
diff --git a/src/tools/cbr/cbr_server.c b/src/tools/cbr/cbr_server.c
index 14791bd4..553f954d 100644
--- a/src/tools/cbr/cbr_server.c
+++ b/src/tools/cbr/cbr_server.c
@@ -116,12 +116,15 @@ int server_main()
{
int server_fd = 0;
int client_fd = 0;
- char * dif = DIF_NAME;
+
+ char * dif = DIF_NAME;
char * client_name = NULL;
- int i = 0;
+
+ int i = 0;
+
pthread_t * threads = malloc(sizeof(*threads) * 10);
if (threads == NULL)
- exit(1);
+ EXIT_FAILURE;
printf("Server started, interval is %ld s, timeout is %ld s.\n",
server_settings.interval, server_settings.timeout);