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

/** \file

    This file defines vpp UDP control-plane API messages which are generally
    called through a shared memory interface. 
*/

option version = "1.0.0";

/** \brief Add / del table request
           A table can be added multiple times, but need be deleted only once.
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_ipv6 - V4 or V6 table
    @param table_id - table ID associated with the encap destination
*/
autoreply define udp_encap_add_del
{
  u32 client_index;
  u32 context;
  u32 id;
  u32 table_id;
  u8 is_ip6;
  u8 is_add;
  u16 src_port;
  u16 dst_port;
  u8 src_ip[16];
  u8 dst_ip[16];
};

define udp_encap_dump
{
  u32 client_index;
  u32 context;
};

define udp_encap_details
{
  u32 context;
  u32 id;
  u32 table_id;
  u8 is_ip6;
  u16 src_port;
  u16 dst_port;
  u8 src_ip[16];
  u8 dst_ip[16];
};

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