summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-09-17 12:53:48 +0100
committerFrediano Ziglio <fziglio@redhat.com>2016-09-17 12:53:48 +0100
commitaab04f83c687871c9da1315a2a459ed1d895017a (patch)
tree0ab7e2d7d030864d49055928f7e2ae7dd8cd3c39
parentd9f97dfd841c5627ed6a7c3c22ef8ee8908c111e (diff)
Produce manual page using README.md and ronn utility
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--.gitignore1
-rw-r--r--Makefile12
-rw-r--r--README.md27
3 files changed, 27 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index 46186f0..383cda7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
latency
+latency.1
diff --git a/Makefile b/Makefile
index 13e8a92..6b6a7c1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,22 @@
CFLAGS ?= -O2 -Wall -g
CC ?= gcc
INSTDIR=/usr/local/bin
+MANDIR=/usr/local/share/man/man1
+
+all: latency latency.1
latency: latency.c tun.c utils.c
$(CC) $(CFLAGS) -o $@ $^ -pthread
+latency.1: README.md
+ ronn < $< > $@
+
clean::
- rm -f latency
+ rm -f latency latency.1
-install:: latency
+install:: latency latency.1
umask 022 && cp $< $(INSTDIR)
chown root: $(INSTDIR)/$<
chmod 4751 $(INSTDIR)/$<
+ cp latency.1 $(MANDIR)/latency.1
+ chown root: $(MANDIR)/latency.1
diff --git a/README.md b/README.md
index f3481a0..284288d 100644
--- a/README.md
+++ b/README.md
@@ -1,23 +1,26 @@
-latency
-=======
+latency (1) -- Utility to help test network latency/bandwidth problems
+======================================================================
-Utility to help test network latency/bandwidth problems.
+## SYNOPSIS
+
+ `latency` *delay* *bandwidth* [`--client` *server_ip*] [*OPTION*]
+or
+ `latency` `--server` [*OPTION*]
+
+## DESCRIPTION
This project provide an utility to help testing environments
with high latency and low bandwidth.
Currently requires root privileges as use tun/tap.
-Syntax:
- `latency` *delay* *bandwidth* [`--client` *server_ip*] [*OPTION*]
-or
- `latency` `--server` [*OPTION*]
+## OPTIONS
-Options:
-
- * `--port` *port* specify the port to use for client/server.
+ * `--port` *port*:
+ specify the port to use for client/server.
The default is `61234`.
- * `--help` show usage help.
+ * `--help`:
+ show usage help.
For delay you can specify **ms** (milliseconds, default) or **s**
(seconds) for unit.
@@ -37,6 +40,8 @@ All numbers can be decimal, for instance:
$ latency 10ms 2.3M
```
+## USAGE
+
Currently connecting to 192.168.127.1 allows to connect to
the local machine with the connection modified as specified.