From c0e9441e79b63ea09d5b282910d104960d45026d Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Tue, 28 Apr 2020 01:12:04 -0400 Subject: tests: move defaults from defaultmapping to .api files facilitates use of papi beyond the tests. Type: improvement Change-Id: I3d502d9130b81a7fb65ee69bb06fe55802b28a27 Signed-off-by: Paul Vinciguerra --- src/plugins/acl/acl.api | 12 ++++++------ src/plugins/lb/lb.api | 4 ++-- src/plugins/map/map.api | 4 ++-- src/vnet/bonding/bond.api | 4 ++-- src/vnet/ip/ip.api | 18 +++++++++--------- src/vnet/l2/l2.api | 2 +- src/vnet/mpls/mpls.api | 6 +++--- src/vnet/session/session.api | 2 +- src/vnet/srv6/sr.api | 4 ++-- src/vnet/syslog/syslog.api | 10 +++++----- src/vnet/vxlan-gbp/vxlan_gbp.api | 2 +- test/vpp_papi_provider.py | 17 +---------------- 12 files changed, 35 insertions(+), 50 deletions(-) diff --git a/src/plugins/acl/acl.api b/src/plugins/acl/acl.api index f4f6c9cf4b9..5d808fdca42 100644 --- a/src/plugins/acl/acl.api +++ b/src/plugins/acl/acl.api @@ -225,14 +225,14 @@ manual_endian manual_print define acl_details /** \brief Dump the list(s) of ACL applied to specific or all interfaces @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request - @param sw_if_index - interface to dump the ACL list for + @param sw_if_index - interface for which to dump the ACL list. Default: 0xffffffff (All interfaces) */ define acl_interface_list_dump { u32 client_index; u32 context; - vl_api_interface_index_t sw_if_index; /* ~0 for all interfaces */ + vl_api_interface_index_t sw_if_index [default=0xffffffff]; option vat_help = "[ | sw_if_index ]"; }; @@ -287,7 +287,7 @@ define macip_acl_add_reply /** \brief Add/Replace a MACIP ACL @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request - @param acl_index - an existing MACIP ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new MACIP ACL + @param acl_index - an existing MACIP ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new MACIP ACL Default: 0xffffffff @param tag - descriptive value for this MACIP ACL @param count - number of rules in this MACIP ACL @param r - vector of MACIP ACL rules @@ -297,7 +297,7 @@ manual_endian manual_print define macip_acl_add_replace { u32 client_index; u32 context; - u32 acl_index; /* ~0 to add, existing MACIP ACL# to replace */ + u32 acl_index [default=0xffffffff]; /* ~0 to add, existing MACIP ACL# to replace */ string tag[64]; u32 count; vl_api_macip_acl_rule_t r[count]; @@ -353,14 +353,14 @@ autoreply manual_print define macip_acl_interface_add_del /** \brief Dump one or all defined MACIP ACLs @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request - @param acl_index - MACIP ACL index or ~0 to dump all MACIP ACLs + @param acl_index - MACIP ACL index or ~0 to dump all MACIP ACLs Default: 0xffffffff */ define macip_acl_dump { u32 client_index; u32 context; - u32 acl_index; /* ~0 for all ACLs */ + u32 acl_index [default=0xffffffff]; /* ~0 for all ACLs */ option vat_help = "[]"; }; diff --git a/src/plugins/lb/lb.api b/src/plugins/lb/lb.api index e30bab6fbf2..564fe232451 100644 --- a/src/plugins/lb/lb.api +++ b/src/plugins/lb/lb.api @@ -18,8 +18,8 @@ autoreply manual_print define lb_conf u32 context; vl_api_ip4_address_t ip4_src_address; vl_api_ip6_address_t ip6_src_address; - u32 sticky_buckets_per_core; - u32 flow_timeout; + u32 sticky_buckets_per_core [default=0xffffffff]; + u32 flow_timeout [default=0xffffffff]; option vat_help = "[ip4-src-address ] [ip6-src-address ] [buckets ] [timeout ]"; }; diff --git a/src/plugins/map/map.api b/src/plugins/map/map.api index badf76db2dc..79deac86f8f 100644 --- a/src/plugins/map/map.api +++ b/src/plugins/map/map.api @@ -27,7 +27,7 @@ import "vnet/interface_types.api"; @param ea_bits_len - Embedded Address bits length @param psid_offset - Port Set Identifier (PSID) offset @param psid_length - PSID length - @param mtu - MTU + @param mtu - MTU. default 1280 @param tag - A user field stored with the MAP */ define map_add_domain @@ -40,7 +40,7 @@ define map_add_domain u8 ea_bits_len; u8 psid_offset; u8 psid_length; - u16 mtu; + u16 mtu [default=1280]; string tag[64]; }; diff --git a/src/vnet/bonding/bond.api b/src/vnet/bonding/bond.api index 34fa0204a39..865dcbe0857 100644 --- a/src/vnet/bonding/bond.api +++ b/src/vnet/bonding/bond.api @@ -49,7 +49,7 @@ enum bond_lb_algo @param id - if non-~0, specifies a custom interface ID @param use_custom_mac - if set, mac_address is valid @param mac_address - mac addr to assign to the interface if use_custom_mac is set - @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcastcast, 5=lacp) + @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcast, 5=lacp) @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored @param numa_only - if numa_only is set, pkts will be transmitted by LAG members on local numa node only if have at least one, otherwise it works as usual. */ @@ -57,7 +57,7 @@ define bond_create { u32 client_index; u32 context; - u32 id; + u32 id [default=0xFFFFFFFF]; bool use_custom_mac; vl_api_mac_address_t mac_address; vl_api_bond_mode_t mode; diff --git a/src/vnet/ip/ip.api b/src/vnet/ip/ip.api index 73c73a3cee0..5624bcfaf6a 100644 --- a/src/vnet/ip/ip.api +++ b/src/vnet/ip/ip.api @@ -31,11 +31,11 @@ import "vnet/interface_types.api"; /** \brief An IP table @param is_ipv6 - V4 or V6 table @param table_id - table ID associated with the route - This table ID will apply to both the unicats - and mlticast FIBs + This table ID will apply to both the unicast + and multicast FIBs @param name - A client provided name/tag for the table. If this is not set by the client, then VPP will generate something - meaningfull. + meaningful. */ typedef ip_table { @@ -73,10 +73,10 @@ define ip_table_dump has a very different set of entries it wants in the table than VPP currently has. The CP would thus like to 'replace' VPP's current table only by specifying what the new set of entries shall be, i.e. it is not - going to delete anything that already eixts. - the CP delcartes the start of this procedure with this begin_replace + going to delete anything that already exists. + the CP declares the start of this procedure with this begin_replace API Call, and when it has populated all the entries it wants, it calls - the below end_replace API. From this point on it is of coursce free + the below end_replace API. From this point on it is of course free to add and delete entries as usual. The underlying mechanism by which VPP implements this replace is purposefully left unspecified. @@ -336,7 +336,7 @@ define ip_address_dump /** \brief IP unnumbered configurations @param sw_if_index The interface that has unnumbered configuration - @param ip_sw_if_index The IP interface that it is unnnumbered to + @param ip_sw_if_index The IP interface that it is unnumbered to */ define ip_unnumbered_details { @@ -352,7 +352,7 @@ define ip_unnumbered_dump { u32 client_index; u32 context; - vl_api_interface_index_t sw_if_index; + vl_api_interface_index_t sw_if_index [default=0xffffffff]; }; define ip_details @@ -404,7 +404,7 @@ autoreply define ip_punt_police /** \brief Punt redirect type @param rx_sw_if_index - specify the original RX interface of traffic that should be redirected. ~0 means any interface. - @param tx_sw_if_index - the TX interface to which traffic shoulde be + @param tx_sw_if_index - the TX interface to which traffic should be redirected. @param nh - the next-hop to redirect the traffic to. @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4 diff --git a/src/vnet/l2/l2.api b/src/vnet/l2/l2.api index 00ff66c9019..b6bd4b5f7b1 100644 --- a/src/vnet/l2/l2.api +++ b/src/vnet/l2/l2.api @@ -610,7 +610,7 @@ autoreply define bvi_delete vl_api_interface_index_t sw_if_index; }; -/** \brief Register for IP4 ARP resolution event on receing ARP reply or +/** \brief Register for IP4 ARP resolution event on receiving ARP reply or MAC/IP info from ARP requests in L2 BDs @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request diff --git a/src/vnet/mpls/mpls.api b/src/vnet/mpls/mpls.api index 25aa1c645af..fb3ab1a4798 100644 --- a/src/vnet/mpls/mpls.api +++ b/src/vnet/mpls/mpls.api @@ -81,7 +81,7 @@ define mpls_tunnel_dump { u32 client_index; u32 context; - vl_api_interface_index_t sw_if_index; + vl_api_interface_index_t sw_if_index [default=0xffffffff]; }; /** \brief mpls tunnel details @@ -99,7 +99,7 @@ manual_endian manual_print define mpls_tunnel_details @param mt_is_add - Is this a route add or delete @param mt_name - A client provided name/tag for the table. If this is not set by the client, then VPP will generate - something meaningfull. + something meaningful. */ typedef mpls_table { @@ -133,7 +133,7 @@ define mpls_table_details @param mr_table_id - The MPLS table-id the route is added in @param mr_label - The MPLS label value @param mr_eos - The End of stack bit - @param mr_eos_proto - If EOS then this is the DPO packect's proto post pop + @param mr_eos_proto - If EOS then this is the DPO packet's proto post pop @param mr_is_multicast - Is this a multicast route @param mr_n_paths - The number of paths @param mr_paths - The paths diff --git a/src/vnet/session/session.api b/src/vnet/session/session.api index b897ae020ed..2f5e452533c 100644 --- a/src/vnet/session/session.api +++ b/src/vnet/session/session.api @@ -218,7 +218,7 @@ define app_namespace_add_del { u32 client_index; u32 context; u64 secret; - vl_api_interface_index_t sw_if_index; + vl_api_interface_index_t sw_if_index [default=0xffffffff]; u32 ip4_fib_id; u32 ip6_fib_id; string namespace_id[]; diff --git a/src/vnet/srv6/sr.api b/src/vnet/srv6/sr.api index 75a23b06e04..b33f0ebd811 100644 --- a/src/vnet/srv6/sr.api +++ b/src/vnet/srv6/sr.api @@ -36,7 +36,7 @@ typedef srv6_sid_list @param end_psp Boolean of whether decapsulation is allowed in this function @param behavior Type of behavior (function) for this localsid @param sw_if_index Only for L2/L3 xconnect. OIF. In VRF variant the - fib_table. + fib_table. Default:0xffffffff @param vlan_index Only for L2 xconnect. Outgoing VLAN tag. @param fib_table FIB table in which we should install the localsid entry @param nh_addr Next Hop IPv46 address. Only for L2/L3 xconnect. @@ -49,7 +49,7 @@ autoreply define sr_localsid_add_del vl_api_ip6_address_t localsid; bool end_psp; vl_api_sr_behavior_t behavior; - vl_api_interface_index_t sw_if_index; + vl_api_interface_index_t sw_if_index [default=0xffffffff]; u32 vlan_index; u32 fib_table; vl_api_address_t nh_addr; diff --git a/src/vnet/syslog/syslog.api b/src/vnet/syslog/syslog.api index 3ba5d69cc41..556de61015d 100644 --- a/src/vnet/syslog/syslog.api +++ b/src/vnet/syslog/syslog.api @@ -33,9 +33,9 @@ enum syslog_severity @param context - sender context, to match reply w/ request @param src_address - IPv4 address of syslog sender (source) @param collector_address - IPv4 address of syslog collector (destination) - @param collector_port - UDP port of syslog colector (destination) + @param collector_port - UDP port of syslog collector (destination) Default: 514 @param vrf_id - VRF/FIB table ID - @param max_msg_size - maximum message length + @param max_msg_size - maximum message length. Default: 480 */ autoreply define syslog_set_sender { @@ -43,9 +43,9 @@ autoreply define syslog_set_sender u32 context; vl_api_ip4_address_t src_address; vl_api_ip4_address_t collector_address; - u16 collector_port; + u16 collector_port [default=514]; u32 vrf_id; - u32 max_msg_size; + u32 max_msg_size [default=480]; }; /** \brief Get syslog sender configuration @@ -63,7 +63,7 @@ define syslog_get_sender @param retval - return code for the request @param src_address - IPv4 address of syslog sender (source) @param collector_address - IPv4 address of syslog collector (destination) - @param collector_port - UDP port of syslog colector (destination) + @param collector_port - UDP port of syslog collector (destination) @param vrf_id - VRF/FIB table ID @param max_msg_size - maximum message length */ diff --git a/src/vnet/vxlan-gbp/vxlan_gbp.api b/src/vnet/vxlan-gbp/vxlan_gbp.api index 40d61a5f804..c3a8845dec3 100644 --- a/src/vnet/vxlan-gbp/vxlan_gbp.api +++ b/src/vnet/vxlan-gbp/vxlan_gbp.api @@ -69,7 +69,7 @@ define vxlan_gbp_tunnel_dump { u32 client_index; u32 context; - vl_api_interface_index_t sw_if_index; + vl_api_interface_index_t sw_if_index [default=0xffffffff]; }; define vxlan_gbp_tunnel_details diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py index 1e0226c878e..94de500d9f9 100644 --- a/test/vpp_papi_provider.py +++ b/test/vpp_papi_provider.py @@ -20,12 +20,8 @@ from vpp_ip_route import MPLS_IETF_MAX_LABEL, MPLS_LABEL_INVALID # named parameters # defaultmapping = { - 'map_add_domain': {'mtu': 1280}, - 'syslog_set_sender': {'collector_port': 514, - 'max_msg_size': 480}, + 'acl_interface_add_del': {'is_add': 1, 'is_input': 1}, - 'acl_interface_list_dump': {'sw_if_index': 4294967295, }, - 'app_namespace_add_del': {'sw_if_index': 4294967295, }, 'bd_ip_mac_add_del': {'is_add': 1, }, 'bfd_udp_add': {'is_authenticated': False, 'bfd_key_id': None, 'conf_key_id': None}, @@ -37,10 +33,8 @@ defaultmapping = { 'bier_imp_add': {'is_add': 1, }, 'bier_route_add_del': {'is_add': 1, }, 'bier_table_add_del': {'is_add': 1, }, - 'bond_create': {'mac_address': '', 'id': 0xFFFFFFFF}, 'bridge_domain_add_del': {'flood': 1, 'uu_flood': 1, 'forward': 1, 'learn': 1, 'is_add': 1, }, - 'bvi_create': {'user_instance': 4294967295, }, 'bvi_delete': {}, 'gbp_subnet_add_del': {'sw_if_index': 4294967295, 'epg_id': 65535, }, 'geneve_add_del_tunnel': {'mcast_sw_if_index': 4294967295, 'is_add': 1, @@ -58,7 +52,6 @@ defaultmapping = { 'ip_punt_police': {'is_add': 1, }, 'ip_punt_redirect': {'is_add': 1, }, 'ip_route_add_del': {'is_add': 1, }, - 'ip_unnumbered_dump': {'sw_if_index': 4294967295, }, 'ipsec_interface_add_del_spd': {'is_add': 1, }, 'ipsec_sad_entry_add_del': {'is_add': 1, }, 'ipsec_spd_add_del': {'is_add': 1, }, @@ -70,15 +63,11 @@ defaultmapping = { 'ipsec_tunnel_if_add_del': {'is_add': 1, 'anti_replay': 1, }, 'l2_emulation': {'enable': 1, }, 'l2fib_add_del': {'is_add': 1, }, - 'lb_conf': {'sticky_buckets_per_core': 4294967295, - 'flow_timeout': 4294967295}, 'lisp_add_del_adjacency': {'is_add': 1, }, 'lisp_add_del_local_eid': {'is_add': 1, }, 'lisp_add_del_locator': {'priority': 1, 'weight': 1, 'is_add': 1, }, 'lisp_add_del_locator_set': {'is_add': 1, }, 'lisp_add_del_remote_mapping': {'is_add': 1, }, - 'macip_acl_add_replace': {'acl_index': 4294967295, }, - 'macip_acl_dump': {'acl_index': 4294967295, }, 'macip_acl_interface_add_del': {'is_add': 1, }, 'mpls_ip_bind_unbind': {'is_ip4': 1, 'is_bind': 1, }, 'mpls_route_add_del': {'mr_next_hop_sw_if_index': 4294967295, @@ -91,7 +80,6 @@ defaultmapping = { 'next_hop_weight': 1, 'next_hop_via_label': 1048576, 'is_add': 1, }, - 'mpls_tunnel_dump': {'sw_if_index': 4294967295, }, 'output_acl_set_interface': {'ip4_table_index': 4294967295, 'ip6_table_index': 4294967295, 'l2_table_index': 4294967295, }, @@ -102,13 +90,11 @@ defaultmapping = { 'set_ip_flow_hash': {'src': 1, 'dst': 1, 'sport': 1, 'dport': 1, 'proto': 1, }, 'set_ipfix_exporter': {'collector_port': 4739, }, - 'sr_localsid_add_del': {'sw_if_index': 4294967295, }, 'sr_policy_add': {'weight': 1, 'is_encap': 1, }, 'svs_enable_disable': {'is_enable': 1, }, 'svs_route_add_del': {'is_add': 1, }, 'svs_table_add_del': {'is_add': 1, }, 'sw_interface_add_del_address': {'is_add': 1, }, - 'sw_interface_dump': {'sw_if_index': 4294967295, }, 'sw_interface_ip6nd_ra_prefix': {'val_lifetime': 4294967295, 'pref_lifetime': 4294967295, }, 'sw_interface_set_ip_directed_broadcast': {'enable': 1, }, @@ -120,7 +106,6 @@ defaultmapping = { 'vxlan_add_del_tunnel': {'mcast_sw_if_index': 4294967295, 'is_add': 1, 'decap_next_index': 4294967295, 'instance': 4294967295, }, - 'vxlan_gbp_tunnel_dump': {'sw_if_index': 4294967295, }, 'vxlan_gpe_add_del_tunnel': {'mcast_sw_if_index': 4294967295, 'is_add': 1, 'protocol': 3, }, 'want_bfd_events': {'enable_disable': 1, }, -- cgit 1.2.3-korg