/* 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.2";

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
*/
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
*/
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;
  vl_api_mfib_entry_flags_t 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
*/
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 IPv6 get 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
*/
define sw_interface_ip6_get_link_local_address
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
};

/** \brief IPv6 link local address detail
    @param context - sender context, to match reply w/ request
    @param ip - the link local address
*/
define sw_interface_ip6_get_link_local_address_reply
{
  u32 context;
  i32 retval;
  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:
 */
