summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/client/client.c
AgeCommit message (Collapse)AuthorFilesLines
2021-09-28api: API trace improvementsFilip Tehlar1-8/+0
Type: improvement * add support for JSON format in API trace * add ability to replay JSON API trace in both VPP and VAT2 * use CRC for backward compatibility check during JSON API replay * fix API trace CLI (and remove duplicits) * remove custom dump * remove vppapitrace.py * update docs accordingly Change-Id: I5294f68bebe6cbe738630f457f3a87720e06486b Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2021-09-28misc: vpe.api messages dynamically allocatedOle Troan1-11/+5
This is the last in the series of moving API messages from vpp/api/vpe.api to vlibmemory/memclnt.api. This patch makes the remaining vpe.api messages dynamic, to help VAT2 binary-api command. Moves the VAT test code to a separate file and removes the now unnused API meta files. Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I01dd78eaff1d3715dff17d2643bf0f7f0089935b Signed-off-by: Ole Troan <ot@cisco.com>
2021-03-26vlib: split vlib_main_t into global and per-threadDamjan Marion1-3/+0
Type: refactor Change-Id: I8b273bc3bf16aa360f031f1b2692f766e5fc4613 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-02-16vapi: add dedicated return code for client timeoutPaul Vinciguerra1-4/+7
Type: refactor Change-Id: I1fbabb743f20e21557c69bdaf97eda6f63584903 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-11-25api: vat2 and json autogeneration for api messagesOle Troan1-3/+3
VAT2: A completely auto-generated replacement of VAT. Reads input message in JSON from stdin and outputs received messages in JSON. A VAT2 plugin is automatically built for a .api file. There no longer a need for a separate _test.c. Example: vat2 show_version {} { "_msgname": "show_version_reply", "retval": 0, "program": "vpe", "version": "21.01-rc0~411-gf6eb348a6", "build_date": "2020-11-19T09:49:25", "build_directory": "/vpp/autogen3" } vat2 sw_interface_dump '{"sw_if_index": -1, "name_filter_valid": 0, "name_filter": ""}' [{ "_msgname": "sw_interface_details", "sw_if_index": 0, "sup_sw_if_index": 0, "l2_address": "00:00:00:00:00:00", "flags": "Invalid ENUM", "type": "IF_API_TYPE_HARDWARE", "link_duplex": "LINK_DUPLEX_API_UNKNOWN", "link_speed": 0, "link_mtu": 0, "mtu": [0, 0, 0, 0], "sub_id": 0, "sub_number_of_tags": 0, "sub_outer_vlan_id": 0, "sub_inner_vlan_id": 0, "sub_if_flags": "Invalid ENUM", "vtr_op": 0, "vtr_push_dot1q": 0, "vtr_tag1": 0, "vtr_tag2": 0, "outer_tag": 0, "b_dmac": "00:00:00:00:00:00", "b_smac": "00:00:00:00:00:00", "b_vlanid": 0, "i_sid": 0, "interface_name": "local0", "interface_dev_type": "local", "tag": "" }] This is the first phase and vat2 is not integrated in packaging yet. Type: feature Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ib45ddeafb180ea7da8c5dc274a9274d7a4edc876 Signed-off-by: Ole Troan <ot@cisco.com>
2020-10-07api: add heap alloc to vpp statsOle Troan1-0/+6
The Python VPP Stats module also used the VPP heap. Fix so it now explicitly allocates a heap. Fixes: f68fccfe7e188fec2c9f91da38ca9acf6f67d811 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I0bd4ae64d6c89cdf634d8d9a91c23ab38017c5cc Signed-off-by: Ole Troan <ot@cisco.com>
2020-09-28api: remove clib_mem_init from vppapiclient contructorOle Troan1-24/+16
Having the constructor in the vppapiclient library led to conflicts with applications wanting to allocate their own heap. Note: Change of behaviour, applications that do not use a CLIB heap must now call vac_mem_init() before using any functions from vppapiclient. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ib155a54579ea5a0dbc26cb4b6daca1274e1dfdfa
2020-02-11vppinfra: remove the historical mheap memory allocatorDave Barach1-11/+0
The mheap allocator has been turned off for several releases. This commit removes the cmake config parameter, parallel support for dlmalloc and mheap, and the mheap allocator itself. Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I104f88a1f06e47e90e5f7fb3e11cd1ca66467903
2019-12-10api: multiple connections per processDave Barach1-10/+10
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-11-27misc: add address sanitizer heap instrumentationBenoît Ganne1-0/+2
Introduce AddressSanitizer support: https://github.com/google/sanitizers/ This starts with heap instrumentation. vlib_buffer, bihash and stack instrumentation should follow. Type: feature Change-Id: I7f20e235b2f79db72efd0e756f22c75f717a9884 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-06-25api: fix vac_read return codesPaul Vinciguerra1-2/+4
- vac_read was returning the same code for multiple errors. - Refactor VppTransportShmemIOError to capture rv and description. Type: refactor Change-Id: Ifb8ca5ff679f658bcd92a43ecddaffd2fc18dbd5 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-04-16API: Handle pthread cond signal case where signal is missed.Ole Troan1-1/+8
Especially on a single core setup the RX thread could signal the main thread that it was done, before main thread listened to the signal. Change-Id: Ib70337b21bcf77787ce4ee0aa9cf80c6da2215af Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-23c11 safe string handling supportDave Barach1-4/+4
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-09API: Spurious timeouts from timeout thread.Ole Troan1-13/+27
Change-Id: I1be1101ba4d82688a32b5ae2c39ca5d92dc244b7 Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-02PAPI: Use UNIX domain sockets instead of shared memoryOle Troan1-1/+1
Adds support for running the API purely across Unix domain sockets. Usage: vpp = VPP(use_socket=True) Change-Id: Iafc1301e03dd3edc3f4d702dd6c0b98d3b50b69e Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-27Trivial: Cleanup some typos.Paul Vinciguerra1-1/+1
This is a new commit for code under a different maintainer. Change-Id: I79fa403fec6a312238a9a4b18b35dbcafaa05439 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-09-07VPP-API: Cancel timeout thread without sending READ_TIMEOUT message.Ole Troan1-8/+6
This caused a spurious message to be sent on the API ring causing debug messages. Change-Id: Ief4ca655ae048aad386a88fed11e8c1114378dc7 Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-16Edit some warning messages in vpp-api clientOndrej Fabry1-2/+2
- fix one typo: cnacel -> cancel - edit log about returned value to be consistent with others Change-Id: I09560eee8a9da361fa51e35f316d44361292bdb2 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2018-07-26VPP-API client: timeout thread loop variableNeale Ranns1-2/+5
calling thread cancel on the timeout thread whilst it was sleep on condwait and then send the cond signal did not reliably wake up the thread. instead don;t cancel the thread, use a loop variable to terminate it. Change-Id: Ibc8ab6f21db7e4a98266bdf88b8b208b887820dd Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach1-6/+11
Configure w/ --enable-dlmalloc, see .../build-data/platforms/vpp.mk src/vppinfra/dlmalloc.[ch] are slightly modified versions of the well-known Doug Lea malloc. Main advantage: dlmalloc mspaces have no inherent size limit. Change-Id: I19b3f43f3c65bcfb82c1a265a97922d01912446e Signed-off-by: Dave Barach <dave@barachs.net>
2018-06-05VPP API: Memory traceOle Troan1-3/+33
if you plan to put a hash into shared memory, the key sum and key equal functions MUST be set to constants such as KEY_FUNC_STRING, KEY_FUNC_MEM, etc. -lvppinfra is PIC, which means that the process which set up the hash won't have the same idea where the key sum and key compare functions live in other processes. Change-Id: Ib3b5963a0d2fb467b91e1f16274df66ac74009e9 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-04Join the VAC read timeout threadNeale Ranns1-21/+25
Change-Id: I5bcbae276f8ac23718c5afc859da222508d07ad7 Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2018-01-22svm: queue sub: Add conditional timed waitMohsin Kazmi1-2/+3
On reviece side svm queue only permits blocking and non-blocking calls. This patch adds timed wait blocking functionality which returns either on signal/event or on given time out. It also preserves the original behavior, so it will not hurt client applications which are using svm queue. Change-Id: Ic10632170330a80afb8bc781d4ccddfe4da2c69a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-01-09api: refactor vlibmemoryFlorin Coras1-7/+7
- separate client/server code for both memory and socket apis - separate memory api code from generic vlib api code - move unix_shared_memory_fifo to svm and rename to svm_fifo_t - overall declutter Change-Id: I90cdd98ff74d0787d58825b914b0f1eafcfa4dc2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-03Repair vlib API socket serverDave Barach1-1/+36
- Teach vpp_api_test to send/receive API messages over sockets - Add memfd-based shared memory - Add api messages to create memfd-based shared memory segments - vpp_api_test supports both socket and shared memory segment connections - vpp_api_test pivot from socket to shared memory API messaging - add socket client support to libvlibclient.so - dead client reaper sends ping messages, container-friendly - dead client reaper falls back to kill (<pid>, 0) live checking if e.g. a python app goes silent for tens of seconds - handle ping messages in python client support code - teach show api ring about pairwise shared-memory segments - fix ip probing of already resolved destinations (VPP-998) We'll need this work to implement proper host-stack client isolation Change-Id: Ic23b65f75c854d0393d9a2e9d6b122a9551be769 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-04-20vpp-api: rename libpneum to libvppapiclientDamjan Marion1-0/+489
Change-Id: Ie6d2c769b316b43c40632aa9009c4ff6442cf658 Signed-off-by: Damjan Marion <damarion@cisco.com>