68 Commits

Author SHA1 Message Date
Dave Barach
971158ee7b Fix coverity warnings, VPP-486
Change-Id: Id88805f77642187f304f8baef1f6b447728e4b5b
Signed-off-by: Dave Barach <dave@barachs.net>
2016-11-23 15:19:11 +00:00
Dave Barach
557d128b68 Add client-side msg_name_and_crc -> msg_index table
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-21 18:11:41 +00:00
Andrew Yourtchenko
36806d18e8 Add the Makefile to Lua API which got gitignored and adjust local .gitignore
Change-Id: I87358dc5dddc6964c128283f096d382492af5886
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2016-11-18 11:56:01 +00:00
Maros Marsalek
94ea8b7ff3 VPP-533 Fix ping race condition in JVpp
Improper synchronization between ping_send and ping_reply_handle

Change-Id: I844c96bc3f5cd750a1c43188d3133c92f8f14e38
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-11-17 10:05:26 +00:00
Maros Marsalek
c0f6cf36a5 VPP-534 Remove references to DTOs created in JVpp
JVM objects allocated from a native thread need to be freed,
they are not subject to GC.

Change-Id: If1e140d2ceaec93631735ae7665f45db5aacf7cf
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-11-17 10:04:55 +00:00
Steven
01b071222d Dump routes (VPP-500)
Change-Id: I86e7382395a8b6471a0deaf57163718d41b71b83
Signed-off-by: Steven <sluong@cisco.com>
2016-11-15 08:13:26 +00:00
Andrew Yourtchenko
fa1456a38d Luajit API and some examples
Change-Id: Ia140c4750f06870c40b7058c4afb2e20ca633a49
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2016-11-11 18:05:53 +00:00
Maros Marsalek
275b146bc1 Fix longArray type in JVPP generator
Change-Id: I0319b45d2e070ee2e20dcf900477fdaadd072aef
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-11-07 11:37:58 +01:00
Marek Gradzki
bdb1f81937 Fail to register Java API for plugin that was not loaded (VPP-522)
Change-Id: Idb95888ae6fc7a9df197a919e3d3283f915f4a4c
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-11-03 16:42:41 +00:00
Marek Gradzki
74e2efad55 Remove unused jvpp dependency on plugins' control_ping
Change-Id: I6ebb69443e79e60c7ce6afded6a2d3af85048e6e
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-11-03 16:42:03 +00:00
Marek Gradzki
81c7dfc1bb VPP-120: add custom types support to jvpp
Generates java classes based on typeonly definitions
(hashcode, equals and toString methods are also included).

Adds JNI handling for request and reply messages
(also arrays of custom types).

Change-Id: I16f1cea17899704426aa083fad1cb800a8d115df
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-10-31 21:42:40 +00:00
Marek Gradzki
af0c70cf76 Improve equals generation for jvpp DTOs
Variable 'other' is no longer defined in equals method
of DTOs without defined fileds.
Fixes dead local store coverity issues.

Change-Id: I69eddf2b4b3f433149ff4d49e49c46515572d61a
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-10-25 15:24:06 +00:00
Marek Gradzki
5b3808ed63 Improve JNI code generation (array truncation)
Fixes DEADCODE coverity issue:

size_t max_size = 0;
if (max_size != 0 && ...)

Change-Id: I0e3ea4e4ddddb476519490c6f00208379089397c
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-10-25 15:24:06 +00:00
Marek Gradzki
9c2964ce01 Fix jvpp coverity issues #2
- synchronize AbstractFutureJvppInvoker.getRequests
- handle registry & jvpp close in API usage examples

Change-Id: I918bf864b8212fde04f0d9194037f1c6a810fc3f
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-10-24 10:05:53 +00:00
Ed Warnicke
14fbdfc800 Candidate fix for race condition in building jvpp_common and jvpp_registry
Change-Id: I244c4e02befc8c4d30915b219abe36ab03c4291d
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
2016-10-21 03:35:23 +00:00
Klement Sekera
1a939e845e improve java build process
Change-Id: Ia4c7503ee31fca74fa45da4ff883f3b80b42e85e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-10-19 12:48:36 +00:00
Marek Gradzki
1ce0879900 Fix coverity issues in jvpp (newlines + CompletableDumpFuture.ctxId)
Change-Id: I2931982ac1ae64313a6ab781212793620af24585
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-10-19 12:46:45 +00:00
Filip Tehlar
69a9b76d64 VPP-362 Implement dumping of LISP adjacencies
Change-Id: Ieea56f3bf9e749878d9f2b35d39d9f7a9cdabde4
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2016-10-12 13:24:03 +00:00
Ole Troan
b8602b595f Python API: Add support for shared memory prefix
Recheck.
This is to support multiple VPP instances on same host.

