/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2015-2019 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 = "2.0.1";

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

/** \brief A GRE tunnel type
*/
enum gre_tunnel_type : u8
{
  GRE_API_TUNNEL_TYPE_L3 = 0,
  GRE_API_TUNNEL_TYPE_TEB,
  GRE_API_TUNNEL_TYPE_ERSPAN,
};

/** \brief A GRE tunnel mode
*/
enum gre_tunnel_mode : u8
{
  /* point-to-point */
  GRE_API_TUNNEL_MODE_P2P,
  /* multi-point */
  GRE_API_TUNNEL_MODE_MP,
};

/** \brief A GRE tunnel
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param tunnel_type - 0: L3, 1: TEB, 2: ERSPAN
    @param instance - optional unique custom device instance, else ~0.
    @param src - Source IP address
    @param dst - Destination IP address, can be multicast
    @param outer_table_id - Encap FIB table ID
    @param session_id - session for ERSPAN tunnel, range 0-1023
    @param sw_if_index - ignored on create/delete, present in details.
*/
typedef gre_tunnel
{
  vl_api_gre_tunnel_type_t type;
  vl_api_gre_tunnel_mode_t mode;
  u16 session_id;
  u32 instance;
  u32 outer_table_id;
  vl_api_interface_index_t sw_if_index;
  vl_api_address_t src;
  vl_api_address_t dst;
};

define gre_tunnel_add_del
{
  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_gre_tunnel_t tunnel;
};

define gre_tunnel_add_del_reply
{
  u32 context;
  i32 retval;
  vl_api_interface_index_t sw_if_index;
};

define gre_tunnel_dump
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
};

define gre_tunnel_details
{
  u32 context;
  vl_api_gre_tunnel_t tunnel;
};

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