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

import "vnet/ip/ip_types.api";
import "vnet/interface_types.api";

/** \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;
  vl_api_interface_index_t sw_if_index;
  u8 suppress;
  u8 managed;
  u8 other;
  u8 ll_option;
  u8 send_unicast;
  u8 cease;
  bool 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 prefix - The prefix to advertise
    @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;
  vl_api_interface_index_t sw_if_index;
  vl_api_prefix_t prefix;
  bool use_default;
  bool no_advertise;
  bool off_link;
  bool no_autoconfig;
  bool no_onlink;
  bool is_no;
  u32 val_lifetime;
  u32 pref_lifetime;
};

/** \brief IPv6 Router Advertisements prefix entry
    @param prefix - prefix to advertise
    @param onlink_flag - if true, the prefix can be used for on-link
                         determination
    @param autonomous_flag - if true, the prefix can be used for stateless
                             address configuration
    @param val_lifetime - valid lifetime in seconds (0xffffffff represents
                          infinity)
    @param pref_lifetime - preferred lifetime in seconds (0xffffffff represents
                           infinity)
    @param valid_lifetime_expires - number of seconds in which valid lifetime
                                    expires (zero means never, negative value
                                    means expired this number of seconds ago)
    @param pref_lifetime_expires - number of seconds in which preferred
                                   lifetime expires (zero means never, negative
                                   value means expired this number of seconds
                                   ago)
    @param decrement_lifetime_flag - if true, decrement valid lifetime and
                                     preferred lifetime
    @param no_advertise - if true, the prefix will not be advertised
*/
typedef ip6nd_ra_prefix
{
  vl_api_prefix_t prefix;
  bool onlink_flag;
  bool autonomous_flag;
  u32 val_lifetime;
  u32 pref_lifetime;
  f64 valid_lifetime_expires;
  f64 pref_lifetime_expires;
  bool decrement_lifetime_flag;
  bool no_advertise;
};

/** \brief Dump IPv6 Router Advertisements details on a per-interface basis
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface index to use as a filter (0xffffffff
                         represents all interfaces)
*/
define sw_interface_ip6nd_ra_dump
{
  option in_progress;
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  option vat_help = "[(<if-name>|sw_if_index <if-idx>)]";
};

/** \brief Details on IPv6 Router Advertisements for a single interface
    @param context - returned sender context, to match reply w/ request
    @param sw_if_index - interface index the details are belong to
    @param cur_hop_limit - current hop limit
    @param adv_managed_flag - if true, enable DHCP for address
    @param adv_other_flag - if true, Enable DHCP for other information
    @param adv_router_lifetime - lifetime associated with the default router in
                                 seconds (zero indicates that the router is not
				 a default router)
    @param adv_neighbor_reachable_time - number of milliseconds within which a
                                         neighbor is assumed to be reachable
                                         (zero means unspecified)
    @param adv_retransmit_interval - number of milliseconds between
                                     retransmitted Neighbor Solicitation
                                     messages (zero means unspecified)
    @param adv_link_mtu - MTU that all the nodes on a link use
    @param send_radv - if true, send periodic Router Advertisements
    @param cease_radv - if true, cease to send periodic Router Advertisements
    @param send_unicast - if true, destination address of a Router
                          Advertisement message will use the source address of
                          the Router Solicitation message (when available).
                          Otherwise, multicast address will be used
    @param adv_link_layer_address - if true, add link layer address option
    @param max_radv_interval - maximum time in seconds allowed between sending
                               unsolicited multicast Router Advertisements
    @param min_radv_interval - minimum time in seconds allowed between sending
                               unsolicited multicast Router Advertisements
    @param last_radv_time - number of seconds since the last time a solicited
                            Router Advertisement message was sent (zero means
                            never)
    @param last_multicast_time - number of seconds since the last time a
                                 multicast Router Advertisements message was
                                 sent (zero means never)
    @param next_multicast_time - number of seconds within which next time a
                                 multicast Router Advertisement message will be
                                 sent (zero means never)
    @param initial_adverts_count - number of initial Router Advertisement
                                   messages to send
    @param initial_adverts_interval - number of seconds between initial Router
                                      Advertisement messages
    @param initial_adverts_sent - if true, all initial Router Advertisement
                                  messages were sent
    @param n_advertisements_sent - number of Router Advertisements sent
    @param n_solicitations_rcvd - number of Router Solicitations received
    @param n_solicitations_dropped - number of Router Solicitations dropped
    @param n_prefixes - number of prefix entries
    @param prefixes - array of prefix entries
*/
define sw_interface_ip6nd_ra_details
{
  option in_progress;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  u8 cur_hop_limit;
  bool adv_managed_flag;
  bool adv_other_flag;
  u16 adv_router_lifetime;
  u32 adv_neighbor_reachable_time;
  u32 adv_retransmit_interval;
  u32 adv_link_mtu;
  bool send_radv;
  bool cease_radv;
  bool send_unicast;
  bool adv_link_layer_address;
  f64 max_radv_interval;
  f64 min_radv_interval;
  f64 last_radv_time;
  f64 last_multicast_time;
  f64 next_multicast_time;
  u32 initial_adverts_count;
  f64 initial_adverts_interval;
  bool initial_adverts_sent;
  u32 n_advertisements_sent;
  u32 n_solicitations_rcvd;
  u32 n_solicitations_dropped;
  u32 n_prefixes;
  vl_api_ip6nd_ra_prefix_t prefixes[n_prefixes];
};

/** \brief IPv6 ND (mirror) proxy
    @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 is_enable - enable or disable
*/
autoreply define ip6nd_proxy_enable_disable
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
  bool is_enable;
};

/** \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 ip - 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;
  vl_api_interface_index_t sw_if_index;
  bool is_add;
  vl_api_ip6_address_t ip;
};

/** \brief IPv6 ND proxy details returned after request
    @param context - sender context, to match reply w/ request
    @param sw_if_index - The interface the host is on
    @param ip - The address of the host for which to proxy for
*/
define ip6nd_proxy_details
{
  u32 context;
  vl_api_interface_index_t sw_if_index;
  vl_api_ip6_address_t ip;
};

/** \brief IPv6 ND proxy dump request
    @param context - sender context, to match reply w/ request
*/
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;
  vl_api_interface_index_t sw_if_index;
  bool stop;
};

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 - 1 => register for events, 0 => cancel registration
    @param pid - sender's pid
*/
autoreply define want_ip6_ra_events
{
  u32 client_index;
  u32 context;
  bool enable;
  u32 pid;
};

/** \brief Struct representing RA prefix info
    @param prefix - RA prefix info destination address
    @param flags - RA prefix info flags
    @param valid_time - RA prefix info valid time
    @param preferred_time - RA prefix info preferred time
*/
typedef ip6_ra_prefix_info
{
  vl_api_prefix_t prefix;
  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 router_addr - The router's address
    @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;
  vl_api_interface_index_t sw_if_index;
  vl_api_ip6_address_t router_addr;
  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];
};


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