aboutsummaryrefslogtreecommitdiffstats
path: root/docs/interfacing/cpp/index.rst
blob: 8351e9c504a43dac1bea1be7ddf87f29d7eb5244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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