tcp: api clenup
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I48f08cc657c28ad1eef50c917a560425137bb70e Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
This commit is contained in:

committed by
Ole Trøan

parent
99c7b395e9
commit
956819afa9
@ -13,8 +13,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
option version = "1.0.0";
|
option version = "2.0.0";
|
||||||
|
|
||||||
|
import "vnet/ip/ip_types.api";
|
||||||
|
|
||||||
/** \brief Configure TCP source addresses, for active-open TCP sessions
|
/** \brief Configure TCP source addresses, for active-open TCP sessions
|
||||||
|
|
||||||
TCP src/dst ports are 16 bits, with the low-order 1024 ports
|
TCP src/dst ports are 16 bits, with the low-order 1024 ports
|
||||||
@ -22,9 +24,9 @@ option version = "1.0.0";
|
|||||||
source IP addresses if one wishes to initiate a large number of
|
source IP addresses if one wishes to initiate a large number of
|
||||||
connections.
|
connections.
|
||||||
|
|
||||||
Each of those addresses needs to have a receive adjacency -
|
Each of those addresses needs to have a receive adjacency -
|
||||||
either a /32 or a /128 - and vpp needs to answer (proxy) arps or
|
either a /32 or a /128 - and vpp needs to answer (proxy) arps or
|
||||||
neighbor discovery requests for the addresses.
|
neighbor discovery requests for the addresses.
|
||||||
|
|
||||||
@param client_index - opaque cookie to identify the sender
|
@param client_index - opaque cookie to identify the sender
|
||||||
@param context - sender context, to match reply w/ request
|
@param context - sender context, to match reply w/ request
|
||||||
@ -36,9 +38,7 @@ option version = "1.0.0";
|
|||||||
autoreply define tcp_configure_src_addresses {
|
autoreply define tcp_configure_src_addresses {
|
||||||
u32 client_index;
|
u32 client_index;
|
||||||
u32 context;
|
u32 context;
|
||||||
u8 is_ipv6;
|
|
||||||
u32 vrf_id;
|
u32 vrf_id;
|
||||||
u8 first_address[16];
|
vl_api_address_t first_address;
|
||||||
u8 last_address[16];
|
vl_api_address_t last_address;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#include <vnet/tcp/tcp.h>
|
#include <vnet/tcp/tcp.h>
|
||||||
|
|
||||||
|
#include <vnet/ip/ip_types_api.h>
|
||||||
|
|
||||||
#include <vnet/vnet_msg_enum.h>
|
#include <vnet/vnet_msg_enum.h>
|
||||||
|
|
||||||
#define vl_typedefs /* define message structures */
|
#define vl_typedefs /* define message structures */
|
||||||
@ -51,20 +53,28 @@ static void
|
|||||||
vl_api_tcp_configure_src_addresses_reply_t *rmp;
|
vl_api_tcp_configure_src_addresses_reply_t *rmp;
|
||||||
u32 vrf_id;
|
u32 vrf_id;
|
||||||
int rv;
|
int rv;
|
||||||
|
ip46_address_t first_address, last_address;
|
||||||
|
ip46_type_t fa_af, la_af;
|
||||||
|
|
||||||
vrf_id = clib_net_to_host_u32 (mp->vrf_id);
|
vrf_id = clib_net_to_host_u32 (mp->vrf_id);
|
||||||
|
|
||||||
if (mp->is_ipv6)
|
fa_af = ip_address_decode (&mp->first_address, &first_address);
|
||||||
|
la_af = ip_address_decode (&mp->last_address, &last_address);
|
||||||
|
|
||||||
|
if (fa_af != la_af)
|
||||||
|
{
|
||||||
|
rv = VNET_API_ERROR_INVALID_VALUE;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fa_af == IP46_TYPE_IP6)
|
||||||
rv = tcp_configure_v6_source_address_range
|
rv = tcp_configure_v6_source_address_range
|
||||||
(vm,
|
(vm, &first_address.ip6, &last_address.ip6, vrf_id);
|
||||||
(ip6_address_t *) mp->first_address,
|
|
||||||
(ip6_address_t *) mp->last_address, vrf_id);
|
|
||||||
else
|
else
|
||||||
rv = tcp_configure_v4_source_address_range
|
rv = tcp_configure_v4_source_address_range
|
||||||
(vm,
|
(vm, &first_address.ip4, &last_address.ip4, vrf_id);
|
||||||
(ip4_address_t *) mp->first_address,
|
|
||||||
(ip4_address_t *) mp->last_address, vrf_id);
|
|
||||||
|
|
||||||
|
error:
|
||||||
REPLY_MACRO (VL_API_TCP_CONFIGURE_SRC_ADDRESSES_REPLY);
|
REPLY_MACRO (VL_API_TCP_CONFIGURE_SRC_ADDRESSES_REPLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user