summaryrefslogtreecommitdiffstats
path: root/docs/interfacing/cpp/index.rst
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-10-13 12:40:42 +0200
committerDave Wallace <dwallacelf@gmail.com>2021-10-13 23:22:32 +0000
commitcbb4e460c481223282774b37add0bf9fb9e6170a (patch)
treec4d6490e725806088e397bf7bc0daf05e4ab5374 /docs/interfacing/cpp/index.rst
parent9ad39c026c8a3c945a7003c4aa4f5cb1d4c80160 (diff)
docs: C & C++ apis examples
Type: docs Change-Id: I5b6c388332bdd3a29777d728c3357816c8411ea2 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'docs/interfacing/cpp/index.rst')
-rw-r--r--docs/interfacing/cpp/index.rst26
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/interfacing/cpp/index.rst b/docs/interfacing/cpp/index.rst
new file mode 100644
index 00000000000..8351e9c504a
--- /dev/null
+++ b/docs/interfacing/cpp/index.rst
@@ -0,0 +1,26 @@
+.. _cppvpp:
+
+==============
+C++ api client
+==============
+
+This describes how to write a C++ api client connecting to VPP's binary API.
+
+Connecting to VPP is done with :
+
+::
+
+ auto err = con.connect("example_client", nullptr, 32, 32);
+
+
+You can specify the path to the api socket/shared memory you want to connect to
+with the second parameter (set to ``nullptr``, meaning default)
+
+.. literalinclude:: ./api_example/api_example.cc
+ :language: cpp
+
+To build this you could use the following makefile
+
+.. literalinclude:: ./api_example/Makefile
+ :language: makefile
+