/* 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, 0 for entopy per rfc7510
 * @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;
};

enum udp_decap_next_proto
{
    UDP_API_DECAP_PROTO_IP4,
    UDP_API_DECAP_PROTO_IP6,
    UDP_API_DECAP_PROTO_MPLS,
};

/**
 * @brief UDP Decap object
 * @param is_ip4 - IPv4 if non-zero, else IPv6
 * @param port - port to listen on for the decap
 * @param next_proto - the protocol of the inner header
 */
typedef udp_decap
{
  u8 is_ip4;
  u16 port;
  vl_api_udp_decap_next_proto_t next_proto;
};

/**
 * @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;
};

/**
 * @brief Add/Del UDP decap
 * @param client_index - opaque cookie to identify the sender
 * @param context - sender context, to match reply w/ request
 * @param is_add - add decap if non-zero, else delete
 * @param udp_decap - UDP decap description
 */
autoreply define udp_decap_add_del
{
  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_udp_decap_t udp_decap;
};

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