X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_ipsec%2Fsa.h;h=c3a0d84bcfc7242a5255f7e5398ccc347e3fa168;hb=dfc6b2fd8da344095567c53f3e087cae3b4690b9;hp=392e8fd7b7ffe62f4c739e00984c467590567519;hpb=c0308cd895542bb9957971f1be081ee2d64c1316;p=dpdk.git diff --git a/lib/librte_ipsec/sa.h b/lib/librte_ipsec/sa.h index 392e8fd7b7..c3a0d84bcf 100644 --- a/lib/librte_ipsec/sa.h +++ b/lib/librte_ipsec/sa.h @@ -14,11 +14,23 @@ /* padding alignment for different algorithms */ enum { IPSEC_PAD_DEFAULT = 4, + IPSEC_PAD_3DES_CBC = 8, IPSEC_PAD_AES_CBC = IPSEC_MAX_IV_SIZE, + IPSEC_PAD_AES_CTR = IPSEC_PAD_DEFAULT, IPSEC_PAD_AES_GCM = IPSEC_PAD_DEFAULT, IPSEC_PAD_NULL = IPSEC_PAD_DEFAULT, }; +/* iv sizes for different algorithms */ +enum { + IPSEC_IV_SIZE_DEFAULT = IPSEC_MAX_IV_SIZE, + IPSEC_AES_CTR_IV_SIZE = sizeof(uint64_t), + /* TripleDES supports IV size of 32bits or 64bits but he library + * only supports 64bits. + */ + IPSEC_3DES_IV_SIZE = sizeof(uint64_t), +}; + /* these definitions probably has to be in rte_crypto_sym.h */ union sym_op_ofslen { uint64_t raw; @@ -47,7 +59,18 @@ struct replay_sqn { __extension__ uint64_t window[0]; }; +/*IPSEC SA supported algorithms */ +enum sa_algo_type { + ALGO_TYPE_NULL = 0, + ALGO_TYPE_3DES_CBC, + ALGO_TYPE_AES_CBC, + ALGO_TYPE_AES_CTR, + ALGO_TYPE_AES_GCM, + ALGO_TYPE_MAX +}; + struct rte_ipsec_sa { + uint64_t type; /* type of given SA */ uint64_t udata; /* user defined */ uint32_t size; /* size of given sa object */ @@ -65,6 +88,7 @@ struct rte_ipsec_sa { union sym_op_ofslen auth; } ctp; uint32_t salt; + uint8_t algo_type; uint8_t proto; /* next proto */ uint8_t aad_len; uint8_t hdr_len;