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);
67 vl_api_ikev2_profile_add_del_reply_t *rmp;
77 rv = VNET_API_ERROR_UNSPECIFIED;
79 rv = VNET_API_ERROR_UNIMPLEMENTED;
89 vl_api_ikev2_profile_set_auth_reply_t *rmp;
103 rv = VNET_API_ERROR_UNSPECIFIED;
105 rv = VNET_API_ERROR_UNIMPLEMENTED;
114 vl_api_ikev2_profile_add_del_reply_t *rmp;
121 int data_len = ntohl (mp->
data_len);
128 rv = VNET_API_ERROR_UNSPECIFIED;
130 rv = VNET_API_ERROR_UNIMPLEMENTED;
139 vl_api_ikev2_profile_set_ts_reply_t *rmp;
149 clib_net_to_host_u16 (mp->
end_port),
154 rv = VNET_API_ERROR_UNSPECIFIED;
156 rv = VNET_API_ERROR_UNIMPLEMENTED;
165 vl_api_ikev2_profile_set_ts_reply_t *rmp;
174 rv = VNET_API_ERROR_UNSPECIFIED;
176 rv = VNET_API_ERROR_UNIMPLEMENTED;
185 vl_api_ikev2_set_responder_reply_t *rmp;
199 rv = VNET_API_ERROR_UNSPECIFIED;
201 rv = VNET_API_ERROR_UNIMPLEMENTED;
211 vl_api_ikev2_set_ike_transforms_reply_t *rmp;
227 rv = VNET_API_ERROR_UNSPECIFIED;
229 rv = VNET_API_ERROR_UNIMPLEMENTED;
232 REPLY_MACRO (VL_API_IKEV2_SET_IKE_TRANSFORMS_REPLY);
239 vl_api_ikev2_set_esp_transforms_reply_t *rmp;
255 rv = VNET_API_ERROR_UNSPECIFIED;
257 rv = VNET_API_ERROR_UNIMPLEMENTED;
260 REPLY_MACRO (VL_API_IKEV2_SET_ESP_TRANSFORMS_REPLY);
266 vl_api_ikev2_set_sa_lifetime_reply_t *rmp;
277 clib_net_to_host_u64 (mp->
lifetime),
284 rv = VNET_API_ERROR_UNSPECIFIED;
286 rv = VNET_API_ERROR_UNIMPLEMENTED;
295 vl_api_ikev2_initiate_sa_init_reply_t *rmp;
307 rv = VNET_API_ERROR_UNSPECIFIED;
309 rv = VNET_API_ERROR_UNIMPLEMENTED;
319 vl_api_ikev2_initiate_del_ike_sa_reply_t *rmp;
328 rv = VNET_API_ERROR_UNSPECIFIED;
330 rv = VNET_API_ERROR_UNIMPLEMENTED;
333 REPLY_MACRO (VL_API_IKEV2_INITIATE_DEL_IKE_SA_REPLY);
340 vl_api_ikev2_initiate_del_child_sa_reply_t *rmp;
349 rv = VNET_API_ERROR_UNSPECIFIED;
351 rv = VNET_API_ERROR_UNIMPLEMENTED;
354 REPLY_MACRO (VL_API_IKEV2_INITIATE_DEL_CHILD_SA_REPLY);
361 vl_api_ikev2_initiate_rekey_child_sa_reply_t *rmp;
370 rv = VNET_API_ERROR_UNSPECIFIED;
372 rv = VNET_API_ERROR_UNIMPLEMENTED;
375 REPLY_MACRO (VL_API_IKEV2_INITIATE_REKEY_CHILD_SA_REPLY);
378 #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_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)
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_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)
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)
#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)
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)
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.
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)
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_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
static clib_error_t * ikev2_api_init(vlib_main_t *vm)