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