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

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:
 */
