23 #include <vpp/app/version.h> 30 #include <plugins/ikev2/ikev2.api_enum.h> 31 #include <plugins/ikev2/ikev2.api_types.h> 35 #define IKEV2_PLUGIN_VERSION_MAJOR 1 36 #define IKEV2_PLUGIN_VERSION_MINOR 0 37 #define REPLY_MSG_ID_BASE ikev2_main.msg_id_base 46 int msg_size =
sizeof (*rmp);
56 ntohs (VL_API_IKEV2_PLUGIN_GET_VERSION_REPLY + im->
msg_id_base);
68 vl_api_ikev2_profile_set_liveness_reply_t *rmp;
76 rv = VNET_API_ERROR_UNSPECIFIED;
78 rv = VNET_API_ERROR_UNIMPLEMENTED;
81 REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_LIVENESS_REPLY);
87 vl_api_ikev2_profile_add_del_reply_t *rmp;
97 rv = VNET_API_ERROR_UNSPECIFIED;
99 rv = VNET_API_ERROR_UNIMPLEMENTED;
109 vl_api_ikev2_profile_set_auth_reply_t *rmp;
115 int data_len = ntohl (mp->
data_len);
123 rv = VNET_API_ERROR_UNSPECIFIED;
125 rv = VNET_API_ERROR_UNIMPLEMENTED;
134 vl_api_ikev2_profile_set_id_reply_t *rmp;
141 int data_len = ntohl (mp->
data_len);
148 rv = VNET_API_ERROR_UNSPECIFIED;
150 rv = VNET_API_ERROR_UNIMPLEMENTED;
160 vl_api_ikev2_profile_set_udp_encap_reply_t *rmp;
170 rv = VNET_API_ERROR_UNSPECIFIED;
172 rv = VNET_API_ERROR_UNIMPLEMENTED;
181 vl_api_ikev2_profile_set_ts_reply_t *rmp;
191 clib_net_to_host_u16 (mp->
end_port),
196 rv = VNET_API_ERROR_UNSPECIFIED;
198 rv = VNET_API_ERROR_UNIMPLEMENTED;
207 vl_api_ikev2_set_local_key_reply_t *rmp;
216 rv = VNET_API_ERROR_UNSPECIFIED;
218 rv = VNET_API_ERROR_UNIMPLEMENTED;
227 vl_api_ikev2_set_responder_reply_t *rmp;
241 rv = VNET_API_ERROR_UNSPECIFIED;
243 rv = VNET_API_ERROR_UNIMPLEMENTED;
253 vl_api_ikev2_set_ike_transforms_reply_t *rmp;
269 rv = VNET_API_ERROR_UNSPECIFIED;
271 rv = VNET_API_ERROR_UNIMPLEMENTED;
274 REPLY_MACRO (VL_API_IKEV2_SET_IKE_TRANSFORMS_REPLY);
281 vl_api_ikev2_set_esp_transforms_reply_t *rmp;
297 rv = VNET_API_ERROR_UNSPECIFIED;
299 rv = VNET_API_ERROR_UNIMPLEMENTED;
302 REPLY_MACRO (VL_API_IKEV2_SET_ESP_TRANSFORMS_REPLY);
308 vl_api_ikev2_set_sa_lifetime_reply_t *rmp;
319 clib_net_to_host_u64 (mp->
lifetime),
326 rv = VNET_API_ERROR_UNSPECIFIED;
328 rv = VNET_API_ERROR_UNIMPLEMENTED;
338 vl_api_ikev2_profile_set_ipsec_udp_port_reply_t *rmp;
348 clib_net_to_host_u16 (mp->
port),
352 rv = VNET_API_ERROR_UNIMPLEMENTED;
355 REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_IPSEC_UDP_PORT_REPLY);
362 vl_api_ikev2_set_tunnel_interface_reply_t *rmp;
375 rv = VNET_API_ERROR_UNSPECIFIED;
378 rv = VNET_API_ERROR_UNIMPLEMENTED;
382 REPLY_MACRO (VL_API_IKEV2_SET_TUNNEL_INTERFACE_REPLY);
388 vl_api_ikev2_initiate_sa_init_reply_t *rmp;
400 rv = VNET_API_ERROR_UNSPECIFIED;
402 rv = VNET_API_ERROR_UNIMPLEMENTED;
412 vl_api_ikev2_initiate_del_ike_sa_reply_t *rmp;
421 rv = VNET_API_ERROR_UNSPECIFIED;
423 rv = VNET_API_ERROR_UNIMPLEMENTED;
426 REPLY_MACRO (VL_API_IKEV2_INITIATE_DEL_IKE_SA_REPLY);
433 vl_api_ikev2_initiate_del_child_sa_reply_t *rmp;
442 rv = VNET_API_ERROR_UNSPECIFIED;
444 rv = VNET_API_ERROR_UNIMPLEMENTED;
447 REPLY_MACRO (VL_API_IKEV2_INITIATE_DEL_CHILD_SA_REPLY);
454 vl_api_ikev2_initiate_rekey_child_sa_reply_t *rmp;
463 rv = VNET_API_ERROR_UNSPECIFIED;
465 rv = VNET_API_ERROR_UNIMPLEMENTED;
468 REPLY_MACRO (VL_API_IKEV2_INITIATE_REKEY_CHILD_SA_REPLY);
471 #include <ikev2/ikev2.api.c>
clib_error_t * ikev2_set_profile_responder(vlib_main_t *vm, u8 *name, u32 sw_if_index, ip4_address_t ip4)
static void vl_api_ikev2_profile_set_ipsec_udp_port_t_handler(vl_api_ikev2_profile_set_ipsec_udp_port_t *mp)
static void vl_api_ikev2_initiate_rekey_child_sa_t_handler(vl_api_ikev2_initiate_rekey_child_sa_t *mp)
IKEv2: Set Child SA lifetime, limited by time and/or data.
clib_error_t * ikev2_add_del_profile(vlib_main_t *vm, u8 *name, int is_add)
clib_error_t * ikev2_set_profile_udp_encap(vlib_main_t *vm, u8 *name)
IKEv2: Add/delete profile.
clib_error_t * ikev2_initiate_delete_ike_sa(vlib_main_t *vm, u64 ispi)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
clib_error_t * ikev2_set_profile_tunnel_interface(vlib_main_t *vm, u8 *name, u32 sw_if_index)
IKEv2: Set liveness parameters.
clib_error_t * ikev2_set_profile_sa_lifetime(vlib_main_t *vm, u8 *name, u64 lifetime, u32 jitter, u32 handover, u64 maxdata)
static void vl_api_ikev2_initiate_sa_init_t_handler(vl_api_ikev2_initiate_sa_init_t *mp)
clib_error_t * ikev2_set_liveness_params(u32 period, u32 max_retries)
static void vl_api_ikev2_set_sa_lifetime_t_handler(vl_api_ikev2_set_sa_lifetime_t *mp)
void * vl_msg_api_alloc(int nbytes)
static void vl_api_ikev2_initiate_del_ike_sa_t_handler(vl_api_ikev2_initiate_del_ike_sa_t *mp)
vnet_api_error_t ikev2_set_profile_ipsec_udp_port(vlib_main_t *vm, u8 *name, u16 port, u8 is_set)
#define clib_memcpy(d, s, n)
static void vl_api_ikev2_plugin_get_version_t_handler(vl_api_ikev2_plugin_get_version_t *mp)
static void vl_api_ikev2_set_local_key_t_handler(vl_api_ikev2_set_local_key_t *mp)
#define VLIB_INIT_FUNCTION(x)
clib_error_t * ikev2_initiate_sa_init(vlib_main_t *vm, u8 *name)
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
clib_error_t * ikev2_set_profile_auth(vlib_main_t *vm, u8 *name, u8 auth_method, u8 *auth_data, u8 data_hex_format)
static void vl_api_ikev2_set_tunnel_interface_t_handler(vl_api_ikev2_set_tunnel_interface_t *mp)
IKEv2: Initiate the delete Child SA exchange.
clib_error_t * ikev2_set_profile_esp_transforms(vlib_main_t *vm, u8 *name, ikev2_transform_encr_type_t crypto_alg, ikev2_transform_integ_type_t integ_alg, ikev2_transform_dh_type_t dh_type, u32 crypto_key_size)
IKEv2: Set IKEv2 profile local/remote identification.
static void vl_api_ikev2_profile_set_ts_t_handler(vl_api_ikev2_profile_set_ts_t *mp)
IKEv2: Set IKEv2 profile traffic selector parameters.
static void vl_api_ikev2_set_ike_transforms_t_handler(vl_api_ikev2_set_ike_transforms_t *mp)
clib_error_t * ikev2_set_profile_id(vlib_main_t *vm, u8 *name, u8 id_type, u8 *data, int is_local)
IKEv2: Initiate the rekey Child SA exchange.
clib_error_t * ikev2_initiate_delete_child_sa(vlib_main_t *vm, u32 ispi)
vl_api_interface_index_t sw_if_index
static void vl_api_ikev2_set_responder_t_handler(vl_api_ikev2_set_responder_t *mp)
clib_error_t * ikev2_set_local_key(vlib_main_t *vm, u8 *file)
clib_error_t * ikev2_set_profile_ts(vlib_main_t *vm, u8 *name, u8 protocol_id, u16 start_port, u16 end_port, ip4_address_t start_addr, ip4_address_t end_addr, int is_local)
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
clib_error_t * ikev2_initiate_rekey_child_sa(vlib_main_t *vm, u32 ispi)
static void vl_api_ikev2_initiate_del_child_sa_t_handler(vl_api_ikev2_initiate_del_child_sa_t *mp)
#define vec_free(V)
Free vector's memory (no header).
vl_api_ip4_address_t address
IKEv2: Initiate the SA_INIT exchange.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_ikev2_profile_set_liveness_t_handler(vl_api_ikev2_profile_set_liveness_t *mp)
IKEv2: Set/unset custom ipsec-over-udp port.
IKEv2: Set IKEv2 responder interface and IP address.
IKEv2: Initiate the delete IKE SA exchange.
IKEv2: Set IKEv2 profile authentication method.
static void vl_api_ikev2_profile_set_auth_t_handler(vl_api_ikev2_profile_set_auth_t *mp)
static vlib_main_t * vlib_get_main(void)
#define IKEV2_PLUGIN_VERSION_MINOR
#define IKEV2_PLUGIN_VERSION_MAJOR
IKEv2: Set IKEv2 local RSA private key.
static void vl_api_ikev2_profile_set_id_t_handler(vl_api_ikev2_profile_set_id_t *mp)
clib_error_t * ikev2_set_profile_ike_transforms(vlib_main_t *vm, u8 *name, ikev2_transform_encr_type_t crypto_alg, ikev2_transform_integ_type_t integ_alg, ikev2_transform_dh_type_t dh_type, u32 crypto_key_size)
static void vl_api_ikev2_profile_set_udp_encap_t_handler(vl_api_ikev2_profile_set_udp_encap_t *mp)
static void vl_api_ikev2_set_esp_transforms_t_handler(vl_api_ikev2_set_esp_transforms_t *mp)
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
static void vl_api_ikev2_profile_add_del_t_handler(vl_api_ikev2_profile_add_del_t *mp)
Reply to get the plugin version.
vl_api_interface_index_t sw_if_index
IKEv2: Set UDP encapsulation.
IKEv2: Set the tunnel interface which will be protected by IKE If this API is not called...
static clib_error_t * ikev2_api_init(vlib_main_t *vm)
#define VALIDATE_SW_IF_INDEX(mp)