/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2018-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.
 */

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

option version = "1.1.0";

import "vnet/ip/ip_types.api";


/**
 * @brief UDP Encap object
 * @param table_id - table ID associated with the encap destination
 * @param dst_ip - Encap destination address
 * @param src_ip - Encap source address
 * @param dst_port - Encap destination port
 * @param src_port - Encap source port
 * @param id - VPP assigned id; ignored in add message, set in dump
 */
typedef udp_encap
{
  u32 table_id;
  u16 src_port;
  u16 dst_port;
  vl_api_address_t src_ip;
  vl_api_address_t dst_ip;
  u32 id;
};

/**
 * @brief Add UDP encap
 * @param client_index - opaque cookie to identify the sender
 * @param context - sender context, to match reply w/ request
 * @param udp_encap - UDP encap description
 */
define udp_encap_add
{
  u32 client_index;
  u32 context;
  vl_api_udp_encap_t udp_encap;
};

/**
 * @brief Add UDP encap reply
 * @param context - sender context, to match reply w/ request
 * @param retval - success/failure return value
 * @param id - The ID of the encap object that should be used on delete
 *             and when reading stats from the stats segment.
 */
define udp_encap_add_reply
{
  u32 context;
  i32 retval;
  u32 id;
};

/**
 * @brief Del UDP encap
 * @param client_index - opaque cookie to identify the sender
 * @param context - sender context, to match reply w/ request
 * @param id - ID of the encap object the client chose during the add
*/
autoreply define udp_encap_del
{
  u32 client_index;
  u32 context;
  u32 id;
};

/**
 * @brief dump UDP encaps
 */
define udp_encap_dump
{
  u32 client_index;
  u32 context;
};

/**
 * @brief UDP encap details during dump
 */
define udp_encap_details
{
  u32 context;
  vl_api_udp_encap_t udp_encap;
};

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