/* 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.
 */

option version = "1.1.0";
import "vnet/ip/ip_types.api";

enum vxlan_gbp_api_tunnel_mode
{
  VXLAN_GBP_API_TUNNEL_MODE_L2,
  VXLAN_GBP_API_TUNNEL_MODE_L3,
};

/** \brief Definition of a VXLAN GBP tunnel
    @param instance - optional unique custom device instance, else ~0.
    @param src - Source IP address
    @param dst - Destination IP address, can be multicast
    @param mcast_sw_if_index - Interface for multicast destination
    @param encap_table_id - Encap route table 
    @param vni - The VXLAN Network Identifier, uint24
    @param sw_ifindex - Ignored in add message, set in details
*/
typedef vxlan_gbp_tunnel
{
  u32 instance;
  vl_api_address_t src;
  vl_api_address_t dst;
  u32 mcast_sw_if_index;
  u32 encap_table_id;
  u32 vni;
  u32 sw_if_index;
  vl_api_vxlan_gbp_api_tunnel_mode_t mode;
};

/** \brief Create or delete a VXLAN-GBP tunnel
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - Use 1 to create the tunnel, 0 to remove it
*/
define vxlan_gbp_tunnel_add_del
{
  u32 client_index;
  u32 context;
  u8 is_add;
  vl_api_vxlan_gbp_tunnel_t tunnel;
};

define vxlan_gbp_tunnel_add_del_reply
{
  u32 context;
  i32 retval;
  u32 sw_if_index;
};

define vxlan_gbp_tunnel_dump
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
};

define vxlan_gbp_tunnel_details
{
  u32 context;
  vl_api_vxlan_gbp_tunnel_t tunnel;
};

/** \brief Interface set vxlan-bypass 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_ipv6 - if non-zero, enable ipv6-vxlan-bypass, else ipv4-vxlan-bypass
    @param enable - if non-zero enable, else disable
*/
autoreply define sw_interface_set_vxlan_gbp_bypass
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 is_ipv6;
  u8 enable;
};