Change-Id: Ibe511b1f790fc8771900085577423f7e71dc45df
Signed-off-by: Ole Troan <ot@cisco.com>
2016-10-05 11:39:14 +00:00
Marek Gradzki
101759c0d6 VPP-120: include custom types to Python representation of vpe.api
Change-Id: Ide97a8bf55d3baf41a1e86af2c67c6b7b26b657a
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-09-30 07:36:32 +02:00
Marek Gradzki
e85581cd07 VPP-378: rename jvpp package to the same as groupId of deployed jars
Related changes:
- NSH: https://gerrit.fd.io/r/#/c/3181/
- Honeycomb: https://gerrit.fd.io/r/#/c/3182

Change-Id: Ifdd6b8b575916fdf99794618dbe604c2e17e8e82
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-09-29 08:54:43 +00:00
Peter Ginchev
62a28716d8 Fix import line for setup.py
Build fails in case python-setuptools is not installed.

Change-Id: I1611f3560db82a4a48c51a9f614a813a9a540698
Signed-off-by: Peter Ginchev <pginchev@cisco.com>
2016-09-27 05:50:45 +00:00
Marek Gradzki
a21cdafb88 Fix jvpp-core dependencies
Change-Id: I242d590c9d2fa733cc1411fa5d96bb3944d5b5fe
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-09-26 13:05:23 +02:00
Ole Troan
57c3d66c55 Python API: Preparation for RPM/DEB packaging.
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-23 13:18:46 +00:00
Maros Marsalek
560e809b44 VPP-348 Return empty DumpReply instead of null
Change-Id: If44f8d37649e5a9d5033ec2c0ab7452397e22691
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-09-20 13:20:37 +00:00
Maros Marsalek
a53b0e2909 VPP-413 DTOs generated by JVpp improvements:
- hashCode & equals
- toString

Change-Id: I5f8bc8868c216862a307dcc8f6b423f0ce29e7b5
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-09-20 13:20:37 +00:00
Ole Troan
1732fc1ab8 Python API: Re-adding rudimentary variable length array pack support.
Fixed bug in message-id mapping with non-consequtive APIs.

Change-Id: Icd6073e4655f7ce5432816861ae58915e5b336af
Signed-off-by: Ole Troan <ot@cisco.com>
2016-09-13 01:38:14 +00:00
Ole Troan
c27213a30f Add in-message cli_request/cli_reply API
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-09-02 12:36:48 +00:00
Ole Troan
5f9dcff39d VPP Python language binding - plugin support
- 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-08-25 00:29:40 +00:00
Keith Burns (alagalah)
a8f7b750bb Bump of JVPP version for new MASTER.
Change-Id: If03efcea871641e33fa079d3c1c308dc8e23cdcc
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2016-08-17 17:43:39 -07:00
Ed Warnicke
0c25d1f2a8 VPP-336: Fix build order for jvpp_{core,registry}.la dependency on jvpp_common.la
Change-Id: I886d087532d20bf7e6555da44e4e75ee0ca38268
Signed-off-by: Ed Warnicke <eaw@cisco.com>
2016-08-17 20:50:18 +00:00
Marek Gradzki
5a5f5aac91 VPP-205: documentation update
Change-Id: I98e5bdbd0472c2973885defe2712b53d9da8a536
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-17 15:20:20 +02:00
Marek Gradzki
66ea26b1bc VPP-205: jvpp plugin support.
Splits jvpp into two jars
jvpp-registry.jar - base jvpp functionality
jvpp-core.jar - Java wrapper for vpe.api

Plugins can be generated the same way jvpp-core.jar is.
Example (nsh):
https://gerrit.fd.io/r/#/c/2118/

Change-Id: I2254f90b2c3e423563bb91bf70877979f1e90a7d
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-16 21:26:19 +00:00
Ed Warnicke
adeb749d13 Create python package for jvpp generation.
Change-Id: I2254f90b2c3e423563bb91bf70877979f1e86a6b
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-16 17:55:55 +00:00
Marek Gradzki
8a1531dfb7 VPP-233: disallow array[0] in reply messages
- updates jvpp generator to raise exception
  if array[0] is present in reply/detail/counter message

