/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2018 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.
 */

/** \file

    This file defines vpp IP control-plane API messages which are generally
    called through a shared memory interface.
*/

option version = "3.0.1";

import "vnet/interface_types.api";
import "vnet/fib/fib_types.api";
import "vnet/ethernet/ethernet_types.api";
import "vnet/mfib/mfib_types.api";
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 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
		  meaningful.
*/
typedef ip_table
{
  u32 table_id;
  bool is_ip6;
  string name[64];
};

/** \brief Add / del table request
           A table can be added multiple times, but need be deleted only once.
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
autoreply define ip_table_add_del
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  vl_api_ip_table_t table;
};

/** \brief Dump IP all fib tables
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define ip_table_dump
{
  u32 client_index;
  u32 context;
};

/** \brief IP table replace being

    The use-case is that, for some unspecified reason, the control plane
    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 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 course free
    to add and delete entries as usual.
    The underlying mechanism by which VPP implements this replace is
    purposefully left unspecified.

    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param table - The table to resync
*/
autoreply define ip_table_replace_begin
{
  u32 client_index;
  u32 context;
  vl_api_ip_table_t table;
};

/** \brief IP table replace end

    see replace start/

    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param table - The table that has converged
*/
autoreply define ip_table_replace_end
{
  u32 client_index;
  u32 context;
  vl_api_ip_table_t table;
};

/** \brief IP table flush
    Flush a table of all routes
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param table - The table to flush
*/
autoreply define ip_table_flush
{
  u32 client_index;
  u32 context;
  vl_api_ip_table_t table;
};

/** \brief IP FIB table response
    @param context - sender context
    @param table - description of the table
*/
manual_endian manual_print define ip_table_details
{
  u32 context;
  vl_api_ip_table_t table;
};

/** \brief An IP route
  @param table_id The IP table the route is in
  @param stats_index The index of the route in the stats segment
  @param prefix the prefix for the route
  @param n_paths The number of paths the route has
  @param paths The paths of the route
*/
typedef ip_route
{
  u32 table_id;
  u32 stats_index;
  vl_api_prefix_t prefix;
  u8 n_paths;
  vl_api_fib_path_t paths[n_paths];
};

/** \brief Add / del route request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_multipath - Set to 1 if these paths will be added/removed
                          to/from the existing set, or 0 to replace
			  the existing set.
                          is_add=0 & is_multipath=0 implies delete all paths
    @param is_add - Are the paths being added or removed
*/
define ip_route_add_del
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  bool is_multipath;
  vl_api_ip_route_t route;
};
define ip_route_add_del_reply
{
  u32 context;
  i32 retval;
  u32 stats_index;
};

/** \brief Dump IP routes from a table
    @param client_index - opaque cookie to identify the sender
    @param table - The table from which to dump routes (ony ID an AF are needed)
*/
define ip_route_dump
{
  u32 client_index;
  u32 context;
  vl_api_ip_table_t table;
};

/** \brief IP FIB table entry response
    @param route The route entry in the table
*/
manual_endian manual_print define ip_route_details
{
  u32 context;
  vl_api_ip_route_t route;
};

/** \brief Lookup IP route from a table
    @param client_index - opaque cookie to identify the sender
    @param table_id - The IP table to look the route up in
    @param exact - 0 for normal route lookup, 1 for exact match only
    @param prefix - The prefix (or host) for route lookup.
*/
define ip_route_lookup
{
  u32 client_index;
  u32 context;
  u32 table_id;
  u8 exact;
  vl_api_prefix_t prefix;
};

/** \brief IP FIB table lookup response
    @param retval - return code of the lookup
    @param route - The route entry in the table if found
*/
define ip_route_lookup_reply
{
  u32 context;
  i32 retval;
  vl_api_ip_route_t route;
};

/** \brief Set the ip flow hash config for a fib request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param vrf_id - vrf/fib id
    @param is_ipv6 - if non-zero the fib is ip6, else ip4
    @param src - if non-zero include src in flow hash
    @param dst - if non-zero include dst in flow hash
    @param sport - if non-zero include sport in flow hash
    @param dport - if non-zero include dport in flow hash
    @param proto -if non-zero include proto in flow hash
    @param reverse - if non-zero include reverse in flow hash
    @param symmetric - if non-zero include symmetry in flow hash
*/
autoreply define set_ip_flow_hash
{
  u32 client_index;
  u32 context;
  u32 vrf_id;
  bool is_ipv6;
  bool src;
  bool dst;
  bool sport;
  bool dport;
  bool proto;
  bool reverse;
  bool symmetric;
};

