summaryrefslogtreecommitdiffstats
path: root/vpp-api/python
AgeCommit message (Collapse)AuthorFilesLines
2016-12-21Python API: Incorrect error for empty VLA list.Ole Troan2-4/+11
Change-Id: Ie3e9a54ca23af6b9ee43615f59a48cb05e3906d4 Signed-off-by: Ole Troan <ot@cisco.com>
2016-12-20Add missing variable definitions to python VPP APIJuraj Sloboda1-0/+3
Change-Id: I03eee75fb8575ced6f126fa32c778850a570f0ea Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2016-12-20Declare variables as externalDamjan Marion1-0/+4
non-external declarations in header files are generating multiple empty definitions of the same symbol. Change-Id: I7f3933404f79d08579468d0052c106731b57507c Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-12-19Python API: Add back support for old-style VLA, e.g. mask[0]Ole Troan2-50/+143
Change-Id: I5be6bfe522e5ea93934f0ddf75d4e4707376dc0c Signed-off-by: Ole Troan <ot@cisco.com>
2016-12-13vpp_papi: Add help() support for python interactive modeChristophe Fontaine1-4/+13
The python api 1.3 removed the ability to call 'help' in interactive mode. example: > help(vpp.sw_interface_span_enable_disable) Help on function sw_interface_span_enable_disable in module vpp_papi.vpp_papi: sw_interface_span_enable_disable(**kwargs) u16 _vl_msg_id, u32 client_index, u32 context, u32 sw_if_index_from, u32 sw_if_index_to, u8 state Change-Id: Iea1944fdc862482490174ff966592cf3c8208a98 Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
2016-12-12Fix for PAPI async call registrationWojciech Dec1-5/+8
Introduce async API call registration Change-Id: Iccc89eca1b6e7dcce96a8e7bc5da80d9abc363fc Signed-off-by: Wojciech Dec <wdec@cisco.com>
2016-12-06SPAN API: Fix various errors making SPAN break make tests.Ole Troan1-3/+1
- s/l2/span in span_api.c in foreach macro - Not installing .json from Makefile.am Change-Id: I2469fe01138d62e044b8262cdb5a6e3b009bb43e Signed-off-by: Ole Troan <ot@cisco.com>
2016-12-06API: Adapt make test to Python API changes.Ole Troan3-8/+52
Change the test wrapper script for the updated Python API. All tests but the L2BD multi instance runs fine. That is currently skipped. I see intermittent failures when an MLD message is received before the ND NA in MPLS and IPV6 FIB tests. Change-Id: If809877c9abdf596dbb0a419ce5429552f63d212 Signed-off-by: Ole Troan <ot@cisco.com>
2016-12-02Python API: Support for per message CRC and API split.Ole Troan4-245/+767
These changes are incompatible with Python VPP API 1.2 There is now a new VPP Class and it can be used like: from vpp_papi import VPP jsonfiles = [] for root, dirnames, filenames in os.walk('../../../build-root/'): if root.find('install-') == -1: continue for filename in fnmatch.filter(filenames, '*.api.json'): jsonfiles.append(os.path.join(root, filename)) vpp = VPP(jsonfiles) rv = vpp.show_version() print('RV', rv.program.decode().rstrip('\0x00')) vpp.disconnect() Change-Id: Ic92d226de2cf3626e750404012247e7fc24fb7fc Signed-off-by: Ole Troan <ot@cisco.com>
2016-12-02API: Packaging of JSON files.Ole Troan1-16/+1
Change-Id: If041b6faf1a091d4758b514f0a8cd800ee0e6a89 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <otroan@ot-vpp.cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2016-11-23Fix coverity warnings, VPP-486Dave Barach1-0/+3
Change-Id: Id88805f77642187f304f8baef1f6b447728e4b5b Signed-off-by: Dave Barach <dave@barachs.net>
2016-11-21Add client-side msg_name_and_crc -> msg_index tableDave Barach6-393/+98
vppapigen now generates per-message crcs. Verified that whitespace and real changes in message A don't change the crc for message B, etc. Fixed the sample and flowperpkt plugins to participate. Others need the same treatment. They don't build due to python/java language binding build issues. To use the scheme: Client connects as usual. Then call: u32 vl_api_get_msg_index(char * name_and_crc) name_and_crc is a string like: "flowperpkt_tx_interface_add_del_753301f3", aka the message name with _%08x <expected crc> appended. Try these vpp-api-test commands to play with it: vat# dump_msg_api_table <snip> [366]: punt_reply_cca27fbe [367]: ipsec_spd_dump_5e9ae88e [368]: ipsec_spd_details_6f7821b0 [369]: sample_macswap_enable_disable_0f2813e2 [370]: sample_macswap_enable_disable_reply_476738e5 [371]: flowperpkt_tx_interface_add_del_753301f3 [372]: flowperpkt_tx_interface_add_del_reply_d47e6e0b vat# get_msg_id sample_macswap_enable_disable_reply_476738e5 'sample_macswap_enable_disable_reply_476738e5' has message index 370 vat# get_msg_id sample_macswap_enable_disable_reply_476738e3 'sample_macswap_enable_disable_reply_476738e3' not found CRCs may vary, etc. vppapigen is used to build a set of JSON representations of each API file from vpp-api/Makefile.am and that is in turn used by each language binding (Java, Python, Lua). Change-Id: I3d64582e779dac5f20cddec79c562c288d8fd9c6 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Ole Troan <ot@cisco.com>
2016-11-15Dump routes (VPP-500)Steven1-0/+2
Change-Id: I86e7382395a8b6471a0deaf57163718d41b71b83 Signed-off-by: Steven <sluong@cisco.com>
2016-10-12VPP-362 Implement dumping of LISP adjacenciesFilip Tehlar1-0/+2
Change-Id: Ieea56f3bf9e749878d9f2b35d39d9f7a9cdabde4 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2016-10-05Python API: Add support for shared memory prefixOle Troan5-9/+16
Recheck. This is to support multiple VPP instances on same host. Change-Id: Ibe511b1f790fc8771900085577423f7e71dc45df Signed-off-by: Ole Troan <ot@cisco.com>
2016-09-30VPP-120: include custom types to Python representation of vpe.apiMarek Gradzki1-1/+1
Change-Id: Ide97a8bf55d3baf41a1e86af2c67c6b7b26b657a Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-09-27Fix import line for setup.pyPeter Ginchev1-2/+2
Build fails in case python-setuptools is not installed. Change-Id: I1611f3560db82a4a48c51a9f614a813a9a540698 Signed-off-by: Peter Ginchev <pginchev@cisco.com>
2016-09-23Python API: Preparation for RPM/DEB packaging.Ole Troan11-65/+106
Recheck. Repackage the Python API binding to include all necessary modules in a single Python package. Change-Id: I5e35141d413bfb1aad650217e1ca07d85646c349 Signed-off-by: Ole Troan <ot@cisco.com>
2016-09-13Python API: Re-adding rudimentary variable length array pack support.Ole Troan2-17/+21
Fixed bug in message-id mapping with non-consequtive APIs. Change-Id: Icd6073e4655f7ce5432816861ae58915e5b336af Signed-off-by: Ole Troan <ot@cisco.com>
2016-09-02Add in-message cli_request/cli_reply APIOle Troan2-0/+58
This new CLI API is meant to replace the cli_request/cli_reply that uses shared memory. PS: checkstyle -- *hate* Change-Id: I6318f8f6b9be2c2398b49dac9e2193c1998ea724 Signed-off-by: Ole Troan <ot@cisco.com>
2016-08-25VPP Python language binding - plugin supportOle Troan12-136/+427
- Moved Python generator tool to tools directory - Added build-vpp-api Makefile target - Generator now only creates a Python representation of the .api the rest of the framework is in the vpp_papi script - Each plugin has its own namespace. - Plugin Python files are installed in vpp_papi_plugins for easy use inside the build tree. Change-Id: I272c83bb7e5d5e416bdbd8a790a3cc35c5a04e38 Signed-off-by: Ole Troan <ot@cisco.com>
2016-06-27More janitorial workDave Barach3-8/+8
Install vpp api header files in /usr/include/vpp-api, instead of /usr/include/api. Someone will eventually complain if we continue with the status quo. Generate /usr/bin/vpp_plugin_configure, to correctly configure standalone plugin compilation against header files installed from the dev package. If a plugin's CFLAGS don't precisely match the installed vpp engine binary, subtle misbehavior can and will occur. Example: the ip4/ip6 main_t structure size / member offsets depend on DPDK=[0|1]. Screw that one up, and your brand-new configurable ip feature will mysteriously fail to appear, even though the plugin loads perfectly. Change-Id: I20c97fe1042808a79935863209d995c31953b98c Signed-off-by: Dave Barach <dave@barachs.net>
2016-06-24VPP-118: add support for variable length arrays to jvppMarek Gradzki1-1/+1
* extends VPP's message definition language with the following syntax: u32 count: u8 array[count]; which is traslated to: u32 count; u8 array[0]; but now, python API representation generated by vppapigen contains information about where the array length is stored. * modifies existing response messages to use the new syntax Change-Id: I68210bc7a3a755d03d067e9b79a567f40e2d31f3 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-04-28Python API: Fix mistaken removal of '_' in field names.Ole Troan2-8/+23
Change-Id: I1e39970bc6ded9e6da64385b2289321ba43bebfd Signed-off-by: Ole Troan <ot@cisco.com>
2016-04-25Python-API: Python 2 support.Ole Troan2-11/+43
Change-Id: I6bc656caf22e284233e27f9e003f11502f306c11 Signed-off-by: Ole Troan <ot@cisco.com>
2016-04-25Python-API: Support for zero-length arrays from caller to VPP. (Previously ↵Ole Troan1-20/+26
only VPP to caller was supported.) Change-Id: Id660caeb780f3b26cc091467291463980f485178 Signed-off-by: Ole Troan <ot@cisco.com>
2016-04-20Python-API: Inital commit of Python bindings for the VPP API.Ole Troan10-0/+1053
See: https://wiki.fd.io/view/VPP/Python_API Change-Id: If135fc32208c7031787e1935b399d930e0e1ea1f Signed-off-by: Ole Troan <ot@cisco.com>