/* 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 = "1.3.0";
import "vnet/ip/ip_types.api";
import "vnet/fib/fib_types.api";
import "vnet/ethernet/ethernet_types.api";

/** \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
    @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
    @param name - A client provided name/tag for the table. If this is
                  not set by the client, then VPP will generate something
		  meaningfull.
*/
autoreply define ip_table_add_del
{
  u32 client_index;
  u32 context;
  u32 table_id;
  u8 is_ipv6;
  u8 is_add;
  u8 name[64];
};

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

/** \brief IP FIB table response
    @param table_id - IP fib table id
    @address_length - mask length
    @address - ip4 prefix
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip_fib_details
{
  u32 context;
  u32 table_id;
  u8  table_name[64];
  u8  address_length;
  u8  address[4];
  u32 count;
  u32 stats_index;
  vl_api_fib_path_t path[count];
};

/** \brief Dump IP6 fib table
    @param client_index - opaque cookie to identify the sender
*/
define ip6_fib_dump
{
  u32 client_index;
  u32 context;
};

/** \brief IP6 FIB table entry response
    @param table_id - IP6 fib table id
    @param address_length - mask length
    @param address - ip6 prefix
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip6_fib_details
{
  u32 context;
  u32 table_id;
  u8  table_name[64];
  u8  address_length;
  u8  address[16];
  u32 count;
  u32 stats_index;
  vl_api_fib_path_t path[count];
};

/** \brief Dump IP neighboors
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - the interface to dump neighboors, ~0 == all
    @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
*/
define ip_neighbor_dump
{
    u32 client_index;
    u32 context;
    u32 sw_if_index;
    u8  is_ipv6;
};

/** \brief IP neighboors dump response
    @param context - sender context which was passed in the request
    @param sw_if_index - The interface used to reach the neighbor
    @param stats_index - An index in the stats segment that can be used to read
                         the counters for this neighbour.
    @param is_static - [1|0] to indicate if neighbor is statically configured
    @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
*/
define ip_neighbor_details {
    u32 context;
    u32 sw_if_index;
    u32 stats_index;
    u8  is_static;
    u8  is_ipv6;
    u8  mac_address[6];
    u8  ip_address[16];
};

/** \brief IP neighbor add / del 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 is_add - 1 to add neighbor, 0 to delete
    @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
    @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
    @param is_static - A static neighbor Entry - there are not flushed
                       If the interface goes down.
    @param is_no_adj_fib - Do not create a corresponding entry in the FIB
                           table for the neighbor.
    @param mac_address - l2 address of the neighbor
    @param dst_address - ip4 or ip6 address of the neighbor
*/
define ip_neighbor_add_del
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  /* 1 = add, 0 = delete */
  u8 is_add;
  u8 is_ipv6;
  u8 is_static;
  u8 is_no_adj_fib;
  u8 mac_address[6];
  u8 dst_address[16];
};

define ip_neighbor_add_del_reply
{
  u32 context;
  i32 retval;
  u32 stats_index;
};

/** \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
*/
autoreply define set_ip_flow_hash
{
  u32 client_index;
  u32 context;
  u32 vrf_id;
  u8 is_ipv6;
  u8 src;
  u8 dst;
  u8 sport;
  u8 dport;
  u8 proto;
  u8 reverse;
};

/** \brief IPv6 router advertisement config request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param suppress -
    @param managed -
    @param other -
    @param ll_option -
    @param send_unicast -
    @param cease -
    @param is_no -
    @param default_router -
    @param max_interval -
    @param min_interval -
    @param lifetime -
    @param initial_count -
    @param initial_interval -
*/
autoreply define sw_interface_ip6nd_ra_config
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 suppress;
  u8 managed;
  u8 other;
  u8 ll_option;
  u8 send_unicast;
  u8 cease;
  u8 is_no;
  u8 default_router;
  u32 max_interval;
  u32 min_interval;
  u32 lifetime;
  u32 initial_count;
  u32 initial_interval;
};

