summaryrefslogtreecommitdiff
path: root/src/tools/ocbr/ocbr_server.c
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/ocbr/ocbr_server.c
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/ocbr/ocbr_server.c')
-rw-r--r--src/tools/ocbr/ocbr_server.c17
1 files changed, 9 insertions, 8 deletions
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);
}