X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fikev2%2Fikev2.h;h=308ffe52ba42f39579e2ded7ddf8c3c6536f576f;hb=af2cc6425;hp=d435179275aa454d4a67f40c4480790d660c5d07;hpb=459d17bb7d051566c587c4f963014fdbbe99ff6a;p=vpp.git diff --git a/src/plugins/ikev2/ikev2.h b/src/plugins/ikev2/ikev2.h index d435179275a..308ffe52ba4 100644 --- a/src/plugins/ikev2/ikev2.h +++ b/src/plugins/ikev2/ikev2.h @@ -44,14 +44,20 @@ typedef CLIB_PACKED (struct { }) ike_header_t; /* *INDENT-ON* */ +#define ike_hdr_is_response(_h) ((_h)->flags & IKEV2_HDR_FLAG_RESPONSE) +#define ike_hdr_is_request(_h) (!ike_hdr_is_response(_h)) +#define ike_hdr_is_initiator(_h) ((_h)->flags & IKEV2_HDR_FLAG_INITIATOR) +#define ike_hdr_is_responder(_h) (!(ike_hdr_is_initiator(_h))) + /* *INDENT-OFF* */ -typedef CLIB_PACKED (struct - { - u8 nextpayload; - u8 flags; - u16 length; - u16 dh_group; - u8 reserved[2]; u8 payload[0];}) ike_ke_payload_header_t; +typedef CLIB_PACKED (struct { + u8 nextpayload; + u8 flags; + u16 length; + u16 dh_group; + u8 reserved[2]; + u8 payload[0]; +}) ike_ke_payload_header_t; /* *INDENT-ON* */ /* *INDENT-OFF* */ @@ -368,6 +374,12 @@ typedef enum #undef _ } ikev2_id_type_t; +typedef enum +{ + TS_IPV4_ADDR_RANGE = 7, + TS_IPV6_ADDR_RANGE = 8, +} ikev2_traffic_selector_type_t; + clib_error_t *ikev2_init (vlib_main_t * vm); clib_error_t *ikev2_set_local_key (vlib_main_t * vm, u8 * file); clib_error_t *ikev2_add_del_profile (vlib_main_t * vm, u8 * name, int is_add); @@ -378,11 +390,14 @@ clib_error_t *ikev2_set_profile_id (vlib_main_t * vm, u8 * name, u8 id_type, u8 * data, int is_local); 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); + u16 end_port, ip_address_t start_addr, + ip_address_t end_addr, int is_local); clib_error_t *ikev2_set_profile_responder (vlib_main_t * vm, u8 * name, u32 sw_if_index, - ip4_address_t ip4); + ip_address_t addr); +clib_error_t *ikev2_set_profile_responder_hostname (vlib_main_t *vm, u8 *name, + u8 *hostname, + u32 sw_if_index); clib_error_t *ikev2_set_profile_ike_transforms (vlib_main_t * vm, u8 * name, ikev2_transform_encr_type_t crypto_alg,