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

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

/** \brief A GRE tunnel type
*/
enum gre_tunnel_type
{
  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_fib_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
{
  u32 client_index;
  u32 context;
  u16 session_id;
  vl_api_gre_tunnel_type_t type;
  u32 instance;
  u32 outer_fib_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:
 */
