aboutsummaryrefslogtreecommitdiffstats
path: root/extras/libmemif/examples
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2017-09-27 15:09:48 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-09-28 01:04:56 +0000
commit64ebb5ff1338140d94c7f9ee72138fe84d89de2e (patch)
tree338f13adac0036599943061d2fabfd673479643e /extras/libmemif/examples
parent4ff586d1c6fc5c40e1548cd6f221a8a7f3ad033b (diff)
General documentation updates
- We now have several developer-focused docs, so create an index page for them. - Rework several docs to fit into the index structure. - Experiment with code highlighting; tweak the CSS slightly to make it slightly nicer to look at. Change-Id: I4185a18f84fa0764745ca7a3148276064a3155c6 Signed-off-by: Chris Luke <chrisy@flirble.org>
Diffstat (limited to 'extras/libmemif/examples')
-rw-r--r--extras/libmemif/examples/README.md16
-rw-r--r--extras/libmemif/examples/example_setup_doc.md (renamed from extras/libmemif/examples/ExampleSetup.md)7
-rw-r--r--extras/libmemif/examples/examples_doc.md18
3 files changed, 22 insertions, 19 deletions
diff --git a/extras/libmemif/examples/README.md b/extras/libmemif/examples/README.md
deleted file mode 100644
index 1375d27abae..00000000000
--- a/extras/libmemif/examples/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-## Examples
-
-After build, root folder will contain scripts linking binary examples with library (same name as example apps). These scripts can be executed to run example apps without installing the library. Example apps binaries can be found in _libs_ filder. To run binaries directly, make sure that libmemif library is installed.
-
-#### Run in container
-ligato/libmemif-sample-service image contains built and installed libmemf. To run different examples, override docker CMD to start container in bash:
-```
-# docker run -it --entrypoint=/bin/bash -i --rm --name icmp-responder --hostname icmp-responder --privileged -v "/run/vpp/:/run/vpp/" ligato/libmemif-sample-service
-```
-Current WORKDIR is set to root repository directory. Example apps can be run from this directory (a script linking binary with library), or browse to ./.libs folder and execute binary directly.
-
-Example app | Description
-------------|------------
-[icmpr](../examples/icmp_responder/main.c) | Simplest implementaion. Event polling is handled by libmemif. Single memif conenction in slave mode is created (id 0). Use Ctrl + C to exit app. Memif receive mode: interrupt.
-[icmpr-epoll](../examples/icmp_responder-epoll/main.c) (run in container by default) | Supports multiple connections and master mode. User can create/delete connections, set ip addresses, print connection information. [Example setup](ExampleSetup.md) contains instructions on basic connection use cases setups. Memif receive mode: interrupt. App provides functionality to disable interrupts for specified queue/s for testing purposes. Polling mode is not implemented in this example.
-[icmpr-mt](../examples/icmp_responder-mt/main.c) | Multi-thread example, very similar to icmpr-epoll. Packets are handled in threads assigned to specific queues. Slave mode only. Memif receive mode: polling (memif_rx_poll function), interrupt (memif_rx_interrupt function). Receive modes differ per queue.
diff --git a/extras/libmemif/examples/ExampleSetup.md b/extras/libmemif/examples/example_setup_doc.md
index a02506dd0ca..89a0b10e2f8 100644
--- a/extras/libmemif/examples/ExampleSetup.md
+++ b/extras/libmemif/examples/example_setup_doc.md
@@ -1,11 +1,12 @@
-## Example setup
+## Example setup {#libmemif_example_setup_doc}
#### VPP-memif master icmp_responder slave
-> Libmemif example app(s) use memif default socket file: /run/vpp/memif.sock.
+> Libmemif example app(s) use memif default socket file: `/run/vpp/memif.sock`.
Run VPP and icmpr-epoll example (default example when running in container).
-> Other examples work similar to icmpr-epoll. Brief explanation can be found in [Examples readme](README.md) file.
+
+> Other examples work similar to icmpr-epoll. Brief explanation can be found in @ref libmemif_examples_doc .
VPP-side config:
```
diff --git a/extras/libmemif/examples/examples_doc.md b/extras/libmemif/examples/examples_doc.md
new file mode 100644
index 00000000000..11937c576fb
--- /dev/null
+++ b/extras/libmemif/examples/examples_doc.md
@@ -0,0 +1,18 @@
+## Examples {#libmemif_examples_doc}
+
+After build, root folder will contain scripts linking binary examples with library (same name as example apps). These scripts can be executed to run example apps without installing the library. Example apps binaries can be found in _libs_ filder. To run binaries directly, make sure that libmemif library is installed.
+
+#### Run in container
+
+`ligato/libmemif-sample-service` image contains built and installed libmemf. To run different examples, override docker CMD to start container in bash:
+
+```
+# docker run -it --entrypoint=/bin/bash -i --rm --name icmp-responder --hostname icmp-responder --privileged -v "/run/vpp/:/run/vpp/" ligato/libmemif-sample-service
+```
+Current WORKDIR is set to root repository directory. Example apps can be run from this directory (a script linking binary with library), or browse to `./.libs` folder and execute binary directly.
+
+Example app | Description
+------------|------------
+@ref extras/libmemif/examples/icmp_responder | Simplest implementaion. Event polling is handled by libmemif. Single memif conenction in slave mode is created (id 0). Use Ctrl + C to exit app. Memif receive mode: interrupt.
+@ref extras/libmemif/examples/icmp_responder-epoll (run in container by default) | Supports multiple connections and master mode. User can create/delete connections, set ip addresses, print connection information. @ref libmemif_example_setup_doc contains instructions on basic connection use cases setups. Memif receive mode: interrupt. App provides functionality to disable interrupts for specified queue/s for testing purposes. Polling mode is not implemented in this example.
+@ref extras/libmemif/examples/icmp_responder-mt) | Multi-thread example, very similar to icmpr-epoll. Packets are handled in threads assigned to specific queues. Slave mode only. Memif receive mode: polling (memif_rx_poll function), interrupt (memif_rx_interrupt function). Receive modes differ per queue.