summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-10-05 10:24:01 +0200
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-10-05 10:35:25 +0200
commit5d11a6ad590133c92925c6162eb47b4401f16bef (patch)
tree6f73939f27f06cc575e1a90be8271172aa1362d8 /src/tools
parentae64a71552b956a2b6d77ecdbd5978043da1150f (diff)
downloadouroboros-5d11a6ad590133c92925c6162eb47b4401f16bef.tar.gz
ouroboros-5d11a6ad590133c92925c6162eb47b4401f16bef.zip
ipcpd, lib, irmd, tools: Change SDU to packet
This will change SDU (Service Data Unit) to packet everywhere. SDU is OSI terminology, whereas packet is Ouroboros terminology. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/ocbr/ocbr.c10
-rw-r--r--src/tools/ocbr/ocbr_client.c2
-rw-r--r--src/tools/ocbr/ocbr_server.c17
-rw-r--r--src/tools/oecho/oecho.c8
-rw-r--r--src/tools/operf/operf.c4
-rw-r--r--src/tools/operf/operf_client.c9
-rw-r--r--src/tools/oping/oping_client.c4
7 files changed, 28 insertions, 26 deletions
diff --git a/src/tools/ocbr/ocbr.c b/src/tools/ocbr/ocbr.c
index e2bd84af..12983da3 100644
--- a/src/tools/ocbr/ocbr.c
+++ b/src/tools/ocbr/ocbr.c
@@ -60,7 +60,7 @@ struct s {
static void usage(void)
{
printf("Usage: cbr [OPTION]...\n"
- "Sends SDUs from client to server at a constant bit rate.\n\n"
+ "Sends packets from client to server at a constant bit rate.\n\n"
" -l, --listen Run in server mode\n"
"\n"
"Server options:\n"
@@ -70,10 +70,10 @@ static void usage(void)
"Client options:\n"
" -n, --server_apn Specify the name of the server.\n"
" -d, --duration Duration for sending (s)\n"
- " -f, --flood Send SDUs as fast as possible\n"
- " -s, --size SDU size (B, max %ld B)\n"
+ " -f, --flood Send packets as fast as possible\n"
+ " -s, --size packet size (B, max %ld B)\n"
" -r, --rate Rate (b/s)\n"
- " --sleep Sleep in between sending SDUs\n"
+ " --sleep Sleep in between sending packets\n"
"\n\n"
" --help Display this help text and exit\n",
BUF_SIZE);
@@ -82,7 +82,7 @@ static void usage(void)
int main(int argc, char ** argv)
{
int duration = 60; /* One minute test */
- int size = 1000; /* 1000 byte SDUs */
+ int size = 1000; /* 1000 byte packets */
long rate = 1000000; /* 1 Mb/s */
bool flood = false;
bool sleep = false;
diff --git a/src/tools/ocbr/ocbr_client.c b/src/tools/ocbr/ocbr_client.c
index 026ab001..63b43721 100644
--- a/src/tools/ocbr/ocbr_client.c
+++ b/src/tools/ocbr/ocbr_client.c
@@ -155,7 +155,7 @@ int client_main(char * server,
ms = ts_diff_ms(&start, &end);
printf("sent statistics: "
- "%9ld SDUs, %12ld bytes in %9d ms, %4.4f Mb/s\n",
+ "%9ld packets, %12ld bytes in %9d ms, %4.4f Mb/s\n",
seqnr, seqnr * size, ms, (seqnr / (ms * 1000.0)) * size * 8.0);
flow_dealloc(fd);
diff --git a/src/tools/ocbr/ocbr_server.c b/src/tools/ocbr/ocbr_server.c
index 4f080eff..75983201 100644
--- a/src/tools/ocbr/ocbr_server.c
+++ b/src/tools/ocbr/ocbr_server.c
@@ -90,8 +90,8 @@ static void handle_flow(int fd)
bool stop = false;
- long sdus = 0;
- long sdus_intv = 0;
+ long packets = 0;
+ long packets_intv = 0;
long bytes_read = 0;
long bytes_read_intv = 0;
@@ -109,7 +109,7 @@ static void handle_flow(int fd)
if (count > 0) {
clock_gettime(CLOCK_REALTIME, &alive);
- sdus++;
+ packets++;
bytes_read += count;
}
@@ -121,17 +121,18 @@ static void handle_flow(int fd)
if (stop || ts_diff_ms(&now, &iv_end) < 0) {
long us = ts_diff_us(&iv_start, &now);
- printf("Flow %4d: %9ld SDUs (%12ld bytes) in %9ld ms"
- " => %9.4f p/s, %9.4f Mb/s\n",
+ printf("Flow %4d: %9ld packets (%12ld bytes) in %9ld ms"
+ " => %9.4f pps, %9.4f Mbps\n",
fd,
- sdus - sdus_intv,
+ packets - packets_intv,
bytes_read - bytes_read_intv,
us / 1000,
- ((sdus - sdus_intv) / (double) us) * MILLION,
+ ((packets - packets_intv) / (double) us)
+ * MILLION,
8 * ((bytes_read - bytes_read_intv)
/ (double)(us)));
iv_start = iv_end;
- sdus_intv = sdus;
+ packets_intv = packets;
bytes_read_intv = bytes_read;
ts_add(&iv_start, &intv, &iv_end);
}
diff --git a/src/tools/oecho/oecho.c b/src/tools/oecho/oecho.c
index cc173988..b6a74aa5 100644
--- a/src/tools/oecho/oecho.c
+++ b/src/tools/oecho/oecho.c
@@ -72,7 +72,7 @@ static int server_main(void)
count = flow_read(fd, &buf, BUF_SIZE);
if (count < 0) {
- printf("Failed to read SDU.\n");
+ printf("Failed to read packet.\n");
flow_dealloc(fd);
continue;
}
@@ -80,7 +80,7 @@ static int server_main(void)
printf("Message from client is %.*s.\n", (int) count, buf);
if (flow_write(fd, buf, count) == -1) {
- printf("Failed to write SDU.\n");
+ printf("Failed to write packet.\n");
flow_dealloc(fd);
continue;
}
@@ -105,14 +105,14 @@ static int client_main(void)
}
if (flow_write(fd, message, strlen(message) + 1) < 0) {
- printf("Failed to write SDU.\n");
+ printf("Failed to write packet.\n");
flow_dealloc(fd);
return -1;
}
count = flow_read(fd, buf, BUF_SIZE);
if (count < 0) {
- printf("Failed to read SDU.\n");
+ printf("Failed to read packet.\n");
flow_dealloc(fd);
return -1;
}
diff --git a/src/tools/operf/operf.c b/src/tools/operf/operf.c
index 137e8647..92555c23 100644
--- a/src/tools/operf/operf.c
+++ b/src/tools/operf/operf.c
@@ -119,8 +119,8 @@ static void usage(void)
" -d, --duration Test duration (default 60s)\n"
" -r, --rate Rate (b/s)\n"
" -s, --size Payload size (B, default 1500)\n"
- " -f, --flood Send SDUs as fast as possible\n"
- " --sleep Sleep in between sending SDUs\n"
+ " -f, --flood Send packets as fast as possible\n"
+ " --sleep Sleep in between sending packets\n"
"\n"
" --help Display this help text and exit\n");
}
diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c
index c8873c54..6862944e 100644
--- a/src/tools/operf/operf_client.c
+++ b/src/tools/operf/operf_client.c
@@ -120,11 +120,12 @@ void * writer(void * o)
msg = (struct msg *) buf;
if (client.flood)
- printf("Flooding %s with %d byte SDUs for %d seconds.\n\n",
+ printf("Flooding %s with %d byte packets for %d seconds.\n\n",
client.server_name, client.size,
client.duration / 1000);
else
- printf("Sending %d byte SDUs for %d s to %s at %.3lf Mb/s.\n\n",
+ printf("Sending %d byte packets for %d s to %s "
+ "at %.3lf Mb/s.\n\n",
client.size, client.duration / 1000,
client.server_name,
client.rate / (double) MILLION);
@@ -141,7 +142,7 @@ void * writer(void * o)
msg->id = client.sent;
if (flow_write(*fdp, buf, client.size) == -1) {
- printf("Failed to send SDU.\n");
+ printf("Failed to send packet.\n");
flow_dealloc(*fdp);
free(buf);
return (void *) -1;
@@ -225,7 +226,7 @@ int client_main(void)
printf("\n");
printf("--- %s perf statistics ---\n", client.server_name);
- printf("%ld SDUs transmitted, ", client.sent);
+ printf("%ld packets transmitted, ", client.sent);
printf("%ld received, ", client.rcvd);
printf("%ld%% packet loss, ", client.sent == 0 ? 0 :
100 - ((100 * client.rcvd) / client.sent));
diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c
index 0f7695b5..a978e659 100644
--- a/src/tools/oping/oping_client.c
+++ b/src/tools/oping/oping_client.c
@@ -176,7 +176,7 @@ void * writer(void * o)
msg->tv_nsec = now.tv_nsec;
if (flow_write(*fdp, buf, client.size) == -1) {
- printf("Failed to send SDU.\n");
+ printf("Failed to send packet.\n");
flow_dealloc(*fdp);
free(buf);
return (void *) -1;
@@ -253,7 +253,7 @@ static int client_main(void)
printf("\n");
printf("--- %s ping statistics ---\n", client.s_apn);
- printf("%d SDUs transmitted, ", client.sent);
+ printf("%d packets transmitted, ", client.sent);
printf("%d received, ", client.rcvd);
printf("%zd out-of-order, ", client.ooo);
printf("%.0lf%% packet loss, ", client.sent == 0 ? 0 :