/** \brief IPv6 router advertisement prefix config request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - The interface the RA prefix information is for
    @param address[] - The prefix to advertise
    @param address_length - the prefix length
    @param use_default - Revert to default settings
    @param no_advertise - Do not advertise this prefix
    @param off_link - The prefix is off link (it is not configured on the interface)
                      Configures the L-flag, When set, indicates that this
		      prefix can be used for on-link determination.
    @param no_autoconfig - Setting for the A-flag. When
                           set indicates that this prefix can be used for
                          stateless address configuration.
    @param no_onlink - The prefix is not on link. Make sure this is consistent
                       with the off_link parameter else YMMV
    @param is_no - add/delete
    @param val_lifetime - The length of time in
                     seconds (relative to the time the packet is sent)
                     that the prefix is valid for the purpose of on-link
                     determination.  A value of all one bits
                     (0xffffffff) represents infinity
    @param pref_lifetime - The length of time in
                     seconds (relative to the time the packet is sent)
                     that addresses generated from the prefix via
                     stateless address autoconfiguration remain
                     preferred [ADDRCONF].  A value of all one bits
                     (0xffffffff) represents infinity.
*/
autoreply define sw_interface_ip6nd_ra_prefix
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 address[16];
  u8 address_length;
  u8 use_default;
  u8 no_advertise;
  u8 off_link;
  u8 no_autoconfig;
  u8 no_onlink;
  u8 is_no;
  u32 val_lifetime;
  u32 pref_lifetime;
};

/** \brief IPv6 ND proxy config
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - The interface the host is on
    @param address - The address of the host for which to proxy for
    @param is_add - Adding or deleting
*/
autoreply define ip6nd_proxy_add_del
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 is_del;
  u8 address[16];
};

/** \brief IPv6 ND proxy details returned after request
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
*/
define ip6nd_proxy_details
{
  u32 context;
  u32 sw_if_index;
  u8 address[16];
};

/** \brief IPv6 ND proxy dump request
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param sw_if_index - The interface the host is on
    @param address - The address of the host for which to proxy for
*/
define ip6nd_proxy_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Start / stop sending router solicitation
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param irt - initial retransmission time
    @param mrt - maximum retransmission time
    @param mrc - maximum retransmission count
    @param mrd - maximum retransmission duration
    @param sw_if_index - software interface index of interface
                         for sending router solicitation
    @param stop - if non-zero then stop sending router solicitation,
                  otherwise start sending router solicitation
*/
autoreply define ip6nd_send_router_solicitation
{
  u32 client_index;
  u32 context;
  u32 irt;
  u32 mrt;
  u32 mrc;
  u32 mrd;
  u32 sw_if_index;
  u8 stop;
};

/** \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;
  u32 sw_if_index;
  u8 enable;			/* set to true if enable */
};

/** \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 address[] - the new link local address
*/
autoreply define sw_interface_ip6_set_link_local_address
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 address[16];
};

/** \brief Add / del route request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - software index of the new vlan's parent interface
    @param vrf_id - fib table /vrf associated with the route
    @param lookup_in_vrf - 
    @param classify_table_index - 
    @param is_add - 1 if adding the route, 0 if deleting
    @param is_drop - Drop the packet
    @param is_unreach - Drop the packet and rate limit send ICMP unreachable
    @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
    @param is_ipv6 - 0 if an ip4 route, else ip6
    @param is_local - The route will result in packets sent to VPP IP stack
    @param is_udp_encap - The path describes a UDP-o-IP encapsulation.
    @param is_classify - 
    @param is_multipath - Set to 1 if this is a multipath route, else 0
    @param is_dvr - Does the route resolve via a DVR interface.
    @param is_source_lookup - The the path is a deaggregate path (i.e. a lookup
    	   		      in another table) is the lookup on the packet's
			      source address or destination.
    @param next_hop_weight - Weight for Unequal cost multi-path
    @param next_hop_preference - Path that are up that have the best preference are
                                 are used for forwarding. lower value is better.
    @param next_hop_id - Used when the path resolves via an object that has a unique
                         identifier.
    @param dst_address_length - 
    @param dst_address[16] - 
    @param next_hop_address[16] - 
    @param next_hop_n_out_labels - the number of labels in the label stack
    @param next_hop_out_label_stack - the next-hop output label stack, outer most first
    @param next_hop_via_label - The next-hop is a resolved via a local label
*/
define ip_add_del_route
{
  u32 client_index;
  u32 context;
  u32 next_hop_sw_if_index;
  u32 table_id;
  u32 classify_table_index;
  u32 next_hop_table_id;
  u32 next_hop_id;
  u8 is_add;
  u8 is_drop;
  u8 is_unreach;
  u8 is_prohibit;
  u8 is_ipv6;
  u8 is_local;
  u8 is_classify;
  u8 is_multipath;
  u8 is_resolve_host;
  u8 is_resolve_attached;
  u8 is_dvr;
  u8 is_source_lookup;
  u8 is_udp_encap;
  u8 next_hop_weight;
  u8 next_hop_preference;
  u8 next_hop_proto;
  u8 dst_address_length;
  u8 dst_address[16];
  u8 next_hop_address[16];
  u8 next_hop_n_out_labels;
  u32 next_hop_via_label;
  vl_api_fib_mpls_label_t next_hop_out_label_stack[next_hop_n_out_labels];
};

