diff options
author | Ole Troan <ot@cisco.com> | 2017-10-12 13:06:35 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-01-23 13:03:53 +0000 |
commit | 9d42087149a6870965896be74dc6260f72d2cac9 (patch) | |
tree | f86ed97a4b28845934aeb5fbc9dd4e33b9bdfdac /src/vnet | |
parent | 2aa22909c70ff5c5eed6a7f7a0f8a587c9260da8 (diff) |
VPPAPIGEN: vppapigen replacement in Python PLY.
This is a version of the VPP API generator in Python PLY. It supports
the existing language, and has a plugin architecture for generators.
Currently C and JSON are supported.
Changes:
- vl_api_version to option version = "major.minor.patch"
- enum support
- Added error checking and reporting
- import support (removed the C pre-processor)
- services (tying request/reply together)
Version:
option version = "1.0.0";
Enum:
enum colours {
RED,
BLUE = 50,
};
define foo {
vl_api_colours_t colours;
};
Services:
service {
rpc foo returns foo_reply;
rpc foo_dump returns stream foo_details;
rpc want_stats returns want_stats_reply
events ip4_counters, ip6_counters;
};
Future planned features:
- unions
- bool, text
- array support (including length)
- proto3 output plugin
- Refactor C/C++ generator as a plugin
- Refactor Java generator as a plugin
Change-Id: Ifa289966c790e1b1a8e2938a91e69331e3a58bdf
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet')
40 files changed, 91 insertions, 73 deletions
diff --git a/src/vnet/bfd/bfd.api b/src/vnet/bfd/bfd.api index 1c5c578619e..912c6954407 100644 --- a/src/vnet/bfd/bfd.api +++ b/src/vnet/bfd/bfd.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Set BFD echo source @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/bier/bier.api b/src/vnet/bier/bier.api index c7e9a98209b..380d2973705 100644 --- a/src/vnet/bier/bier.api +++ b/src/vnet/bier/bier.api @@ -18,7 +18,8 @@ This file defines vpp BIER control-plane API messages which are generally called through a shared memory interface. */ -vl_api_version 1.0.0 +option version = "1.0.0"; +import "vnet/fib/fib_types.api"; /** \brief BIER Table Indentifier @param bt_set - The BIER set @@ -63,37 +64,6 @@ define bier_table_details vl_api_bier_table_id_t bt_tbl_id; }; -/** \brief FIB path - @param sw_if_index - index of the interface - @param weight - The weight, for UCMP - @param preference - The preference of the path. lowest preference is prefered - @param is_local - local if non-zero, else remote - @param is_drop - Drop the packet - @param is_udp_encap - The path describes a UDP-o-IP encapsulation. - @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2 - @param next_hop[16] - the next hop address - @param next_hop_id - Used when the path resolves via an object that has a unique - identifier. e.g. the UDP encap object - - WARNING: this type is replicated, pending cleanup completion -*/ -typeonly define fib_path3 -{ - u32 sw_if_index; - u32 table_id; - u8 weight; - u8 preference; - u8 is_local; - u8 is_drop; - u8 is_udp_encap; - u8 afi; - u8 next_hop[16]; - u32 next_hop_id; - u32 rpf_id; - u8 n_labels; - u32 label_stack[16]; -}; - /** \brief BIER Route Add / del route @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request diff --git a/src/vnet/classify/classify.api b/src/vnet/classify/classify.api index 532638c507e..c22d6104704 100644 --- a/src/vnet/classify/classify.api +++ b/src/vnet/classify/classify.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Add/Delete classification table request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/cop/cop.api b/src/vnet/cop/cop.api index a11b45170a4..bcdd562efcf 100644 --- a/src/vnet/cop/cop.api +++ b/src/vnet/cop/cop.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief cop: enable/disable junk filtration features on an interface @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/devices/af_packet/af_packet.api b/src/vnet/devices/af_packet/af_packet.api index a1b30d5eb3c..d7637da670c 100644 --- a/src/vnet/devices/af_packet/af_packet.api +++ b/src/vnet/devices/af_packet/af_packet.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Create host-interface @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/devices/netmap/netmap.api b/src/vnet/devices/netmap/netmap.api index d2de03388ea..a14753cad9c 100644 --- a/src/vnet/devices/netmap/netmap.api +++ b/src/vnet/devices/netmap/netmap.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Create netmap @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/devices/tap/tapv2.api b/src/vnet/devices/tap/tapv2.api index 0d86edff735..21c3ffb275c 100644 --- a/src/vnet/devices/tap/tapv2.api +++ b/src/vnet/devices/tap/tapv2.api @@ -19,7 +19,7 @@ the Linux kernel TAP device driver */ -vl_api_version 1.1.0 +option version = "1.1.0"; /** \brief Initialize a new tap interface with the given paramters @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/devices/virtio/vhost_user.api b/src/vnet/devices/virtio/vhost_user.api index 6f21cb6c3ab..ccaa87cf0ce 100644 --- a/src/vnet/devices/virtio/vhost_user.api +++ b/src/vnet/devices/virtio/vhost_user.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief vhost-user interface create request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/dhcp/dhcp.api b/src/vnet/dhcp/dhcp.api index 19650f5628b..528915a46e9 100644 --- a/src/vnet/dhcp/dhcp.api +++ b/src/vnet/dhcp/dhcp.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.1 +option version = "1.0.1"; /** \brief DHCP Proxy config add / del request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/dns/dns.api b/src/vnet/dns/dns.api index f188b059c2f..4045b8111c4 100644 --- a/src/vnet/dns/dns.api +++ b/src/vnet/dns/dns.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief enable/disable name resolution diff --git a/src/vnet/ethernet/p2p_ethernet.api b/src/vnet/ethernet/p2p_ethernet.api index ead7cab9f80..c75ed40c61c 100644 --- a/src/vnet/ethernet/p2p_ethernet.api +++ b/src/vnet/ethernet/p2p_ethernet.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; define p2p_ethernet_add { @@ -49,4 +49,4 @@ define p2p_ethernet_del_reply * Local Variables: * eval: (c-set-style "gnu") * End: - */
\ No newline at end of file + */ diff --git a/src/vnet/feature/feature.api b/src/vnet/feature/feature.api index c37105491e8..96ee72420af 100644 --- a/src/vnet/feature/feature.api +++ b/src/vnet/feature/feature.api @@ -19,7 +19,7 @@ called through a shared memory interface. */ -vl_api_version 1.0.1 +option version = "1.0.1"; /** \brief Feature path enable/disable request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/fib/fib_types.api b/src/vnet/fib/fib_types.api new file mode 100644 index 00000000000..61a0898819d --- /dev/null +++ b/src/vnet/fib/fib_types.api @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2016 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** \brief FIB path + @param sw_if_index - index of the interface + @param weight - The weight, for UCMP + @param preference - The preference of the path. lowest preference + is prefered + @param is_local - local if non-zero, else remote + @param is_drop - Drop the packet + @param is_udp_encap - The path describes a UDP-o-IP encapsulation. + @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2 + @param next_hop[16] - the next hop address + @param next_hop_id - Used when the path resolves via an object + that has a unique identifier. e.g. the UDP + encap object +*/ +typeonly define fib_path3 +{ + u32 sw_if_index; + u32 table_id; + u8 weight; + u8 preference; + u8 is_local; + u8 is_drop; + u8 is_udp_encap; + u8 afi; + u8 next_hop[16]; + u32 next_hop_id; + u32 rpf_id; + u8 n_labels; + u32 label_stack[16]; +}; diff --git a/src/vnet/flow/flow.api b/src/vnet/flow/flow.api index 6c49428f152..9bd3790a430 100644 --- a/src/vnet/flow/flow.api +++ b/src/vnet/flow/flow.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Configure IPFIX exporter process request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/geneve/geneve.api b/src/vnet/geneve/geneve.api index 9be4bb341d6..b48989c2687 100644 --- a/src/vnet/geneve/geneve.api +++ b/src/vnet/geneve/geneve.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; define geneve_add_del_tunnel { diff --git a/src/vnet/gre/gre.api b/src/vnet/gre/gre.api index 1091835617c..b410ac9d49a 100644 --- a/src/vnet/gre/gre.api +++ b/src/vnet/gre/gre.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; define gre_add_del_tunnel { diff --git a/src/vnet/interface.api b/src/vnet/interface.api index fbbb9406fc6..a8733d1854f 100644 --- a/src/vnet/interface.api +++ b/src/vnet/interface.api @@ -1,4 +1,4 @@ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Set flags on the interface @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/ip/ip.api b/src/vnet/ip/ip.api index 54047b6ae93..0da0a61fb75 100644 --- a/src/vnet/ip/ip.api +++ b/src/vnet/ip/ip.api @@ -19,7 +19,7 @@ called through a shared memory interface. */ -vl_api_version 1.0.1 +option version = "1.0.1"; /** \brief Add / del table request A table can be added multiple times, but need be deleted only once. diff --git a/src/vnet/ip/punt.api b/src/vnet/ip/punt.api index a67b592711d..4477e5c14e5 100644 --- a/src/vnet/ip/punt.api +++ b/src/vnet/ip/punt.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Punt traffic to the host @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/ipsec-gre/ipsec_gre.api b/src/vnet/ipsec-gre/ipsec_gre.api index ad6ec4e84e0..770746d5e32 100644 --- a/src/vnet/ipsec-gre/ipsec_gre.api +++ b/src/vnet/ipsec-gre/ipsec_gre.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Add / del ipsec gre tunnel request @param client_index - opaque cookie to identify the sender @@ -78,4 +78,4 @@ define ipsec_gre_tunnel_details { * eval: (c-set-style "gnu") * End: */ -
\ No newline at end of file + diff --git a/src/vnet/ipsec/ipsec.api b/src/vnet/ipsec/ipsec.api index 1b2e4bdd01c..bf2bc606e65 100644 --- a/src/vnet/ipsec/ipsec.api +++ b/src/vnet/ipsec/ipsec.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief IPsec: Add/delete Security Policy Database @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/l2/l2.api b/src/vnet/l2/l2.api index 0ef71139331..5102783bcb4 100644 --- a/src/vnet/l2/l2.api +++ b/src/vnet/l2/l2.api @@ -14,7 +14,7 @@ * limitations under the License. */ -vl_api_version 2.0.0 +option version = "2.0.0"; /** \brief Reply to l2_xconnect_dump @param context - sender context which was passed in the request diff --git a/src/vnet/l2tp/l2tp.api b/src/vnet/l2tp/l2tp.api index 1ccf71b89a7..f679b751789 100644 --- a/src/vnet/l2tp/l2tp.api +++ b/src/vnet/l2tp/l2tp.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief l2tpv3 tunnel interface create request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/lisp-cp/lisp.api b/src/vnet/lisp-cp/lisp.api index 7ec17d99799..0e475856944 100644 --- a/src/vnet/lisp-cp/lisp.api +++ b/src/vnet/lisp-cp/lisp.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; typeonly manual_print manual_endian define local_locator { diff --git a/src/vnet/lisp-cp/one.api b/src/vnet/lisp-cp/one.api index 6cb2ef3a620..32ac70220c5 100644 --- a/src/vnet/lisp-cp/one.api +++ b/src/vnet/lisp-cp/one.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; typeonly manual_print manual_endian define one_local_locator { diff --git a/src/vnet/lisp-gpe/lisp_gpe.api b/src/vnet/lisp-gpe/lisp_gpe.api index 626038fc234..09c1e846bfb 100644 --- a/src/vnet/lisp-gpe/lisp_gpe.api +++ b/src/vnet/lisp-gpe/lisp_gpe.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief GPE locator structure @param is_ip4 - whether addr is IPv4 or v6 diff --git a/src/vnet/lldp/lldp.api b/src/vnet/lldp/lldp.api index acc5f71a25d..2ad80d8108c 100644 --- a/src/vnet/lldp/lldp.api +++ b/src/vnet/lldp/lldp.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief configure global parameter for LLDP @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/map/map.api b/src/vnet/map/map.api index a63703aac01..a066b688514 100644 --- a/src/vnet/map/map.api +++ b/src/vnet/map/map.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.1.0 +option version = "1.1.0"; /** \brief Add MAP domains @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/mpls/mpls.api b/src/vnet/mpls/mpls.api index 6ed462cf8d3..572ac915a4a 100644 --- a/src/vnet/mpls/mpls.api +++ b/src/vnet/mpls/mpls.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.1 +option version = "1.0.1"; /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create a per-prefix label entry. diff --git a/src/vnet/pg/pg.api b/src/vnet/pg/pg.api index 46c9645b2c5..8f986cbc5ed 100644 --- a/src/vnet/pg/pg.api +++ b/src/vnet/pg/pg.api @@ -18,7 +18,7 @@ This file defines packet-generator interface APIs. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief PacketGenerator create interface request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/policer/policer.api b/src/vnet/policer/policer.api index 13024ddee15..8ca0ffbc791 100644 --- a/src/vnet/policer/policer.api +++ b/src/vnet/policer/policer.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Add/del policer @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/session/session.api b/src/vnet/session/session.api index 735b826f21f..1c3e84b7ea1 100644 --- a/src/vnet/session/session.api +++ b/src/vnet/session/session.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief client->vpp, attach application to session layer @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/span/span.api b/src/vnet/span/span.api index a0f29153d27..8cbac7b73aa 100644 --- a/src/vnet/span/span.api +++ b/src/vnet/span/span.api @@ -14,7 +14,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Enable/Disable span to mirror traffic from one interface to another @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/srmpls/sr_mpls.api b/src/vnet/srmpls/sr_mpls.api index e11dbb7ab61..2c981417089 100644 --- a/src/vnet/srmpls/sr_mpls.api +++ b/src/vnet/srmpls/sr_mpls.api @@ -13,7 +13,8 @@ * under the License. */ -vl_api_version 1.0 .0 +option version = "1.0.0"; + /** \brief MPLS SR policy add @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request @@ -22,7 +23,7 @@ vl_api_version 1.0 .0 @param type is the type of the SR policy. (0.Default // 1.Spray) @param segments vector of labels (20bit) composing the segment list */ - autoreply define sr_mpls_policy_add +autoreply define sr_mpls_policy_add { u32 client_index; u32 context; diff --git a/src/vnet/srv6/sr.api b/src/vnet/srv6/sr.api index f2f6e78807d..bc22d61a288 100644 --- a/src/vnet/srv6/sr.api +++ b/src/vnet/srv6/sr.api @@ -14,7 +14,7 @@ * limitations under the License. */ -vl_api_version 1.0.1 +option version = "1.0.1"; /** \brief IPv6 SR LocalSID add/del request @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/tcp/tcp.api b/src/vnet/tcp/tcp.api index 093a5a89726..05f9aeb3e7b 100644 --- a/src/vnet/tcp/tcp.api +++ b/src/vnet/tcp/tcp.api @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +option version = "1.0.0"; /** \brief Configure TCP source addresses, for active-open TCP sessions diff --git a/src/vnet/udp/udp.api b/src/vnet/udp/udp.api index 25ee96489a2..9f5e2ece6ba 100644 --- a/src/vnet/udp/udp.api +++ b/src/vnet/udp/udp.api @@ -19,7 +19,7 @@ called through a shared memory interface. */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Add / del table request A table can be added multiple times, but need be deleted only once. diff --git a/src/vnet/unix/tap.api b/src/vnet/unix/tap.api index 6b1b2b4f0fc..861d4793191 100644 --- a/src/vnet/unix/tap.api +++ b/src/vnet/unix/tap.api @@ -19,7 +19,7 @@ the Linux kernel TAP device driver */ -vl_api_version 1.0.0 +option version = "1.0.0"; /** \brief Initialize a new tap interface with the given paramters @param client_index - opaque cookie to identify the sender diff --git a/src/vnet/vxlan-gpe/vxlan_gpe.api b/src/vnet/vxlan-gpe/vxlan_gpe.api index 6391148f687..89d37073737 100644 --- a/src/vnet/vxlan-gpe/vxlan_gpe.api +++ b/src/vnet/vxlan-gpe/vxlan_gpe.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; define vxlan_gpe_add_del_tunnel { @@ -78,4 +78,4 @@ autoreply define sw_interface_set_vxlan_gpe_bypass * Local Variables: * eval: (c-set-style "gnu") * End: - */
\ No newline at end of file + */ diff --git a/src/vnet/vxlan/vxlan.api b/src/vnet/vxlan/vxlan.api index 64850f0449f..d8ace33eb87 100644 --- a/src/vnet/vxlan/vxlan.api +++ b/src/vnet/vxlan/vxlan.api @@ -13,7 +13,7 @@ * limitations under the License. */ -vl_api_version 1.0.0 +option version = "1.0.0"; define vxlan_add_del_tunnel { |