/** \brief IPv6 interface enable / disable request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface used to reach neighbor
    @param enable - if non-zero enable ip6 on interface, else disable
*/
autoreply define sw_interface_ip6_enable_disable
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  bool enable;			/* set to true if enable */
};

/** \brief Dump IP multicast fib table
    @param client_index - opaque cookie to identify the sender
*/
define ip_mtable_dump
{
  u32 client_index;
  u32 context;
};
define ip_mtable_details
{
  u32 client_index;
  u32 context;
  vl_api_ip_table_t table;
};

/** \brief Add / del route request

    Adds a route, consisting both of the MFIB entry to match packets
    (which may already exist) and a path to send those packets down.
    Routes can be entered repeatedly to add multiple paths.  Deletions are
    per-path.

    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param table_id - fib table /vrf associated with the route
    @param is_add - true if adding a route; false if deleting one
    @param is_ipv6 - true iff all the addresses are v6
    @param entry_flags - see fib_entry_flag_t
    @param itf_flags - see mfib_entry_flags_t
    @param next_hop_afi - see dpo_proto_t; the type of destination description
    @param src_address - the source of the packet
    @param grp_address - the group the packet is destined to
    @param nh_address - the nexthop to forward the packet to
    @param next_hop_sw_if_index - interface to emit packet on

    BIER AFIs use the BIER imposition ID.  v4 and v6 AFIs use either the
    interface or the nexthop address.

    Note that if the route is source-specific (S is supplied, not all 0s),
    the prefix match is treated as exact (prefixlen /32 or /128).

    FIXME not complete yet
*/
typedef ip_mroute
{
  u32 table_id;
  u32 entry_flags;
  u32 rpf_id;
  vl_api_mprefix_t prefix;
  u8 n_paths;
  vl_api_mfib_path_t paths[n_paths];
};

define ip_mroute_add_del
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  bool is_multipath;
  vl_api_ip_mroute_t route;
};
define ip_mroute_add_del_reply
{
  u32 context;
  i32 retval;
  u32 stats_index;
};

/** \brief Dump IP multicast fib table
    @param table - The table from which to dump routes (ony ID an AF are needed)
*/
define ip_mroute_dump
{
  u32 client_index;
  u32 context;
  vl_api_ip_table_t table;
};

/** \brief IP Multicast Route Details
    @param route - Details of the route
*/
manual_endian manual_print define ip_mroute_details
{
  u32 context;
  vl_api_ip_mroute_t route;
};

define ip_address_details
{
  u32 context;
  vl_api_interface_index_t sw_if_index;
  vl_api_address_with_prefix_t prefix;
};

define ip_address_dump
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  bool is_ipv6;
};

/** \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 unnumbered to
*/
define ip_unnumbered_details
{
  u32 context;
  vl_api_interface_index_t sw_if_index;
  vl_api_interface_index_t ip_sw_if_index;
};

/** \brief Dump IP unnumbered configurations
    @param sw_if_index ~0 for all interfaces, else the interface desired
*/
define ip_unnumbered_dump
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index [default=0xffffffff];
};

define ip_details
{
  u32 context;
  vl_api_interface_index_t sw_if_index;
  bool is_ipv6;
};

define ip_dump
{
  u32 client_index;
  u32 context;
  bool is_ipv6;
};

define mfib_signal_dump
{
  u32 client_index;
  u32 context;
};

define mfib_signal_details
{
  u32 context;
  vl_api_interface_index_t sw_if_index;
  u32 table_id;
  vl_api_mprefix_t prefix;
  u16 ip_packet_len;
  u8 ip_packet_data[256];
};

/** \brief IP punt policer
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - 1 to add neighbor, 0 to delete
    @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
    @param policer_index - Index of policer to use
*/
autoreply define ip_punt_police
{
  u32 client_index;
  u32 context;
  u32 policer_index;
  bool is_add [default=true];
  bool is_ip6;
};