define ip_add_del_route_reply
{
  u32 context;
  i32 retval;
  u32 stats_index;
};

/** \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
*/
define ip_mroute_add_del
{
  u32 client_index;
  u32 context;
  u32 next_hop_sw_if_index;
  u32 table_id;
  u32 entry_flags;
  u32 itf_flags;
  u32 rpf_id;
  u32 bier_imp;
  u16 grp_address_length;
  u8 next_hop_afi;
  u8 is_add;
  u8 is_ipv6;
  u8 is_local;
  u8 grp_address[16];
  u8 src_address[16];
  u8 nh_address[16];
};

define ip_mroute_add_del_reply
{
  u32 context;
  i32 retval;
  u32 stats_index;
};

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

/** \brief IP Multicast FIB table response
    @param table_id - IP fib table id
    @address_length - mask length
    @grp_address - Group address/prefix
    @src_address - Source address
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip_mfib_details
{
  u32 context;
  u32 table_id;
  u32 entry_flags;
  u32 rpf_id;
  u8  address_length;
  u8  grp_address[4];
  u8  src_address[4];
  u32 count;
  u32 stats_index;
  vl_api_fib_path_t path[count];
};

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

/** \brief IP6 Multicast FIB table response
    @param table_id - IP fib table id
    @address_length - mask length
    @grp_address - Group address/prefix
    @src_address - Source address
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip6_mfib_details
{
  u32 context;
  u32 table_id;
  u8  address_length;
  u8  grp_address[16];
  u8  src_address[16];
  u32 count;
  vl_api_fib_path_t path[count];
};

define ip_address_details
{
  u32 context;
  u8 ip[16];
  u8 prefix_length;
  u32 sw_if_index;
  u8 is_ipv6;
};

define ip_address_dump
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 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 unnnumbered to
*/
define ip_unnumbered_details
{
  u32 context;
  u32 sw_if_index;
  u32 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;
  u32 sw_if_index;
};

define ip_details
{
  u32 context;
  u32 sw_if_index;
  u8 is_ipv6;
};

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

define mfib_signal_dump
{
  u32 client_index;
  u32 context;
};

define mfib_signal_details
{
  u32 context;
  u32 sw_if_index;
  u32 table_id;
  u16 grp_address_len;
  u8 grp_address[16];
  u8 src_address[16];
  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;
  u8 is_add;
  u8 is_ip6;
};

/** \brief IP punt redirect
    @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 tx_sw_if_index - the TX interface to which traffic shoulde be
                            redirected.
    @param nh - The next-hop to redirect the traffic to.
*/
autoreply define ip_punt_redirect
{
  u32 client_index;
  u32 context;
  u32 rx_sw_if_index;
  u32 tx_sw_if_index;
  u8 is_add;
  u8 is_ip6;
  u8 nh[16];
};

autoreply define ip_container_proxy_add_del
{
  u32 client_index;
  u32 context;
  u8 ip[16];
  u8 is_ip4;
  u8 plen;
  u32 sw_if_index;
  u8 is_add;
};

define ip_container_proxy_dump
{
  u32 client_index;
  u32 context;
};

define ip_container_proxy_details
{
  u32 context;
  u32 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 mask_length - mask length for address entry
    @param address - array of address bytes
    @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;
  u8 is_ipv6;
  u8 is_add;
  u8 mask_length;
  u8 address[16];
  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;
  u8 is_add;
  u32 sw_if_index;
  u32 tcp_in_vrf_id;
  u32 tcp_out_vrf_id;
  u32 udp_in_vrf_id;
  u32 udp_out_vrf_id;
};

