diff mbox series

[API-NEXT,v2,2/2] api, linux-gen: ipsec: constify in/out params

Message ID 1511884806-10328-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v2,1/2] api: ipsec: add capabilities for fragmentation support | expand

Commit Message

Github ODP bot Nov. 28, 2017, 4 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Mark all input and out params as constants

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 311 (lumag:ipsec-caps)
 ** https://github.com/Linaro/odp/pull/311
 ** Patch: https://github.com/Linaro/odp/pull/311.patch
 ** Base sha: 4cb02e1caccb9179575e95448fd46979e17d0905
 ** Merge commit sha: 63ff9ce47f9c9abab3f9e75acfffb4737cfca756
 **/
 include/odp/api/spec/ipsec.h       |  6 +++---
 platform/linux-generic/odp_ipsec.c | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 0be9664eb..d57815ed2 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -1027,13 +1027,13 @@  typedef struct odp_ipsec_out_param_t {
 	int num_opt;
 
 	/** Pointer to an array of IPSEC SAs */
-	odp_ipsec_sa_t *sa;
+	const odp_ipsec_sa_t *sa;
 
 	/** Pointer to an array of outbound operation options
 	 *
 	 *  May be NULL when num_opt is zero.
 	 */
-	odp_ipsec_out_opt_t *opt;
+	const odp_ipsec_out_opt_t *opt;
 
 } odp_ipsec_out_param_t;
 
@@ -1061,7 +1061,7 @@  typedef struct odp_ipsec_in_param_t {
 	 *
 	 *  May be NULL when num_sa is zero.
 	 */
-	odp_ipsec_sa_t *sa;
+	const odp_ipsec_sa_t *sa;
 
 } odp_ipsec_in_param_t;
 
diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c
index b17e4cd7b..18ae8ece4 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -582,7 +582,7 @@  uint32_t ipsec_seq_no(ipsec_sa_t *ipsec_sa)
 static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt,
 				    odp_ipsec_sa_t sa,
 				    odp_packet_t *pkt_out,
-				    odp_ipsec_out_opt_t *opt ODP_UNUSED,
+				    const odp_ipsec_out_opt_t *opt ODP_UNUSED,
 				    odp_ipsec_op_status_t *status)
 {
 	ipsec_sa_t *ipsec_sa = NULL;
@@ -998,7 +998,7 @@  int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in,
 	return in_pkt;
 }
 
-static odp_ipsec_out_opt_t default_opt = {
+static const odp_ipsec_out_opt_t default_opt = {
 	.mode = ODP_IPSEC_FRAG_DISABLED,
 };
 
@@ -1022,7 +1022,7 @@  int odp_ipsec_out(const odp_packet_t pkt_in[], int num_in,
 		odp_ipsec_sa_t sa;
 		ipsec_sa_t *ipsec_sa;
 		odp_ipsec_packet_result_t *result;
-		odp_ipsec_out_opt_t *opt;
+		const odp_ipsec_out_opt_t *opt;
 
 		memset(&status, 0, sizeof(status));
 
@@ -1130,7 +1130,7 @@  int odp_ipsec_out_enq(const odp_packet_t pkt_in[], int num_in,
 		odp_ipsec_sa_t sa;
 		ipsec_sa_t *ipsec_sa;
 		odp_ipsec_packet_result_t *result;
-		odp_ipsec_out_opt_t *opt;
+		const odp_ipsec_out_opt_t *opt;
 		odp_queue_t queue;
 
 		memset(&status, 0, sizeof(status));
@@ -1222,7 +1222,7 @@  int odp_ipsec_out_inline(const odp_packet_t pkt_in[], int num_in,
 		odp_ipsec_sa_t sa;
 		ipsec_sa_t *ipsec_sa;
 		odp_ipsec_packet_result_t *result;
-		odp_ipsec_out_opt_t *opt;
+		const odp_ipsec_out_opt_t *opt;
 		uint32_t hdr_len, offset;
 		const void *ptr;