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

import "vnet/interface_types.api";
import "vnet/tunnel/tunnel_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
    @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_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:
 */