/** \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 should be
                            redirected.
    @param nh - the next-hop to redirect the traffic to.
    @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
*/
typedef punt_redirect
{
  vl_api_interface_index_t rx_sw_if_index;
  vl_api_interface_index_t tx_sw_if_index;
  vl_api_address_t nh;
};

/** \brief IP punt redirect
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param punt - punt definition
    @param is_add - 1 to add neighbor, 0 to delete
*/
autoreply define ip_punt_redirect
{
  u32 client_index;
  u32 context;
  vl_api_punt_redirect_t punt;
  bool is_add [default=true];
};

define ip_punt_redirect_dump
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  bool is_ipv6;
};

define ip_punt_redirect_details
{
  u32 context;
  vl_api_punt_redirect_t punt;
};

autoreply define ip_container_proxy_add_del
{
  u32 client_index;
  u32 context;
  vl_api_prefix_t pfx;
  vl_api_interface_index_t sw_if_index;
  bool is_add [default=true];
};

define ip_container_proxy_dump
{
  u32 client_index;
  u32 context;
};

define ip_container_proxy_details
{
  u32 context;
  vl_api_interface_index_t sw_if_index;
  vl_api_prefix_t prefix;
};

/** \brief Configure IP source and L4 port-range check
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_ip6 - 1 if source address type is IPv6
    @param is_add - 1 if add, 0 if delete
    @param ip - prefix to match
    @param number_of_ranges - length of low_port and high_port arrays (must match)
    @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
    @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
    @param vrf_id - fib table/vrf id to associate the source and port-range check with
    @note To specify a single port set low_port and high_port entry the same
*/
autoreply define ip_source_and_port_range_check_add_del
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  vl_api_prefix_t prefix;
  u8 number_of_ranges;
  u16 low_ports[32];
  u16 high_ports[32];
  u32 vrf_id;
};

/** \brief Set interface source and L4 port-range request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param interface_id - interface index
    @param tcp_vrf_id - VRF associated with source and TCP port-range check
    @param udp_vrf_id - VRF associated with source and TCP port-range check
*/
autoreply define ip_source_and_port_range_check_interface_add_del
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  vl_api_interface_index_t sw_if_index;
  u32 tcp_in_vrf_id;
  u32 tcp_out_vrf_id;
  u32 udp_in_vrf_id;
  u32 udp_out_vrf_id;
};

/** \brief IPv6 set link local address on interface request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface to set link local on
    @param ip - the new link local address
*/
autoreply define sw_interface_ip6_set_link_local_address
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  vl_api_ip6_address_t ip;
};

/** \brief IOAM enable : Enable in-band OAM
    @param id - profile id
    @param seqno - To enable Seqno Processing
    @param analyse - Enabling analysis of iOAM at decap node
    @param pow_enable - Proof of Work enabled or not flag
    @param trace_enable - iOAM Trace enabled or not flag
*/
autoreply define ioam_enable
{
  u32 client_index;
  u32 context;
  u16 id;
  bool seqno;
  bool analyse;
  bool pot_enable;
  bool trace_enable;
  u32 node_id;
};

/** \brief iOAM disable
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param index - MAP Domain index
*/
autoreply define ioam_disable
{
  u32 client_index;
  u32 context;
  u16 id;
};

enum ip_reass_type
{
  IP_REASS_TYPE_FULL = 0,
  IP_REASS_TYPE_SHALLOW_VIRTUAL = 0x1,
};

autoreply define ip_reassembly_set
{
  u32 client_index;
  u32 context;
  u32 timeout_ms;
  u32 max_reassemblies;
  u32 max_reassembly_length;
  u32 expire_walk_interval_ms;
  bool is_ip6;
  vl_api_ip_reass_type_t type;
};

define ip_reassembly_get
{
  u32 client_index;
  u32 context;
  bool is_ip6;
  vl_api_ip_reass_type_t type;
};

define ip_reassembly_get_reply
{
  u32 context;
  i32 retval;
  u32 timeout_ms;
  u32 max_reassemblies;
  u32 max_reassembly_length;
  u32 expire_walk_interval_ms;
  bool is_ip6;
};

/** \brief Enable/disable reassembly feature
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface to enable/disable feature on
    @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
    @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
*/
autoreply define ip_reassembly_enable_disable
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  bool enable_ip4;
  bool enable_ip6;
  vl_api_ip_reass_type_t type;
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