/** \brief Enable/disable periodic IP neighbor scan
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param mode - 0: disable, 1: IPv4, 2: IPv6, 3: both IPv4/v6
    @param scan_interval - neighbor scan interval in minutes, 0: default to 1
    @param max_proc_time - max processing time per run in usec, 0: default to 20
    @param max_update - max neighbor probe/delete per run, 0: default to 10
    @param scan_int_delay - delay in msec to resume scan if exceed max proc
                            time or update, 0: default to 1
    @param stale_threshold - threshold in minutes for neighbor deletion, 
                             0: default to 4*scan_interval
*/
autoreply define ip_scan_neighbor_enable_disable
{
  u32 client_index;
  u32 context;
  u8 mode;
  u8 scan_interval;
  u8 max_proc_time;
  u8 max_update;
  u8 scan_int_delay;
  u8 stale_threshold;
};

/** \brief IP probe neighbor address on an interface by sending an
           ARP request (for IP4) or ICMP6 Neighbor Solicitation (for IP6)
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface index
    @param dst_address - target IP address to send IP addr resolution request
    @param is_ipv6 - [1|0] to indicate if address family is IPv[6|4]
*/
autoreply define ip_probe_neighbor
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 dst_address[16];
  u8 is_ipv6;
};

/** \brief Register for IP4 ARP resolution event on receing 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
    @param enable_disable - 1 => register for events, 0 => cancel registration
    @param pid - sender's pid
    @param address - exact IP4 address of interested arp resolution event, or
                     0 to get MAC/IP info from ARP requests in BDs
*/
autoreply define want_ip4_arp_events
{
  u32 client_index;
  u32 context;
  u8 enable_disable;
  u32 pid;
  u32 address;
};

/** \brief Tell client about an IP4 ARP resolution event or
           MAC/IP info from ARP requests in L2 BDs
    @param client_index - opaque cookie to identify the sender
    @param address - the exact ip4 address of interest
    @param pid - client pid registered to receive notification
    @param sw_if_index - interface which received ARP packet
    @param new_mac - the new mac address 
    @param mac_ip - 0: ARP resolution event, 1: MAC/IP info from L2 BDs
*/
define ip4_arp_event
{
  u32 client_index;
  u32 address;
  u32 pid;
  u32 sw_if_index;
  u8 new_mac[6];
  u8 mac_ip;
};

service {
  rpc want_ip4_arp_events returns want_ip4_arp_events_reply
    events ip4_arp_event;
};

/** \brief Register for IP6 ND resolution event on recieving NA reply
           MAC/IP info from ICMP6 Neighbor Solicitation in L2 BDs
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable_disable - 1 => register for events, 0 => cancel registration
    @param pid - sender's pid
    @param address - the exact IP6 address of interested ND resolution event, or
                     0 to get MAC/IP info from ICMP6 NS in L2 BDs.
*/
autoreply define want_ip6_nd_events
{
  u32 client_index;
  u32 context;
  u8 enable_disable;
  u32 pid;
  u8 address[16];
};

/** \brief Tell client about an IP6 ND resolution or
           MAC/IP info from ICMP6 Neighbor Solicitation in L2 BDs.
    @param client_index - opaque cookie to identify the sender
    @param pid - client pid registered to receive notification
    @param sw_if_index - interface which received ARP packet
    @param address - the exact ip6 address of interest
    @param new_mac - the new mac address 
    @param mac_ip - 0: ND resolution event, 1: MAC/IP info from L2 BDs
*/
define ip6_nd_event
{
  u32 client_index;
  u32 pid;
  u32 sw_if_index;
  u8 address[16];
  u8 new_mac[6];
  u8 mac_ip;
};

service {
  rpc want_ip6_ra_events returns want_ip6_ra_events_reply
    events ip6_ra_event;
};

/** \brief Register for ip6 router advertisement events
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable_disable - 1 => register for events, 0 => cancel registration
    @param pid - sender's pid
*/
autoreply define want_ip6_ra_events
{
  u32 client_index;
  u32 context;
  u8 enable_disable;
  u32 pid;
};

