FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
ikev2_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * ipsec_api.c - ipsec api
4  *
5  * Copyright (c) 2016 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #include <vnet/vnet.h>
21 #include <vlibmemory/api.h>
22 #include <vnet/api_errno.h>
23 #include <vpp/app/version.h>
24 #include <vnet/ip/ip_types_api.h>
25 #include <ikev2/ikev2.h>
26 #include <ikev2/ikev2_priv.h>
27 
28 /* define message IDs */
29 #include <vnet/format_fns.h>
30 #include <plugins/ikev2/ikev2.api_enum.h>
31 #include <plugins/ikev2/ikev2.api_types.h>
32 
33 
34 #define vl_endianfun /* define message structures */
35 #include <plugins/ikev2/ikev2.api.h>
36 #include <plugins/ikev2/ikev2_types.api.h>
37 #undef vl_endianfun
38 
40 
41 #define IKEV2_PLUGIN_VERSION_MAJOR 1
42 #define IKEV2_PLUGIN_VERSION_MINOR 0
43 #define REPLY_MSG_ID_BASE ikev2_main.msg_id_base
45 
46 static u32
48 {
49  return (ti << 16) | sai;
50 }
51 
52 static void
53 ikev2_decode_sa_index (u32 api_sai, u32 * sai, u32 * ti)
54 {
55  *sai = api_sai & 0xffff;
56  *ti = api_sai >> 16;
57 }
58 
59 static void
60 cp_ike_transforms (vl_api_ikev2_ike_transforms_t * vl_api_ts,
62 {
63  vl_api_ts->crypto_alg = ts->crypto_alg;
64  vl_api_ts->integ_alg = ts->integ_alg;
65  vl_api_ts->dh_group = ts->dh_type;
66  vl_api_ts->crypto_key_size = ts->crypto_key_size;
67 }
68 
69 static void
70 cp_esp_transforms (vl_api_ikev2_esp_transforms_t * vl_api_ts,
72 {
73  vl_api_ts->crypto_alg = ts->crypto_alg;
74  vl_api_ts->integ_alg = ts->integ_alg;
75  vl_api_ts->crypto_key_size = ts->crypto_key_size;
76 }
77 
78 static void
79 cp_id (vl_api_ikev2_id_t * vl_api_id, ikev2_id_t * id)
80 {
81  if (!id->data)
82  return;
83 
84  int size_data = 0;
85  vl_api_id->type = id->type;
86  size_data = sizeof (vl_api_id->data) - 1; // size without zero ending character
87  if (vec_len (id->data) < size_data)
88  size_data = vec_len (id->data);
89 
90  vl_api_id->data_len = size_data;
91  clib_memcpy (vl_api_id->data, id->data, size_data);
92 }
93 
94 static void
95 cp_ts (vl_api_ikev2_ts_t * vl_api_ts, ikev2_ts_t * ts, u8 is_local)
96 {
97  vl_api_ts->is_local = is_local;
98  vl_api_ts->protocol_id = ts->protocol_id;
99  vl_api_ts->start_port = ts->start_port;
100  vl_api_ts->end_port = ts->end_port;
101  ip_address_encode2 (&ts->start_addr, &vl_api_ts->start_addr);
102  ip_address_encode2 (&ts->end_addr, &vl_api_ts->end_addr);
103 }
104 
105 static void
106 cp_auth (vl_api_ikev2_auth_t * vl_api_auth, ikev2_auth_t * auth)
107 {
108  vl_api_auth->method = auth->method;
109  vl_api_auth->data_len = vec_len (auth->data);
110  vl_api_auth->hex = auth->hex;
111  clib_memcpy (&vl_api_auth->data, auth->data, vec_len (auth->data));
112 }
113 
114 static void
115 cp_responder (vl_api_ikev2_responder_t * vl_api_responder,
117 {
118  vl_api_responder->sw_if_index = responder->sw_if_index;
119  ip_address_encode2 (&responder->addr, &vl_api_responder->addr);
120 }
121 
122 void
123 cp_sa_transform (vl_api_ikev2_sa_transform_t * vl_tr,
125 {
126  vl_tr->transform_type = tr->type;
127  vl_tr->key_len = tr->key_len;
128  vl_tr->key_trunc = tr->key_trunc;
129  vl_tr->block_size = tr->block_size;
130  vl_tr->dh_group = tr->dh_group;
131  vl_tr->transform_id = tr->encr_type;
132 }
133 
134 static void
136  u32 context)
137 {
139 
140  rmp = vl_msg_api_alloc (sizeof (*rmp) + vec_len (profile->auth.data));
141  clib_memset (rmp, 0, sizeof (*rmp) + vec_len (profile->auth.data));
142  ikev2_main_t *im = &ikev2_main;
143  rmp->_vl_msg_id = ntohs (VL_API_IKEV2_PROFILE_DETAILS + im->msg_id_base);
144  rmp->context = context;
145 
146  int size_data = sizeof (rmp->profile.name) - 1;
147  if (vec_len (profile->name) < size_data)
148  size_data = vec_len (profile->name);
149  clib_memcpy (rmp->profile.name, profile->name, size_data);
150 
151  cp_ike_transforms (&rmp->profile.ike_ts, &profile->ike_ts);
152  cp_esp_transforms (&rmp->profile.esp_ts, &profile->esp_ts);
153 
154  cp_id (&rmp->profile.loc_id, &profile->loc_id);
155  cp_id (&rmp->profile.rem_id, &profile->rem_id);
156 
157  cp_ts (&rmp->profile.rem_ts, &profile->rem_ts, 0 /* is_local */ );
158  cp_ts (&rmp->profile.loc_ts, &profile->loc_ts, 1 /* is_local */ );
159 
160  cp_auth (&rmp->profile.auth, &profile->auth);
161 
162  cp_responder (&rmp->profile.responder, &profile->responder);
163 
164  rmp->profile.udp_encap = profile->udp_encap;
165  rmp->profile.tun_itf = profile->tun_itf;
166  rmp->profile.natt_disabled = profile->natt_disabled;
167  rmp->profile.ipsec_over_udp_port = profile->ipsec_over_udp_port;
168 
169  rmp->profile.lifetime = profile->lifetime;
170  rmp->profile.lifetime_maxdata = profile->lifetime_maxdata;
171  rmp->profile.lifetime_jitter = profile->lifetime_jitter;
172  rmp->profile.handover = profile->handover;
173 
174  vl_api_ikev2_profile_t_endian (&rmp->profile);
175 
176  vl_api_send_msg (reg, (u8 *) rmp);
177 }
178 
179 static void
181 {
182  ikev2_main_t *im = &ikev2_main;
183  ikev2_profile_t *profile;
186  if (!reg)
187  return;
188 
189  /* *INDENT-OFF* */
190  pool_foreach (profile, im->profiles,
191  ({
192  send_profile (profile, reg, mp->context);
193  }));
194  /* *INDENT-ON* */
195 }
196 
197 static void
198 send_sa (ikev2_sa_t * sa, vl_api_ikev2_sa_dump_t * mp, u32 api_sa_index)
199 {
200  vl_api_ikev2_sa_details_t *rmp = 0;
201  int rv = 0;
203 
204  /* *INDENT-OFF* */
205  REPLY_MACRO2_ZERO (VL_API_IKEV2_SA_DETAILS,
206  {
207  vl_api_ikev2_sa_t *rsa = &rmp->sa;
208  vl_api_ikev2_keys_t* k = &rsa->keys;
209  rsa->profile_index = rsa->profile_index;
210  rsa->sa_index = api_sa_index;
211  ip_address_encode2 (&sa->iaddr, &rsa->iaddr);
212  ip_address_encode2 (&sa->raddr, &rsa->raddr);
213  rsa->ispi = sa->ispi;
214  rsa->rspi = sa->rspi;
215  cp_id(&rsa->i_id, &sa->i_id);
216  cp_id(&rsa->r_id, &sa->r_id);
217 
218  tr = ikev2_sa_get_td_for_type (sa->r_proposals, IKEV2_TRANSFORM_TYPE_ENCR);
219  if (tr)
220  cp_sa_transform (&rsa->encryption, tr);
221 
222  tr = ikev2_sa_get_td_for_type (sa->r_proposals, IKEV2_TRANSFORM_TYPE_PRF);
223  if (tr)
224  cp_sa_transform (&rsa->prf, tr);
225 
227  IKEV2_TRANSFORM_TYPE_INTEG);
228  if (tr)
229  cp_sa_transform (&rsa->integrity, tr);
230 
231  tr = ikev2_sa_get_td_for_type (sa->r_proposals, IKEV2_TRANSFORM_TYPE_DH);
232  if (tr)
233  cp_sa_transform (&rsa->dh, tr);
234 
235  k->sk_d_len = vec_len (sa->sk_d);
236  clib_memcpy (&k->sk_d, sa->sk_d, k->sk_d_len);
237 
238  k->sk_ai_len = vec_len (sa->sk_ai);
239  clib_memcpy (&k->sk_ai, sa->sk_ai, k->sk_ai_len);
240 
241  k->sk_ar_len = vec_len (sa->sk_ar);
242  clib_memcpy (&k->sk_ar, sa->sk_ar, k->sk_ar_len);
243 
244  k->sk_ei_len = vec_len (sa->sk_ei);
245  clib_memcpy (&k->sk_ei, sa->sk_ei, k->sk_ei_len);
246 
247  k->sk_er_len = vec_len (sa->sk_er);
248  clib_memcpy (&k->sk_er, sa->sk_er, k->sk_er_len);
249 
250  k->sk_pi_len = vec_len (sa->sk_pi);
251  clib_memcpy (&k->sk_pi, sa->sk_pi, k->sk_pi_len);
252 
253  k->sk_pr_len = vec_len (sa->sk_pr);
254  clib_memcpy (&k->sk_pr, sa->sk_pr, k->sk_pr_len);
255 
256  vl_api_ikev2_sa_t_endian(rsa);
257  });
258  /* *INDENT-ON* */
259 }
260 
261 static void
263 {
264  ikev2_main_t *km = &ikev2_main;
266  ikev2_sa_t *sa;
267 
268  vec_foreach (tkm, km->per_thread_data)
269  {
270  /* *INDENT-OFF* */
271  pool_foreach (sa, tkm->sas,
272  ({
273  u32 api_sa_index = ikev2_encode_sa_index (sa - tkm->sas,
274  tkm - km->per_thread_data);
275  send_sa (sa, mp, api_sa_index);
276  }));
277  /* *INDENT-ON* */
278  }
279 }
280 
281 
282 static void
285  u32 sa_index)
286 {
288  int rv = 0;
290 
291  /* *INDENT-OFF* */
292  REPLY_MACRO2_ZERO (VL_API_IKEV2_CHILD_SA_DETAILS,
293  {
294  vl_api_ikev2_keys_t *k = &rmp->child_sa.keys;
295  rmp->child_sa.child_sa_index = child_sa_index;
296  rmp->child_sa.sa_index = sa_index;
297  rmp->child_sa.i_spi =
298  child->i_proposals ? child->i_proposals[0].spi : 0;
299  rmp->child_sa.r_spi =
300  child->r_proposals ? child->r_proposals[0].spi : 0;
301 
303  IKEV2_TRANSFORM_TYPE_ENCR);
304  if (tr)
305  cp_sa_transform (&rmp->child_sa.encryption, tr);
306 
308  IKEV2_TRANSFORM_TYPE_INTEG);
309  if (tr)
310  cp_sa_transform (&rmp->child_sa.integrity, tr);
311 
313  IKEV2_TRANSFORM_TYPE_ESN);
314  if (tr)
315  cp_sa_transform (&rmp->child_sa.esn, tr);
316 
317  k->sk_ei_len = vec_len (child->sk_ei);
318  clib_memcpy (&k->sk_ei, child->sk_ei, k->sk_ei_len);
319 
320  k->sk_er_len = vec_len (child->sk_er);
321  clib_memcpy (&k->sk_er, child->sk_er, k->sk_er_len);
322 
323  if (vec_len (child->sk_ai))
324  {
325  k->sk_ai_len = vec_len (child->sk_ai);
326  clib_memcpy (&k->sk_ai, child->sk_ai,
327  k->sk_ai_len);
328 
329  k->sk_ar_len = vec_len (child->sk_ar);
330  clib_memcpy (&k->sk_ar, child->sk_ar,
331  k->sk_ar_len);
332  }
333 
334  vl_api_ikev2_child_sa_t_endian (&rmp->child_sa);
335  });
336  /* *INDENT-ON* */
337 }
338 
339 static void
341 {
342  ikev2_main_t *im = &ikev2_main;
344  ikev2_sa_t *sa;
345  ikev2_child_sa_t *child;
346  u32 sai = ~0, ti = ~0;
347 
348  ikev2_decode_sa_index (clib_net_to_host_u32 (mp->sa_index), &sai, &ti);
349 
350  if (vec_len (im->per_thread_data) <= ti)
351  return;
352 
353  tkm = vec_elt_at_index (im->per_thread_data, ti);
354 
355  if (pool_len (tkm->sas) <= sai || pool_is_free_index (tkm->sas, sai))
356  return;
357 
358  sa = pool_elt_at_index (tkm->sas, sai);
359 
360  vec_foreach (child, sa->childs)
361  {
362  u32 child_sa_index = child - sa->childs;
363  send_child_sa (child, mp, child_sa_index, sai);
364  }
365 }
366 
367 static void
370 {
371  ikev2_main_t *im = &ikev2_main;
373  ikev2_sa_t *sa;
374  ikev2_child_sa_t *child;
375  ikev2_ts_t *ts;
376  u32 sai = ~0, ti = ~0;
377 
378  u32 api_sa_index = clib_net_to_host_u32 (mp->sa_index);
379  u32 child_sa_index = clib_net_to_host_u32 (mp->child_sa_index);
380  ikev2_decode_sa_index (api_sa_index, &sai, &ti);
381 
382  if (vec_len (im->per_thread_data) <= ti)
383  return;
384 
385  tkm = vec_elt_at_index (im->per_thread_data, ti);
386 
387  if (pool_len (tkm->sas) <= sai || pool_is_free_index (tkm->sas, sai))
388  return;
389 
390  sa = pool_elt_at_index (tkm->sas, sai);
391 
392  if (vec_len (sa->childs) <= child_sa_index)
393  return;
394 
395  child = vec_elt_at_index (sa->childs, child_sa_index);
396 
397  vec_foreach (ts, mp->is_initiator ? child->tsi : child->tsr)
398  {
400  int rv = 0;
401 
402  /* *INDENT-OFF* */
403  REPLY_MACRO2_ZERO (VL_API_IKEV2_TRAFFIC_SELECTOR_DETAILS,
404  {
405  rmp->ts.sa_index = api_sa_index;
406  rmp->ts.child_sa_index = child_sa_index;
407  cp_ts (&rmp->ts, ts, mp->is_initiator);
408  vl_api_ikev2_ts_t_endian (&rmp->ts);
409  });
410  /* *INDENT-ON* */
411  }
412 }
413 
414 static void
416 {
417  ikev2_main_t *im = &ikev2_main;
419  ikev2_sa_t *sa;
420  u32 sai = ~0, ti = ~0;
421 
422  ikev2_decode_sa_index (clib_net_to_host_u32 (mp->sa_index), &sai, &ti);
423 
424  if (vec_len (im->per_thread_data) <= ti)
425  return;
426 
427  tkm = vec_elt_at_index (im->per_thread_data, ti);
428 
429  if (pool_len (tkm->sas) <= sai || pool_is_free_index (tkm->sas, sai))
430  return;
431 
432  sa = pool_elt_at_index (tkm->sas, sai);
433 
434  u8 *nonce = mp->is_initiator ? sa->i_nonce : sa->r_nonce;
436  int data_len = vec_len (nonce);
437  int rv = 0;
438 
439  /* *INDENT-OFF* */
440  REPLY_MACRO3_ZERO (VL_API_IKEV2_NONCE_GET_REPLY, data_len,
441  {
442  rmp->data_len = clib_host_to_net_u32 (data_len);
443  clib_memcpy (rmp->nonce, nonce, data_len);
444  });
445  /* *INDENT-ON* */
446 }
447 
448 static void
450  mp)
451 {
452  ikev2_main_t *im = &ikev2_main;
454  int msg_size = sizeof (*rmp);
456 
458  if (!reg)
459  return;
460 
461  rmp = vl_msg_api_alloc (msg_size);
462  clib_memset (rmp, 0, msg_size);
463  rmp->_vl_msg_id =
464  ntohs (VL_API_IKEV2_PLUGIN_GET_VERSION_REPLY + im->msg_id_base);
465  rmp->context = mp->context;
466  rmp->major = htonl (IKEV2_PLUGIN_VERSION_MAJOR);
467  rmp->minor = htonl (IKEV2_PLUGIN_VERSION_MINOR);
468 
469  vl_api_send_msg (reg, (u8 *) rmp);
470 }
471 
472 static void
475 {
476  vl_api_ikev2_profile_set_liveness_reply_t *rmp;
477  int rv = 0;
478 
479 #if WITH_LIBSSL > 0
480  clib_error_t *error;
481  error = ikev2_set_liveness_params (clib_net_to_host_u32 (mp->period),
482  clib_net_to_host_u32 (mp->max_retries));
483  if (error)
484  {
485  ikev2_log_error ("%U", format_clib_error, error);
486  clib_error_free (error);
487  rv = VNET_API_ERROR_UNSPECIFIED;
488  }
489 #else
490  rv = VNET_API_ERROR_UNIMPLEMENTED;
491 #endif
492 
493  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_LIVENESS_REPLY);
494 }
495 
496 static void
498 {
499  vl_api_ikev2_profile_add_del_reply_t *rmp;
500  int rv = 0;
501 
502 #if WITH_LIBSSL > 0
504  clib_error_t *error;
505  u8 *tmp = format (0, "%s", mp->name);
506  error = ikev2_add_del_profile (vm, tmp, mp->is_add);
507  vec_free (tmp);
508  if (error)
509  {
510  ikev2_log_error ("%U", format_clib_error, error);
511  clib_error_free (error);
512  rv = VNET_API_ERROR_UNSPECIFIED;
513  }
514 #else
515  rv = VNET_API_ERROR_UNIMPLEMENTED;
516 #endif
517 
518  REPLY_MACRO (VL_API_IKEV2_PROFILE_ADD_DEL_REPLY);
519 }
520 
521 static void
524 {
525  vl_api_ikev2_profile_set_auth_reply_t *rmp;
526  int rv = 0;
527 
528 #if WITH_LIBSSL > 0
530  clib_error_t *error;
531  int data_len = ntohl (mp->data_len);
532  u8 *tmp = format (0, "%s", mp->name);
533  u8 *data = vec_new (u8, data_len);
534  clib_memcpy (data, mp->data, data_len);
535  error = ikev2_set_profile_auth (vm, tmp, mp->auth_method, data, mp->is_hex);
536  vec_free (tmp);
537  vec_free (data);
538  if (error)
539  {
540  ikev2_log_error ("%U", format_clib_error, error);
541  clib_error_free (error);
542  rv = VNET_API_ERROR_UNSPECIFIED;
543  }
544 #else
545  rv = VNET_API_ERROR_UNIMPLEMENTED;
546 #endif
547 
548  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_AUTH_REPLY);
549 }
550 
551 static void
553 {
554  vl_api_ikev2_profile_set_id_reply_t *rmp;
555  int rv = 0;
556 
557 #if WITH_LIBSSL > 0
559  clib_error_t *error;
560  u8 *tmp = format (0, "%s", mp->name);
561  int data_len = ntohl (mp->data_len);
562  u8 *data = vec_new (u8, data_len);
563  clib_memcpy (data, mp->data, data_len);
564  error = ikev2_set_profile_id (vm, tmp, mp->id_type, data, mp->is_local);
565  vec_free (tmp);
566  vec_free (data);
567  if (error)
568  {
569  ikev2_log_error ("%U", format_clib_error, error);
570  clib_error_free (error);
571  rv = VNET_API_ERROR_UNSPECIFIED;
572  }
573 #else
574  rv = VNET_API_ERROR_UNIMPLEMENTED;
575 #endif
576 
577  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_ID_REPLY);
578 }
579 
580 static void
583 {
584  vl_api_ikev2_profile_set_udp_encap_reply_t *rmp;
585  int rv = 0;
586 
587 #if WITH_LIBSSL > 0
589  clib_error_t *error;
590  u8 *tmp = format (0, "%s", mp->name);
591  error = ikev2_set_profile_udp_encap (vm, tmp);
592  vec_free (tmp);
593  if (error)
594  {
595  ikev2_log_error ("%U", format_clib_error, error);
596  clib_error_free (error);
597  rv = VNET_API_ERROR_UNSPECIFIED;
598  }
599 #else
600  rv = VNET_API_ERROR_UNIMPLEMENTED;
601 #endif
602 
603  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_UDP_ENCAP_REPLY);
604 }
605 
606 static void
608 {
609  vl_api_ikev2_profile_set_ts_reply_t *rmp;
610  int rv = 0;
611 
612 #if WITH_LIBSSL > 0
614  clib_error_t *error;
615  u8 *tmp = format (0, "%s", mp->name);
617  ip_address_decode2 (&mp->ts.start_addr, &start_addr);
618  ip_address_decode2 (&mp->ts.end_addr, &end_addr);
619  error =
620  ikev2_set_profile_ts (vm, tmp, mp->ts.protocol_id,
621  clib_net_to_host_u16 (mp->ts.start_port),
622  clib_net_to_host_u16 (mp->ts.end_port),
623  start_addr, end_addr, mp->ts.is_local);
624  vec_free (tmp);
625  if (error)
626  {
627  ikev2_log_error ("%U", format_clib_error, error);
628  clib_error_free (error);
629  rv = VNET_API_ERROR_UNSPECIFIED;
630  }
631 #else
632  rv = VNET_API_ERROR_UNIMPLEMENTED;
633 #endif
634 
635  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_TS_REPLY);
636 }
637 
638 static void
640 {
641  vl_api_ikev2_set_local_key_reply_t *rmp;
642  int rv = 0;
643 
644 #if WITH_LIBSSL > 0
646  clib_error_t *error;
647 
648  error = ikev2_set_local_key (vm, mp->key_file);
649  if (error)
650  {
651  ikev2_log_error ("%U", format_clib_error, error);
652  clib_error_free (error);
653  rv = VNET_API_ERROR_UNSPECIFIED;
654  }
655 #else
656  rv = VNET_API_ERROR_UNIMPLEMENTED;
657 #endif
658 
659  REPLY_MACRO (VL_API_IKEV2_SET_LOCAL_KEY_REPLY);
660 }
661 
662 static void
664 {
665  vl_api_ikev2_set_responder_reply_t *rmp;
666  int rv = 0;
667 
668 #if WITH_LIBSSL > 0
670  clib_error_t *error;
671 
672  u8 *tmp = format (0, "%s", mp->name);
674  ip_address_decode2 (&mp->responder.addr, &ip);
675  u32 sw_if_index = clib_net_to_host_u32 (mp->responder.sw_if_index);
676 
677  error = ikev2_set_profile_responder (vm, tmp, sw_if_index, ip);
678  vec_free (tmp);
679  if (error)
680  {
681  ikev2_log_error ("%U", format_clib_error, error);
682  clib_error_free (error);
683  rv = VNET_API_ERROR_UNSPECIFIED;
684  }
685 #else
686  rv = VNET_API_ERROR_UNIMPLEMENTED;
687 #endif
688 
689  REPLY_MACRO (VL_API_IKEV2_SET_RESPONDER_REPLY);
690 }
691 
692 static void
694  mp)
695 {
696  vl_api_ikev2_set_ike_transforms_reply_t *rmp;
697  int rv = 0;
698 
699 #if WITH_LIBSSL > 0
701  clib_error_t *error;
702 
703  u8 *tmp = format (0, "%s", mp->name);
704 
705  error =
706  ikev2_set_profile_ike_transforms (vm, tmp, mp->tr.crypto_alg,
707  mp->tr.integ_alg,
708  mp->tr.dh_group,
709  ntohl (mp->tr.crypto_key_size));
710  vec_free (tmp);
711  if (error)
712  {
713  ikev2_log_error ("%U", format_clib_error, error);
714  clib_error_free (error);
715  rv = VNET_API_ERROR_UNSPECIFIED;
716  }
717 #else
718  rv = VNET_API_ERROR_UNIMPLEMENTED;
719 #endif
720 
721  REPLY_MACRO (VL_API_IKEV2_SET_IKE_TRANSFORMS_REPLY);
722 }
723 
724 static void
726  mp)
727 {
728  vl_api_ikev2_set_esp_transforms_reply_t *rmp;
729  int rv = 0;
730 
731 #if WITH_LIBSSL > 0
733  clib_error_t *error;
734 
735  u8 *tmp = format (0, "%s", mp->name);
736 
737  error =
738  ikev2_set_profile_esp_transforms (vm, tmp, mp->tr.crypto_alg,
739  mp->tr.integ_alg,
740  ntohl (mp->tr.crypto_key_size));
741  vec_free (tmp);
742  if (error)
743  {
744  ikev2_log_error ("%U", format_clib_error, error);
745  clib_error_free (error);
746  rv = VNET_API_ERROR_UNSPECIFIED;
747  }
748 #else
749  rv = VNET_API_ERROR_UNIMPLEMENTED;
750 #endif
751 
752  REPLY_MACRO (VL_API_IKEV2_SET_ESP_TRANSFORMS_REPLY);
753 }
754 
755 static void
757 {
758  vl_api_ikev2_set_sa_lifetime_reply_t *rmp;
759  int rv = 0;
760 
761 #if WITH_LIBSSL > 0
763  clib_error_t *error;
764 
765  u8 *tmp = format (0, "%s", mp->name);
766 
767  error =
769  clib_net_to_host_u64 (mp->lifetime),
770  ntohl (mp->lifetime_jitter),
771  ntohl (mp->handover),
772  clib_net_to_host_u64
773  (mp->lifetime_maxdata));
774  vec_free (tmp);
775  if (error)
776  {
777  ikev2_log_error ("%U", format_clib_error, error);
778  clib_error_free (error);
779  rv = VNET_API_ERROR_UNSPECIFIED;
780  }
781 #else
782  rv = VNET_API_ERROR_UNIMPLEMENTED;
783 #endif
784 
785  REPLY_MACRO (VL_API_IKEV2_SET_SA_LIFETIME_REPLY);
786 }
787 
788 static void
791 {
792  vl_api_ikev2_profile_set_ipsec_udp_port_reply_t *rmp;
793  int rv = 0;
794 
795 #if WITH_LIBSSL > 0
797 
798  u8 *tmp = format (0, "%s", mp->name);
799 
800  rv =
802  clib_net_to_host_u16 (mp->port),
803  mp->is_set);
804  vec_free (tmp);
805 #else
806  rv = VNET_API_ERROR_UNIMPLEMENTED;
807 #endif
808 
809  REPLY_MACRO (VL_API_IKEV2_PROFILE_SET_IPSEC_UDP_PORT_REPLY);
810 }
811 
812 static void
815 {
816  vl_api_ikev2_set_tunnel_interface_reply_t *rmp;
817  int rv = 0;
818 
820 
821 #if WITH_LIBSSL > 0
822  u8 *tmp = format (0, "%s", mp->name);
823  clib_error_t *error;
824 
826  ntohl (mp->sw_if_index));
827 
828  if (error)
829  {
830  ikev2_log_error ("%U", format_clib_error, error);
831  clib_error_free (error);
832  rv = VNET_API_ERROR_UNSPECIFIED;
833  }
834  vec_free (tmp);
835 #else
836  rv = VNET_API_ERROR_UNIMPLEMENTED;
837 #endif
838 
840  REPLY_MACRO (VL_API_IKEV2_SET_TUNNEL_INTERFACE_REPLY);
841 }
842 
843 static void
845 {
846  vl_api_ikev2_initiate_sa_init_reply_t *rmp;
847  int rv = 0;
848 
849 #if WITH_LIBSSL > 0
851  clib_error_t *error;
852 
853  u8 *tmp = format (0, "%s", mp->name);
854 
855  error = ikev2_initiate_sa_init (vm, tmp);
856  vec_free (tmp);
857  if (error)
858  {
859  ikev2_log_error ("%U", format_clib_error, error);
860  clib_error_free (error);
861  rv = VNET_API_ERROR_UNSPECIFIED;
862  }
863 #else
864  rv = VNET_API_ERROR_UNIMPLEMENTED;
865 #endif
866 
867  REPLY_MACRO (VL_API_IKEV2_INITIATE_SA_INIT_REPLY);
868 }
869 
870 static void
872  * mp)
873 {
874  vl_api_ikev2_initiate_del_ike_sa_reply_t *rmp;
875  int rv = 0;
876 
877 #if WITH_LIBSSL > 0
879  clib_error_t *error;
880 
881  error = ikev2_initiate_delete_ike_sa (vm, mp->ispi);
882  if (error)
883  {
884  ikev2_log_error ("%U", format_clib_error, error);
885  clib_error_free (error);
886  rv = VNET_API_ERROR_UNSPECIFIED;
887  }
888 #else
889  rv = VNET_API_ERROR_UNIMPLEMENTED;
890 #endif
891 
892  REPLY_MACRO (VL_API_IKEV2_INITIATE_DEL_IKE_SA_REPLY);
893 }
894 
895 static void
898 {
899  vl_api_ikev2_initiate_del_child_sa_reply_t *rmp;
900  int rv = 0;
901 
902 #if WITH_LIBSSL > 0
904  clib_error_t *error;
905 
906  error = ikev2_initiate_delete_child_sa (vm, mp->ispi);
907  if (error)
908  {
909  ikev2_log_error ("%U", format_clib_error, error);
910  clib_error_free (error);
911  rv = VNET_API_ERROR_UNSPECIFIED;
912  }
913 #else
914  rv = VNET_API_ERROR_UNIMPLEMENTED;
915 #endif
916 
917  REPLY_MACRO (VL_API_IKEV2_INITIATE_DEL_CHILD_SA_REPLY);
918 }
919 
920 static void
923 {
924  vl_api_ikev2_profile_disable_natt_reply_t *rmp;
925  int rv = 0;
926 
927 #if WITH_LIBSSL > 0
928  clib_error_t *error;
929 
930  u8 *tmp = format (0, "%s", mp->name);
931  error = ikev2_profile_natt_disable (tmp);
932  vec_free (tmp);
933  if (error)
934  {
935  ikev2_log_error ("%U", format_clib_error, error);
936  clib_error_free (error);
937  rv = VNET_API_ERROR_UNSPECIFIED;
938  }
939 #else
940  rv = VNET_API_ERROR_UNIMPLEMENTED;
941 #endif
942 
943  REPLY_MACRO (VL_API_IKEV2_PROFILE_DISABLE_NATT_REPLY);
944 }
945 
946 static void
949 {
950  vl_api_ikev2_initiate_rekey_child_sa_reply_t *rmp;
951  int rv = 0;
952 
953 #if WITH_LIBSSL > 0
955  clib_error_t *error;
956 
957  error = ikev2_initiate_rekey_child_sa (vm, mp->ispi);
958  if (error)
959  {
960  ikev2_log_error ("%U", format_clib_error, error);
961  clib_error_free (error);
962  rv = VNET_API_ERROR_UNSPECIFIED;
963  }
964 #else
965  rv = VNET_API_ERROR_UNIMPLEMENTED;
966 #endif
967 
968  REPLY_MACRO (VL_API_IKEV2_INITIATE_REKEY_CHILD_SA_REPLY);
969 }
970 
971 #include <ikev2/ikev2.api.c>
972 static clib_error_t *
974 {
975  ikev2_main_t *im = &ikev2_main;
976 
977  /* Ask for a correctly-sized block of API message decode slots */
979 
980  return 0;
981 }
982 
984 
985 /*
986  * fd.io coding-style-patch-verification: ON
987  *
988  * Local Variables:
989  * eval: (c-set-style "gnu")
990  * End:
991  */
ikev2_main_per_thread_data_t * per_thread_data
Definition: ikev2_priv.h:493
vl_api_ikev2_sa_t sa
Definition: ikev2.api:89
clib_error_t * ikev2_profile_natt_disable(u8 *name)
Definition: ikev2.c:4812
vl_api_address_t end_addr
Definition: ikev2_types.api:38
ikev2_transform_type_t type
Definition: ikev2_priv.h:215
u8 * format_clib_error(u8 *s, va_list *va)
Definition: error.c:191
ikev2_id_t r_id
Definition: ikev2_priv.h:406
details on specific traffic selector
Definition: ikev2.api:182
ikev2_transforms_set ike_ts
Definition: ikev2_priv.h:340
ip_address_t end_addr
Definition: ikev2_priv.h:253
static void vl_api_ikev2_profile_set_ipsec_udp_port_t_handler(vl_api_ikev2_profile_set_ipsec_udp_port_t *mp)
Definition: ikev2_api.c:790
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
Definition: ip_types_api.c:216
static void vl_api_ikev2_initiate_rekey_child_sa_t_handler(vl_api_ikev2_initiate_rekey_child_sa_t *mp)
Definition: ikev2_api.c:948
IKEv2: Set Child SA lifetime, limited by time and/or data.
Definition: ikev2.api:377
vl_api_ikev2_ike_transforms_t tr
Definition: ikev2.api:346
#define ntohs(x)
Definition: af_xdp.bpf.c:29
static void vl_api_ikev2_nonce_get_t_handler(vl_api_ikev2_nonce_get_t *mp)
Definition: ikev2_api.c:415
clib_error_t * ikev2_add_del_profile(vlib_main_t *vm, u8 *name, int is_add)
Definition: ikev2.c:3802
clib_error_t * ikev2_set_profile_udp_encap(vlib_main_t *vm, u8 *name)
Definition: ikev2.c:4098
IKEv2: Disable NAT traversal.
Definition: ikev2.api:259
static void cp_responder(vl_api_ikev2_responder_t *vl_api_responder, ikev2_responder_t *responder)
Definition: ikev2_api.c:115
IKEv2: Add/delete profile.
Definition: ikev2.api:197
ikev2_transform_dh_type_t dh_type
Definition: ikev2_priv.h:266
vl_api_ikev2_ts_t ts
Definition: ikev2.api:280
vl_api_ikev2_auth_t auth
Definition: ikev2_types.api:88
ikev2_profile_t * profiles
Definition: ikev2_priv.h:473
clib_error_t * ikev2_initiate_delete_ike_sa(vlib_main_t *vm, u64 ispi)
Definition: ikev2.c:4430
vl_api_address_t start_addr
Definition: ikev2_types.api:37
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Definition: api.h:35
ip_address_t addr
Definition: ikev2_priv.h:259
ikev2_transform_encr_type_t crypto_alg
Definition: ikev2_priv.h:264
clib_error_t * ikev2_set_profile_tunnel_interface(vlib_main_t *vm, u8 *name, u32 sw_if_index)
Definition: ikev2.c:4045
u8 * sk_pi
Definition: ikev2_priv.h:397
IKEv2: Set liveness parameters.
Definition: ikev2.api:489
vlib_main_t * vm
Definition: in2out_ed.c:1582
static void vl_api_ikev2_profile_disable_natt_t_handler(vl_api_ikev2_profile_disable_natt_t *mp)
Definition: ikev2_api.c:922
clib_error_t * ikev2_set_profile_sa_lifetime(vlib_main_t *vm, u8 *name, u64 lifetime, u32 jitter, u32 handover, u64 maxdata)
Definition: ikev2.c:4114
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
static void vl_api_ikev2_initiate_sa_init_t_handler(vl_api_ikev2_initiate_sa_init_t *mp)
Definition: ikev2_api.c:844
clib_error_t * ikev2_set_liveness_params(u32 period, u32 max_retries)
Definition: ikev2.c:4799
ip_address_t iaddr
Definition: ikev2_priv.h:373
#define REPLY_MACRO2_ZERO(t, body)
static u32 ikev2_encode_sa_index(u32 sai, u32 ti)
Definition: ikev2_api.c:47
static void ikev2_decode_sa_index(u32 api_sai, u32 *sai, u32 *ti)
Definition: ikev2_api.c:53
static void vl_api_ikev2_set_sa_lifetime_t_handler(vl_api_ikev2_set_sa_lifetime_t *mp)
Definition: ikev2_api.c:756
void * vl_msg_api_alloc(int nbytes)
u16 ipsec_over_udp_port
Definition: ikev2_priv.h:346
static void vl_api_ikev2_initiate_del_ike_sa_t_handler(vl_api_ikev2_initiate_del_ike_sa_t *mp)
Definition: ikev2_api.c:871
unsigned char u8
Definition: types.h:56
vnet_api_error_t ikev2_set_profile_ipsec_udp_port(vlib_main_t *vm, u8 *name, u16 port, u8 is_set)
Definition: ikev2.c:4065
#define pool_len(p)
Number of elements in pool vector.
Definition: pool.h:140
u8 data[128]
Definition: ipsec_types.api:89
ikev2_sa_transform_t * ikev2_sa_get_td_for_type(ikev2_sa_proposal_t *p, ikev2_transform_type_t type)
Definition: ikev2.c:252
ikev2_auth_t auth
Definition: ikev2_priv.h:334
dump traffic selectors
Definition: ikev2.api:164
#define clib_memcpy(d, s, n)
Definition: string.h:180
ikev2_id_t rem_id
Definition: ikev2_priv.h:336
IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
Definition: ikev2.api:340
static void vl_api_ikev2_child_sa_dump_t_handler(vl_api_ikev2_child_sa_dump_t *mp)
Definition: ikev2_api.c:340
static void vl_api_ikev2_profile_dump_t_handler(vl_api_ikev2_profile_dump_t *mp)
Definition: ikev2_api.c:180
static void vl_api_ikev2_plugin_get_version_t_handler(vl_api_ikev2_plugin_get_version_t *mp)
Definition: ikev2_api.c:449
static void vl_api_ikev2_set_local_key_t_handler(vl_api_ikev2_set_local_key_t *mp)
Definition: ikev2_api.c:639
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:513
ikev2_sa_proposal_t * r_proposals
Definition: ikev2_priv.h:281
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:173
clib_error_t * ikev2_initiate_sa_init(vlib_main_t *vm, u8 *name)
Definition: ikev2.c:4165
static void send_sa(ikev2_sa_t *sa, vl_api_ikev2_sa_dump_t *mp, u32 api_sa_index)
Definition: ikev2_api.c:198
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
Definition: vec.h:350
clib_error_t * ikev2_set_profile_auth(vlib_main_t *vm, u8 *name, u8 auth_method, u8 *auth_data, u8 data_hex_format)
Definition: ikev2.c:3838
static void vl_api_ikev2_set_tunnel_interface_t_handler(vl_api_ikev2_set_tunnel_interface_t *mp)
Definition: ikev2_api.c:814
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void cp_id(vl_api_ikev2_id_t *vl_api_id, ikev2_id_t *id)
Definition: ikev2_api.c:79
IKEv2: Initiate the delete Child SA exchange.
Definition: ikev2.api:426
ikev2_transform_integ_type_t integ_alg
Definition: ikev2_priv.h:265
unsigned int u32
Definition: types.h:88
IKEv2: Set IKEv2 profile local/remote identification.
Definition: ikev2.api:240
static void vl_api_ikev2_profile_set_ts_t_handler(vl_api_ikev2_profile_set_ts_t *mp)
Definition: ikev2_api.c:607
IKEv2: Set IKEv2 profile traffic selector parameters.
Definition: ikev2.api:274
static void cp_esp_transforms(vl_api_ikev2_esp_transforms_t *vl_api_ts, ikev2_transforms_set *ts)
Definition: ikev2_api.c:70
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, u32 crypto_key_size)
Definition: ikev2.c:4022
ikev2_id_t loc_id
Definition: ikev2_priv.h:335
u8 * sk_ar
Definition: ikev2_priv.h:394
static void vl_api_ikev2_set_ike_transforms_t_handler(vl_api_ikev2_set_ike_transforms_t *mp)
Definition: ikev2_api.c:693
ikev2_responder_t responder
Definition: ikev2_priv.h:339
static void cp_ike_transforms(vl_api_ikev2_ike_transforms_t *vl_api_ts, ikev2_transforms_set *ts)
Definition: ikev2_api.c:60
clib_error_t * ikev2_set_profile_id(vlib_main_t *vm, u8 *name, u8 id_type, u8 *data, int is_local)
Definition: ikev2.c:3881
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:534
vl_api_ikev2_esp_transforms_t tr
Definition: ikev2.api:363
IKEv2: Initiate the rekey Child SA exchange.
Definition: ikev2.api:441
ikev2_ts_t rem_ts
Definition: ikev2_priv.h:338
static void vl_api_ikev2_traffic_selector_dump_t_handler(vl_api_ikev2_traffic_selector_dump_t *mp)
Definition: ikev2_api.c:369
Dump all profiles.
Definition: ikev2.api:49
ikev2_sa_proposal_t * i_proposals
Definition: ikev2_priv.h:280
u8 data_len
Definition: ikev2_types.api:24
u8 * r_nonce
Definition: ikev2_priv.h:378
u16 end_port
Definition: ikev2_priv.h:251
clib_error_t * ikev2_initiate_delete_child_sa(vlib_main_t *vm, u32 ispi)
Definition: ikev2.c:4390
vl_api_ikev2_profile_t profile
Definition: ikev2.api:63
#define REPLY_MACRO(t)
vl_api_interface_index_t sw_if_index
Definition: ikev2.api:313
static void vl_api_ikev2_set_responder_t_handler(vl_api_ikev2_set_responder_t *mp)
Definition: ikev2_api.c:663
u8 * i_nonce
Definition: ikev2_priv.h:377
clib_error_t * ikev2_set_local_key(vlib_main_t *vm, u8 *file)
Definition: ikev2.c:3605
Dump child SA of specific SA.
Definition: ikev2.api:98
u8 * sk_ei
Definition: ikev2_priv.h:395
bool is_local
Definition: ikev2_types.api:33
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
Definition: ip_types_api.c:166
An API client registration, only in vpp/vlib.
Definition: api_common.h:47
#define BAD_SW_IF_INDEX_LABEL
ip_address_t raddr
Definition: ikev2_priv.h:374
clib_error_t * ikev2_initiate_rekey_child_sa(vlib_main_t *vm, u32 ispi)
Definition: ikev2.c:4513
u32 child_sa_index
Definition: ikev2_types.api:31
ikev2_auth_method_t method
Definition: ikev2_priv.h:201
static void vl_api_ikev2_initiate_del_child_sa_t_handler(vl_api_ikev2_initiate_del_child_sa_t *mp)
Definition: ikev2_api.c:897
ikev2_ts_t * tsi
Definition: ikev2_priv.h:284
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:380
static void cp_auth(vl_api_ikev2_auth_t *vl_api_auth, ikev2_auth_t *auth)
Definition: ikev2_api.c:106
u8 * sk_er
Definition: ikev2_priv.h:396
vl_api_ikev2_responder_t responder
Definition: ikev2_types.api:77
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:299
IKEv2: Initiate the SA_INIT exchange.
Definition: ikev2.api:396
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Definition: api.h:79
static void vl_api_ikev2_profile_set_liveness_t_handler(vl_api_ikev2_profile_set_liveness_t *mp)
Definition: ikev2_api.c:474
get specific nonce
Definition: ikev2.api:128
#define ikev2_log_error(...)
Definition: ikev2_priv.h:180
ikev2_ts_t loc_ts
Definition: ikev2_priv.h:337
ikev2_sa_proposal_t * r_proposals
Definition: ikev2_priv.h:389
u8 protocol_id
Definition: ikev2_priv.h:248
IKEv2: Set/unset custom ipsec-over-udp port.
Definition: ikev2.api:472
IKEv2: Set IKEv2 responder interface and IP address.
Definition: ikev2.api:323
IKEv2: Initiate the delete IKE SA exchange.
Definition: ikev2.api:411
vl_api_ikev2_responder_t responder
Definition: ikev2.api:329
Details about IKE SA.
Definition: ikev2.api:84
IKEv2: Set IKEv2 profile authentication method.
Definition: ikev2.api:217
u8 * sk_ai
Definition: ikev2_priv.h:393
Child SA details.
Definition: ikev2.api:113
static void vl_api_ikev2_profile_set_auth_t_handler(vl_api_ikev2_profile_set_auth_t *mp)
Definition: ikev2_api.c:523
Details about all profiles.
Definition: ikev2.api:60
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23
ikev2_main_t ikev2_main
Definition: ikev2.c:36
Dump all SAs.
Definition: ikev2.api:71
#define IKEV2_PLUGIN_VERSION_MINOR
Definition: ikev2_api.c:42
ikev2_transform_encr_type_t encr_type
Definition: ikev2_priv.h:219
static void vl_api_ikev2_sa_dump_t_handler(vl_api_ikev2_sa_dump_t *mp)
Definition: ikev2_api.c:262
vl_api_address_t ip
Definition: l2.api:501
#define IKEV2_PLUGIN_VERSION_MAJOR
Definition: ikev2_api.c:41
IKEv2: Set IKEv2 local RSA private key.
Definition: ikev2.api:290
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * ikev2_set_profile_responder(vlib_main_t *vm, u8 *name, u32 sw_if_index, ip_address_t addr)
Definition: ikev2.c:3976
u16 start_port
Definition: ikev2_priv.h:250
void cp_sa_transform(vl_api_ikev2_sa_transform_t *vl_tr, ikev2_sa_transform_t *tr)
Definition: ikev2_api.c:123
u8 * sk_pr
Definition: ikev2_priv.h:398
static void vl_api_ikev2_profile_set_id_t_handler(vl_api_ikev2_profile_set_id_t *mp)
Definition: ikev2_api.c:552
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)
Definition: ikev2.c:3997
ikev2_id_t i_id
Definition: ikev2_priv.h:405
Get the plugin version.
Definition: ikev2.api:27
static void vl_api_ikev2_profile_set_udp_encap_t_handler(vl_api_ikev2_profile_set_udp_encap_t *mp)
Definition: ikev2_api.c:582
ikev2_ts_t * tsr
Definition: ikev2_priv.h:285
ikev2_child_sa_t * childs
Definition: ikev2_priv.h:438
#define clib_error_free(e)
Definition: error.h:86
IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
Definition: ikev2.api:357
static void send_profile(ikev2_profile_t *profile, vl_api_registration_t *reg, u32 context)
Definition: ikev2_api.c:135
static void vl_api_ikev2_set_esp_transforms_t_handler(vl_api_ikev2_set_esp_transforms_t *mp)
Definition: ikev2_api.c:725
#define vec_foreach(var, vec)
Vector iterator.
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
Definition: nat_api.c:2804
ip_address_t start_addr
Definition: ikev2_priv.h:252
static void cp_ts(vl_api_ikev2_ts_t *vl_api_ts, ikev2_ts_t *ts, u8 is_local)
Definition: ikev2_api.c:95
static void vl_api_ikev2_profile_add_del_t_handler(vl_api_ikev2_profile_add_del_t *mp)
Definition: ikev2_api.c:497
Reply to get the plugin version.
Definition: ikev2.api:38
static void send_child_sa(ikev2_child_sa_t *child, vl_api_ikev2_child_sa_dump_t *mp, u32 child_sa_index, u32 sa_index)
Definition: ikev2_api.c:283
IKEv2: Set UDP encapsulation.
Definition: ikev2.api:456
ikev2_transforms_set esp_ts
Definition: ikev2_priv.h:341
#define REPLY_MACRO3_ZERO(t, n, body)
clib_error_t * ikev2_set_profile_ts(vlib_main_t *vm, u8 *name, u8 protocol_id, u16 start_port, u16 end_port, ip_address_t start_addr, ip_address_t end_addr, int is_local)
Definition: ikev2.c:3936
vl_api_ikev2_child_sa_t child_sa
Definition: ikev2.api:118
IKEv2: Set the tunnel interface which will be protected by IKE If this API is not called...
Definition: ikev2.api:307
static clib_error_t * ikev2_api_init(vlib_main_t *vm)
Definition: ikev2_api.c:973
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:33
reply on specific nonce
Definition: ikev2.api:146
#define VALIDATE_SW_IF_INDEX(mp)