diff options
author | Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> | 2017-06-21 14:48:00 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2017-12-27 21:41:45 +0300 |
commit | c087b86656e95dd3d760af165cb66464f7f5a466 (patch) | |
tree | a785dde4ed36372f91e261c64b61ad0052c7e06b /example | |
parent | e9d60da192588bbd041230b1431030ca19a18959 (diff) |
api: crypto: add crypto packet operation interface
Input and output of crypto operations are packets. API is more flexible
for application and API pipelining when output is packet with additional
metadata. Application or API pipeline stages which do not care about
crypto results may work on basic packet metadata.
Crypto result event type changes from ODP_EVENT_CRYPTO_COMPL to
ODP_EVENT_PACKET. Event subtype (ODP_EVENT_PACKET_CRYPTO) can be
used to identify packets with crypto metadata.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example')
-rw-r--r-- | example/ipsec/odp_ipsec.c | 8 | ||||
-rw-r--r-- | example/ipsec/odp_ipsec_misc.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 775c26dd4..cbb6a43d6 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -724,9 +724,9 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, /* Check crypto result */ if (!result->ok) { - if (!is_crypto_compl_status_ok(&result->cipher_status)) + if (!is_crypto_op_status_ok(&result->cipher_status)) return PKT_DROP; - if (!is_crypto_compl_status_ok(&result->auth_status)) + if (!is_crypto_op_status_ok(&result->auth_status)) return PKT_DROP; } ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); @@ -1011,9 +1011,9 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, /* Check crypto result */ if (!result->ok) { - if (!is_crypto_compl_status_ok(&result->cipher_status)) + if (!is_crypto_op_status_ok(&result->cipher_status)) return PKT_DROP; - if (!is_crypto_compl_status_ok(&result->auth_status)) + if (!is_crypto_op_status_ok(&result->auth_status)) return PKT_DROP; } ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); diff --git a/example/ipsec/odp_ipsec_misc.h b/example/ipsec/odp_ipsec_misc.h index 45cb022eb..20ebe9fce 100644 --- a/example/ipsec/odp_ipsec_misc.h +++ b/example/ipsec/odp_ipsec_misc.h @@ -321,12 +321,12 @@ void ipv4_adjust_len(odph_ipv4hdr_t *ip, int adj) /** * Verify crypto operation completed successfully * - * @param status Pointer to cryto completion structure + * @param status Pointer to crypto op status structure * * @return TRUE if all OK else FALSE */ static inline -odp_bool_t is_crypto_compl_status_ok(odp_crypto_compl_status_t *status) +odp_bool_t is_crypto_op_status_ok(odp_crypto_op_status_t *status) { if (status->alg_err != ODP_CRYPTO_ALG_ERR_NONE) return FALSE; |