From: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>

Both tunnel and lookup parameters refer IP protocol version. Factor that
out as an IPsec enum used in both places.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
/** Email created from pull request 20 (lumag:ipsec-ipv)
 ** https://github.com/Linaro/odp/pull/20
 ** Patch: https://github.com/Linaro/odp/pull/20.patch
 ** Base sha: 0b1dbf37b4030c6da4c6f13645c63fd4ac8ff923
 ** Merge commit sha: 3525f2823e4a228a1fd0f9d8b661de0fc248457a
 **/
 include/odp/api/spec/ipsec.h | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index e83494d..7b3b1fe 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -339,16 +339,16 @@ typedef enum odp_ipsec_protocol_t {
 } odp_ipsec_protocol_t;
 
 /**
- * IPSEC tunnel type
+ * IPSEC header type
  */
-typedef enum odp_ipsec_tunnel_type_t {
-       /** Outer header is IPv4 */
-       ODP_IPSEC_TUNNEL_IPV4 = 0,
+typedef enum odp_ipsec_header_type_t {
+       /** Header is IPv4 */
+       ODP_IPSEC_IPV4 = 0,
 
-       /** Outer header is IPv6 */
-       ODP_IPSEC_TUNNEL_IPV6
+       /** Header is IPv6 */
+       ODP_IPSEC_IPV6
 
-} odp_ipsec_tunnel_type_t;
+} odp_ipsec_header_type_t;
 
 /**
  * IPSEC crypto parameters
@@ -378,7 +378,7 @@ typedef struct odp_ipsec_crypto_param_t {
  */
 typedef struct odp_ipsec_tunnel_param_t {
        /** Tunnel type: IPv4 or IPv6 */
-       odp_ipsec_tunnel_type_t type;
+       odp_ipsec_header_type_t type;
 
        /** Variant mappings for tunnel parameters */
        union {
@@ -613,11 +613,8 @@ typedef struct odp_ipsec_sa_param_t {
         *  only in ODP_IPSEC_LOOKUP_DSTADDR_SPI lookup mode. */
        struct {
                /** Select IP version
-                *
-                *  4:   IPv4
-                *  6:   IPv6
                 */
-               uint8_t ip_version;
+               odp_ipsec_header_type_t ip_version;
 
                /** IP destination address (NETWORK ENDIAN) */
                void    *dst_addr;

Reply via email to