- fixes vpe.api reply/detail/counter messages
  that use incorrect variable array syntax.

Additional info:

Variable arrays in reply/detail/counter messages needs to have
lenght defined in other variable within the message.
The other variable can have any name, so it is impossible to
generate Java/Python code handling.

New syntax introduced by
https://gerrit.fd.io/r/#/c/1617/
fixes the problem:

u32 some_var;
XX array[some_var];

Change-Id: I0af50f1ef1d94d95b56d9326d4e944e72b4edcdd
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-03 11:42:34 +02:00
Marek Gradzki
8e5458caea VPP-229: fix NPE in JNI array handling
Change-Id: Ieb5182a7a3612e09bd2b28eb6a4abbdb4d29d34b
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-02 14:27:33 +00:00
Marek Gradzki
b6737a10ac Jvpp: add handling for mising unsigned array types
Change-Id: I239082622ceabdd1d0a7b6b6489a2789096a01fc
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-08-01 07:41:16 +02:00
Keith Burns (alagalah)
d038dbf4aa Addition of u16[] to JVPP generator
Change-Id: I8d746cfae4d64ae200ff0053de23b80ee951c290
Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
2016-07-30 11:43:14 -07:00
Marek Gradzki
948b95a9a0 VPP-123: remove japi (the old Java API)
MANUAL_JAVA flag (used only by the japi)
was also removed.

Change-Id: Ied21521b2410af1c357afb04cbf9e849632ddc5f
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-07-21 09:30:48 +00:00
Marek Gradzki
3659a5aa36 VPP-190: support variable length array syntax in request messages
The information is aleardy stored in array.length field, but
vpe.api syntax should be uniform.

Change-Id: Id84cd95c088281609c70548346cf0e408a6f49ff
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-07-11 23:03:40 +00:00
Damjan Marion
bbae375ca2 Remove unnecessary and obsolete configure.ac directives
Also enable silent rules where missing

Change-Id: Ia521886815c862b013f01df4cc18fd8a298aaaa1
Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-07-08 13:55:35 +00:00
Jan Srnicek
2e95f5a1d1 VPP-184 - Bad type translation in jvpp
Change-Id: I6dda9eb8d58a2bc9a1e4d6636688dfa1f8bb88c6
Signed-off-by: Jan Srnicek <jan.srnicek@pantheon.tech>
2016-07-06 19:16:58 +00:00
Marek Gradzki
310dca43a3 Add support for classify table/session read to jvpp:
* provides length information for variable length arrays
  in classify table/sessione reply messages
* provides jvpp example for reading classify tables/sessions

Change-Id: I47f8fca5c849ec874d4e23f28177e310689db522
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-06-27 17:11:41 +02:00
Dave Barach
aa6920e0a8 More janitorial work
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-27 06:54:32 -07:00
Marek Gradzki
fa42e25c4e VPP-118: add support for variable length arrays to jvpp
* 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-06-24 13:23:16 +00:00
Maros Marsalek
7becd08c4b VPP-119: JVpp notifications
- add notification DTOs to JVpp
- add notification callbacks
- add notification registry
- provide/implement notification registry from future and callback facades

Change-Id: I1060ef2ec8ba1eb2e8cff279c93b73aa7c9f9aee
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-06-09 02:41:57 +00:00
Tibor Sirovatka
42bb61fd16 HONEYCOMB-67 Introduce exception handling into JVPP
Send calls throws VppInvocationException on failure
Failed requests (negative retval) reported over onError callback interface method
Removed retval attributes from dto/xxxReply.java calls

Change-Id: Ibd4e90c320d080e02d75b4bd056a7b11c8e37aa7
Signed-off-by: Tibor Sirovatka <tsirovat@cisco.com>
2016-06-09 02:22:34 +00:00
Maros Marsalek
2f0a7a880c Increase jvpp connection timeout
Change-Id: I4d52c113336deac80dfcbad91b21a7a70eea2213
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
2016-06-08 11:40:32 +00:00
Marek Gradzki
97d99518d7 Add u32[] type handling in reply messages to jvpp
Change-Id: I9fd0cd49e4636d5d8978567fa914487785035c8a
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-06-07 11:28:58 +00:00
Marek Gradzki
34e7772443 Fix u16 type handling in jvpp
Change-Id: I6e5ed2562c65dde6c9f6f085c8b9d40f80684894
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2016-05-31 21:19:07 +00:00