Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
Change-Id: I9c2eaa2ee04a1c9a92018afb92cb2c5610df2991
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: I0402989e0ac738cab2f918e6e3d73c571457c08e
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
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>
|
|
- 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>
|
|
Change-Id: I2135f3e77206fd171636a1e0b07c373c0bf093e4
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: Iad0b0315fbd493b67e6ca490206ec8e8422790ea
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
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>
|
|
Change-Id: Ic952ed5b837ac8409fd95e2b5cb92eb028ba0c40
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
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>
|
|
Change-Id: I982b69390c55b5ffbd744f355efc0aaf425b360c
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I40332c2348c4aab873d726532f2ac3c4abde7ec9
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I7e899929843eba13fbee97caea51621423778cbe
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
The implementation of parallel test execution in VPP Test Framework.
- VPPTestCase test methods are grouped together
- tests are running in separate processes
- VPP instances spawned by tests are assigned to different cores
- output from these processes is redirected through pipes and printed
out testcase by testcase
- TEST_JOBS env var is used to specify the number of parallel processes
- improved test summary
- a bit of code cleanup
Change-Id: I9ca93904d9fe2c3daf980500c64a8611838ae28c
Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
|
|
Change-Id: I01e99c85598a7cb5bc1a506c7fd1fc3f6789d72e
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: I67a0f168254367c657eb11d4413f9dc0c5356b3c
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Hopefully that's going to be consistent across platforms, compilers and ABI.
Change-Id: I0b82565288d88fd046278d4d8288ec1488273ba5
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
This slowed down the decoder. Improved from 16s to 13s for 1000 dump/details
messages.
Change-Id: Iae78136b020cdd9344f3b2170ce426d0f074b6e6
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: I487ccf2adabfbd22dac9f492ecff679d38046724
Signed-off-by: Klement Sekera <ksekera@cisco.com>
|
|
As well as a rewrite of the encoders/decoders to make it more readable and extensible.
(Re-commit after fix to verify build.)
Change-Id: Ic244d3cebe070bb2570491f8a24f4a1e203f889a
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
This reverts commit a5ee900fb75201bbfceaf13c8bc57a13ed094988.
Some of the unit tests breaks. Backing out until fixed.
Change-Id: I1846fb417db44a2a772f7b59cda8bcfe6d39f8c3
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
As well as a rewrite of the encoders/decoders to make it more readable and extensible.
Change-Id: I253369ac76303922bf9c11377622c8974fa92f19
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Logging previously used a string name for the log level and changed
the system-wide log level based on this string name. It now uses a
logging-module provided constant for the log level and changes its own
logger's level based on the name, and only if the level is provided.
This allows the logging to be more compatible with Pythonic usage,
where an external source may be used to dictate logging levels across
the system on a per module basis and should not be overridden.
Change-Id: Icf6896ff61a29b12c11d04374767322cdb330323
Signed-off-by: Ian Wells <iawells@cisco.com>
|
|
Change-Id: I1c49a12ef7fa7bd0046f1a420b01c1654b6d21ec
Signed-off-by: Andrey "Zed" Zaikin <zed.0xff@gmail.com>
|
|
exception in vpp_api.vac_write():
"TypeError: initializer for ctype 'char *' must be a bytes or list or
tuple, not str"
Change-Id: Ib6bcfb86e6e36c557174979a110113af689c6754
Signed-off-by: Andrey "Zed" Zaikin <zed.0xff@gmail.com>
|
|
Change-Id: I15cf4a9fd2d2518df4bfffc1ba3c556a87ca5afa
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
This allows VPP to define APIs which conflict with internal
function names used in vpp_papi without issues.
Change-Id: I56c21814e1c11fa2aa6bcd95adb3fdeacd304e8e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
|
|
This changes makes unused VPP objects collectable by garbage collector,
allowing running all `make test` tests again instead of python crashing
due to running out of memory.
Change-Id: I0e271c2b3f195d9d3b64840f9f11144da0fe967d
Signed-off-by: Klement Sekera <ksekera@cisco.com>
|
|
Change-Id: I54c147004fd93681a6a9cf30fa5277c1dabce67c
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
- Add a basic heuristic to have vpp_papi search in several
places for the JSON API files.
- It's clever enough to work out the path to these files
from within several places in the source tree, falling
back to the system location as a last resort.
Change-Id: I1f823588e5aa0064d545ce4206ab29dbdedc4c7f
Signed-off-by: Chris Luke <chrisy@flirble.org>
|
|
Change-Id: I8a16f2ba884451ca8028adb91383d57fdf1d9d50
Signed-off-by: dongjuan <dong.juan1@zte.com.cn>
|
|
Change-Id: I3d3e5dff5b22fca58a50da6a9d0aaf1182e736dd
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
A bug in the decoder of messages when there was a non-array compound type.
The typical result was an error message from the struct library:
"error:unpack_from requires a buffer of at least 4 bytes"
Change-Id: Ie30fec6fc39b9f4177b54fa4adc4fc69674f0e12
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Dynamically calculate the required buffer size to pack into based on
message definition. Also add input parameter length checking.
Change-Id: I7633bec596e4833bb328fbf63a65b866c7985de5
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
to API calls.
Change-Id: I266eef8419fd98b9b900573ac9b032a62600ab86
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: I328689b7d4efe6017412de43630a5e9f3633dd71
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: Icb67797a91a5929e57a08b79adeca226fee09de3
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: Ide2cdc456f3ab3219930fb8e423b871810469cdc
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: I0657b3f7578eb1b4d9a1ecabc14dc0f0e4647c65
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
This way it will be deleted when clean/wipe is performed.
Change-Id: Ic3fcfe8b80ac8b80a5a25ec04c35c36a638ca570
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
|
|
Produce vpp_papi*.egg so that virtual environments (e.g. virtualenv)
could install vpp_papi inside them.
Change-Id: I9664d119a64f4968de44a7a430aec4879ed02b16
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
|
|
Change-Id: Ie6d2c769b316b43c40632aa9009c4ff6442cf658
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I03e52466fb3f909ae52b8fba601168f3eadbd972
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Change-Id: Ic8f186dbb35bb4e2e191d311cab51315a88a2d81
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
This change improves vpp_papi behaviour by introducing alternate way of
calling vpp APIs.
The common code is the same:
vpp = VPP(...)
vpp.connect(...)
Calling VPP API is different, instead of deprecated:
vpp.show_version() # deprecated
one should write
vpp.api.show_version()
this allows VPP messages like "connect" and "disconnect" to be used,
once the old API is dropped (in 17.07). Also part of this patch is a
check for name conflict, to prevent VPP object overwriting its own
functionality with generated code based on json files.
Change-Id: I22e573b6a45f8b2a1f0340c5c2597c194fe42ca4
Signed-off-by: Klement Sekera <ksekera@cisco.com>
|
|
Even when not requesting notification the VPP API
sends event notifications on certain calls. E.g.
creating interfaces.
Traceback (most recent call last):
File "/vpp/ipfix/src/vpp-api/python/vpp_papi/vpp_papi.py", line 447, in msg_handler_sync
if self.event_callback:
AttributeError: VPP instance has no attribute 'event_callback'
Change-Id: I4ca30c49df298655dc8948c5ebd68de0b3d6a592
Signed-off-by: Ole Troan <ot@cisco.com>
|
|
Previously install path for python binding is fixed, as
lib/python2.7/site-packages and other version/enironement is not
supported. This change introduces automake's python macro and gets
the install path from environment dynamically.
Change-Id: I6535107d4bde61976fbdf5392d460beb1049658e
Signed-off-by: Tomofumi Hayashi <tohayash@redhat.com>
|
|
Previous changes forgot to return the decoded result
Change-Id: I4eb27802eb2672532d856d9b9671ef806374bcd0
Signed-off-by: Wojciech Dec <wdec@cisco.com>
|
|
The wrong assumption that the GIL combined with CPython's "mostly"
thread safe assurance does not hold. The combination of a slow
event handler for notification and calling the API at the same
time let to contention on the results data structure.
Added suitable locking.
Also added an atexit() to attempt a VPP disconnect on shutdown.
Also: lots more comments, docstrings, duplicated code removed.
Some of the problem here was a disagreement between caller
and author as to how the API should be used; the comments should
help.
Change-Id: I0cb7d0026db660ec141425c5ad474f14bacea36e
Signed-off-by: Ole Troan <ot@cisco.com>
Co-Authored-By: Ian Wells <iawells@cisco.com>
Signed-off-by: Ole Troan <ot@cisco.com>
|