/** \brief Struct representing RA prefix info
    @param dst_address - RA prefix info destination address
    @param dst_address_length - RA prefix info destination address length
    @param flags - RA prefix info flags
    @param valid_time - RA prefix info valid time
    @param preferred_time - RA prefix info preferred time
*/
typeonly define ip6_ra_prefix_info
{
  u8 dst_address[16];
  u8 dst_address_length;
  u8 flags;
  u32 valid_time;
  u32 preferred_time;
};

/** \brief Tell client about a router advertisement event
    @param client_index - opaque cookie to identify the sender
    @param pid - client pid registered to receive notification
    @param current_hop_limit - RA current hop limit
    @param flags - RA flags
    @param router_lifetime_in_sec - RA lifetime in seconds
    @param neighbor_reachable_time_in_msec - RA neighbor reachable time in msec
    @param time_in_msec_between_retransmitted_neighbor_solicitations -
               time in msec between retransmitted neighbor solicitations
    @param n_prefixes -
    @param prefixes -
*/
define ip6_ra_event
{
  u32 client_index;
  u32 pid;
  u32 sw_if_index;
  u8 router_address[16];
  u8 current_hop_limit;
  u8 flags;
  u16 router_lifetime_in_sec;
  u32 neighbor_reachable_time_in_msec;
  u32 time_in_msec_between_retransmitted_neighbor_solicitations;
  u32 n_prefixes;
  vl_api_ip6_ra_prefix_info_t prefixes[n_prefixes];
};

service {
  rpc want_ip6_nd_events returns want_ip6_nd_events_reply
    events ip6_nd_event;
};

/** \brief Proxy ARP configuration type
    @param vrf_id - VRF / Fib table ID
    @param low_address[4] - Low address of the Proxy ARP range
    @param hi_address[4] - High address of the Proxy ARP range
*/
typeonly define proxy_arp
{
  u32 vrf_id;
  u8 low_address[4];
  u8 hi_address[4];
};

/** \brief Proxy ARP add / del request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
    @param proxy - Proxy configuration
*/
autoreply define proxy_arp_add_del
{
  u32 client_index;
  u32 context;
  u8 is_add;
  vl_api_proxy_arp_t proxy;
};

/** \brief Proxy ARP dump request
 */
define proxy_arp_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Proxy ARP dump details reply
 * @param proxy - Same data as used to configure
 */
define proxy_arp_details
{
  u32 context;
  vl_api_proxy_arp_t proxy;
};

/** \brief Proxy ARP add / del interface request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - Which interface to enable / disable Proxy Arp on
    @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
*/
autoreply define proxy_arp_intfc_enable_disable
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  /* 1 = on, 0 = off */
  u8 enable_disable;
};

/** \brief Proxy ARP interface dump request
 */
define proxy_arp_intfc_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Proxy ARP interface dump details reply
 * @param sw_if_index The interface on which ARP proxy is enabled.
 */
define proxy_arp_intfc_details
{
  u32 context;
  u32 sw_if_index;
};

/** \brief Reset fib table request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param vrf_id - vrf/table id of the fib table to reset
    @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
*/
autoreply define reset_fib
{
  u32 client_index;
  u32 context;
  u32 vrf_id;
  u8 is_ipv6;
};

/** \brief Set max allowed ARP or ip6 neighbor entries request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_ipv6 - neighbor limit if non-zero, else ARP limit
    @param arp_neighbor_limit - the new limit, defaults are ~ 50k
*/
autoreply define set_arp_neighbor_limit
{
  u32 client_index;
  u32 context;
  u8 is_ipv6;
  u32 arp_neighbor_limit;
};

/** \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;
  u8 seqno;
  u8 analyse;
  u8 pot_enable;
  u8 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;
};

autoreply define ip_reassembly_set
{
  u32 client_index;
  u32 context;
  u32 timeout_ms;
  u32 max_reassemblies;
  u32 expire_walk_interval_ms;
  u8 is_ip6;
};

define ip_reassembly_get
{
  u32 client_index;
  u32 context;
  u8 is_ip6;
};

define ip_reassembly_get_reply
{
  u32 context;
  i32 retval;
  u32 timeout_ms;
  u32 max_reassemblies;
  u32 expire_walk_interval_ms;
  u8 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;
  u32 sw_if_index;
  u8 enable_ip4;
  u8 enable_ip6;
};

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