/*
 * Copyright (c) 2015-2016 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.
 */

vl_api_version 1.0.0

define gre_add_del_tunnel
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 is_ipv6;
  u8 teb;
  u8 src_address[16];
  u8 dst_address[16];
  u32 outer_fib_id;
};

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

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

define gre_tunnel_details
{
  u32 context;
  u32 sw_if_index;
  u8 is_ipv6;
  u8 teb;
  u8 src_address[16];
  u8 dst_address[16];
  u32 outer_fib_id;
};

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