summaryrefslogtreecommitdiffstats
path: root/src/vpp-api
AgeCommit message (Collapse)AuthorFilesLines
2018-12-28vpp_papi: MACAddress equals fails in unittest.Paul Vinciguerra2-0/+21
Before: EqualsAssertionError: :: MACAddress(11:22:33:44:55:66) != MACAddress(11:22:33:44:55:66) ---------------------------------------------------------------------- Ran 1 test in 0.002s FAILED (failures=1) MACAddress(11:22:33:44:55:66) != MACAddress(11:22:33:44:55:66) After: ---------------------------------------------------------------------- Ran 1 test in 0.001s OK Change-Id: I89896a823b8f8a861813dabf23e7c9207e4fabb6 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-18VAPI/VOM: Removing legacy stats tests, add string type.Ole Troan2-0/+2
Fix misc VAPI/VOM generation and test cases. Change-Id: I1abf9ecdb6f8a2129f11e0a9ed1c0fe04cdf5c47 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan4-3/+67
Change the definition of vl_api_mac_address_t to an aliased type. Change-Id: I1434f316d0fad6a099592f39bceeb8faeaf1d134 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-13API: Use string type instead of u8.Ole Troan3-17/+80
The new string type is modelled after string in proto3. It is always variable length. Change-Id: I64884067e28a80072c8dac31b7c7c82d6e306051 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Michal Cmarada <mcmarada@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-13vapi: code cleanupKlement Sekera1-5/+4
Change-Id: If3bdb4369d6055e06a9b29bcba37785dbd32eb71 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-12-12PAPI: Allow ipaddress object as argument and return values from API callsOle Troan4-220/+266
The API calls that use any of vl_api_address_t, vl_api_ip4_address, vl_api_ip6_address_t, vl_api_prefix_t, vl_api_ip4_prefix_t, vl_api_ip6_prefix_t now accepts either the old style dictionary, a text string (2001:db8::/32) or an ipaddress ojbect. Unless it is called with '_no_type_conversion':True, it will also return an appropriate ipaddress object. Change-Id: I84e4a1577bd57f6b5ae725f316a523988b6a955b Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-10Python API: Use services to determine stream RPCOle Troan1-4/+11
The services {} definitions contain which APIs are streaming. In addition only create function definition for the client side (not for reply messages). Change-Id: I8e83d35386cdd9ebee83d4571eaebdc6dff19e82 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-10Test framework: StringIO fixes for Python3Ole Troan1-2/+7
Add 2/3 support to binarytomac and mactobinary and move to vpp_mac.py Change-Id: I3dc7e4a24486aee22140c781aae7e44e58935877 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-06stat_client: Fix the type castingMohsin Kazmi2-7/+10
Change-Id: I9726ac5cc7292a492928b213bc85ccfa8a26c1cb Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-12-06API: Change ip4_address and ip6_address to use type alias.Ole Troan4-20/+39
Change-Id: Id8669bbadd1d6b2054865a310a654e9b38d1667d Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-05stat-client: pass names as const stringsNeale Ranns2-4/+4
Change-Id: I8debcd078b733ed19c4b46ea41a2a150d816724c Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-11-29vpp_papi: Add custom exceptions.Paul Vinciguerra6-54/+121
This patchset adds and raises the following custom exception classes: * class VPPApiError(Exception): * class VPPNotImplementedError(NotImplementedError): * class VPPIOError(IOError): * class VPPRuntimeError(RuntimeError): * class VPPValueError(ValueError): * class VPPSerializerValueError(ValueError): * class VPPStatsIOError(IOError): * class VPPStatsClientLoadError(RuntimeError): * class VppTransportShmemIOError(IOError): * class VppTransportSocketIOError(IOError) Change-Id: Ia40900fd2dcef148d01125d6c691329fc666901e Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-29vpp_papi: Fix: raise NotImplemented.Paul Vinciguerra1-1/+1
'raise NotImplemented' should be 'raise NotImplementedError'. NotImplemented is not part of the Exception heirarchy. Change-Id: I7fb647f1d56e689fafa2cd9a5566da826def072b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-29API: Add support for type aliasesOle Troan5-23/+87
Previously all types are compound. This adds support for aliases, so one can do things like: typedef u32 interface_index; or typedef u8 ip4_address[4]; Change-Id: I0455cad0123fc88acb491d2a3ea2725426bdb246 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-11-29VPP-1508: vpp_transport_socket.py fix importPaul Vinciguerra1-1/+4
Import queue in an py2-py3 compatable way. Change-Id: I83f166a959c4ee55438e3997edbcb596dc72059f Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-28vpp_papi: Reserved keywords.Paul Vinciguerra2-3/+3
'async' and 'await' are reserved keywords starting with Python 3.7. This change is necessary to support VPP-1508. Change-Id: Iba2b3aef98a0ecaabc1622719b364f8f4ab5d5a3 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-28vpp_papi: Use new style classes.Paul Vinciguerra6-13/+13
Python2 defaults to old style classes to maintain compatability with python 2.1. Moving to new style classes will ensure consistent behavior across interpreters. Change-Id: I89493d608d1edb63989000c17a9566a97785a4aa Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-26stats: Remove unneeded dependencies in stat_clientOle Troan2-7/+21
Remove exposing stat_client_main internals and atomics to simplify use from C++. Change-Id: Ie864170fee8b4eaa2fd7f98556cf0ebb46cb1a2a Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-26vapi: break if parsing progress cannot be madeKlement Sekera1-0/+1
Change-Id: I1b76994f674a045f7fce3d61ef2aa5294ddb53a9 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-11-22stat_client issues while running parallel tests.Paul Vinciguerra4-52/+162
This patch addresses intermittent problems we saw in our CI while running parallel tests. Change-Id: Icb5fdb34cc134e3eb341225d56ab67fbbef80b0d Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-07Unresolved symbols in libvapiclientNeale Ranns1-0/+1
Change-Id: I6d6a73ac62f24928fb51e89948b92a1cb9134c40 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-11-05Provide return value for PAPI disconnect()Igor Mikhailov (imichail)2-1/+3
Change-Id: I209f570634636725ce8fda5f61e900a71227b888 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-11-05Alter logging semantics for VPP PAPI objectIgor Mikhailov (imichail)1-1/+1
Restore parts of commit d0e812f wiped out by a7564e80 The full description of the change is in d0e812f Change-Id: I632476cb10678a725396462f90f9b0bea9e572fa Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-10-23c11 safe string handling supportDave Barach4-13/+14
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-22PAPI: Add support for format/unformat functions.Ole Troan5-12/+247
With the introduction of new types, like vl_api_address_t it is now possible to call a message using one of those functions with a string representation. E.g. for an IP address ip_add_address(address="1.1.1.1/24") The language wrapper will automatically convert the string into the vl_api_address_t representation. Currently the caller must do the reverse conversion from the returned named tuple with the unformat function. rv = get_address_on_interface(sw_if_index=1) print(VPPFormat.unformat(rv.address)) Change-Id: Ic872b4560b2f4836255bd5260289bfa38c75bc5d Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-22stats: Add wrapper for vec_freeOle Troan3-0/+8
The result vector from stat_segment_ls must be freed by the caller. Add wrapper for non-C language bindings. Change-Id: I7eee7f80ec98b41696d354add47b26978e12ef0f Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-18PAPI: Expose API enums to tests / applicationsOle Troan2-16/+43
e.g: from vpp_papi import VppEnum VppEnum.vl_api_address_family_t.ADDRESS_IP4 Change-Id: I10c22d57234a1a06e98a889cf80b19085b468ed3 Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-16PAPI: Add bool type support in vppapigen.Ole Troan1-0/+2
Change-Id: I9c2eaa2ee04a1c9a92018afb92cb2c5610df2991 Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-16PAPI: Add timeout support for socket transportOle Troan1-3/+6
Change-Id: I0402989e0ac738cab2f918e6e3d73c571457c08e Signed-off-by: Ole Troan <ot@cisco.com>
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-03stat_client.c coverity error.Ole Troan1-2/+0
Change-Id: Ic072beb8882981425f436936f239e8c8bf229a99 Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-02VPP-1440: clean up coverity warningsDave Barach1-0/+4
Change-Id: Ic6823fb617ecae547a5f0e28b1e037848e40f682 Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-02Stats: vpp_prometheus_export fixes.Ole Troan1-0/+4
- Crash on /sys/nodes if per-node-counters off - Require patterns parameters. Change-Id: If4fddefb17504a92ba462c7af91e373601b66a5c Signed-off-by: Ole Troan <ot@cisco.com>
2018-10-02PAPI: Use UNIX domain sockets instead of shared memoryOle Troan5-111/+332
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-27IPIP and IPv6 fragmentationOle Troan1-1/+2
- Error where ICMPv6 error code doesn't reset VLIB_TX = -1 Leading to crash for ICMP generated on tunnelled packets - Missed setting VNET_BUFFER_F_LOCALLY_ORIGINATED, so IP in IPv6 packets never got fragmented. - Add support for fragmentation of buffer chains. - Remove support for inner fragmentation in frag code itself. Change-Id: If9a97301b7e35ca97ffa5c0fada2b9e7e7dbfb27 Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-18STATS: Optimistic concurrency handling in Python library.Ole Troan1-4/+24
Change-Id: I2135f3e77206fd171636a1e0b07c373c0bf093e4 Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-18STATS: Add Python 3 support to vpp_stats.py.Ole Troan2-4/+4
Change-Id: Iad0b0315fbd493b67e6ca490206ec8e8422790ea Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-17STATS: Dynamically mapped shared memory segmentOle Troan5-264/+270
Move from using a hash to a vector with offsets into shared memory. Limit exposure of VPP data structures and include files to external stats library and applications. Change-Id: Ic06129f12d10cf4c4946a86d9bc734eacff2c7da Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-11vapi: support VLAs in typedefsKlement Sekera2-28/+96
Change-Id: I3af3916b68189c2174020e5ecc29a7bc45b25efa Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-09-07cmake: set packaging component for different filesDamjan Marion1-2/+11
Change-Id: I033a1f5cdb24f77462cb5ec90a62226d93f52925 Signed-off-by: Damjan Marion <damarion@cisco.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-09-07PAPI: Unpack embedded types with variable length arrays.Ole Troan3-36/+97
Change-Id: Ic952ed5b837ac8409fd95e2b5cb92eb028ba0c40 Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-03vapi: init clib mem heap on connect if neededKlement Sekera1-0/+4
Change-Id: Id45a3a37dd77771289622314406dccf50b64f04d Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-09-02STATS: Python binding to access VPP statistics and counters.Ole Troan4-8/+187
from vpp_papi.vpp_stats import VPPStats s = VPPStats(socketname='/var/run/stats.sock') c = s.ls('/if/rx') counters = s.dump(c) print(s.set_error_str()) Change-Id: I203ebe60b0c9ee5742aadc737c0f29051757959d Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-02Switch to cmakeDamjan Marion2-97/+0
Change-Id: I982b69390c55b5ffbd744f355efc0aaf425b360c Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-30cmake: missing dependenciesDamjan Marion1-2/+2
Change-Id: Iae03deb10d437286989dd3d45f8cc9690d463100 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-30cmake: a bit of packaging workDamjan Marion1-0/+1
Change-Id: I40332c2348c4aab873d726532f2ac3c4abde7ec9 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-29STATS: stat_client updates.Ole Troan4-3/+447
New stat segment client library: vpp-api/client/stat_client.h New stat segment query app: vpp_get_stats [ls | dump | poll ] <pattern ...> Prometheus integration through: vpp_prometheus_export <pattern> Change-Id: I6f370cf599e9fcf066f22965a62d3a8acd529994 Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-28VAPI: bugfixesKlement Sekera1-12/+8
Change-Id: I20cfbae8b704ca68fd8dda9c811dc282ce723871 Signed-off-by: Klement Sekera <ksekera@cisco.com>