diff mbox series

[API-NEXT,v2,1/2] api: ipsec: document TFC padding usage

Message ID 1513875661-25412-2-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [API-NEXT,v2,1/2] api: ipsec: document TFC padding usage | expand

Commit Message

Github ODP bot Dec. 21, 2017, 5:01 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


It is possible to include TFC padding into ESP-tunnel packets. Document
usage of such padding according to RFC.

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

---
/** Email created from pull request 329 (lumag:ipsec-tfc)
 ** https://github.com/Linaro/odp/pull/329
 ** Patch: https://github.com/Linaro/odp/pull/329.patch
 ** Base sha: c38fc105f0e9a88dd4ebb4d9e7ac9e1160466322
 ** Merge commit sha: d554b8508bc74d27b4459a1d4cbb3cd84fc1f1eb
 **/
 include/odp/api/spec/ipsec.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 538472a5e..3e11e09f1 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -259,6 +259,10 @@  typedef struct odp_ipsec_capability_t {
 	 */
 	odp_support_t retain_header;
 
+	/** Implementation will automatically truncate TFC padding in received
+	 *  packets */
+	odp_bool tfc_padding_truncate;
+
 	/** Maximum number of different destination CoSes in classification
 	 *  pipelining. The same CoS may be used for many SAs. This is equal or
 	 *  less than 'max_cos' capability in classifier API.
@@ -1209,6 +1213,12 @@  typedef struct odp_ipsec_status_t {
  * restored. The amount and content of packet data before the IP header is
  * undefined.
  *
+ * Additional TFC padding might be present after packet contents for ESP tunnel
+ * mode. Received side can use total (IPv4) or payload (IPv6) length from
+ * internal headers to drop such TFC padding. If @tfc_padding_truncate
+ * capability is set, implementation will truncate received packets
+ * automatically. Otherwise ODP application has to truncate packets manually.
+ *
  * Each successfully transformed packet has a valid value for these metadata
  * regardless of the inner packet parse configuration
  * (odp_ipsec_inbound_config_t):
@@ -1274,6 +1284,11 @@  int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in,
  * with IPSEC, etc headers constructed according to the standards. The amount
  * and content of packet data before the IP header is undefined.
  *
+ * Additional TFC padding might be present after packet payload for ESP-tunnel
+ * mode. It should be filled by application before submitting packet to ODP.
+ * Such padding will be included into encrypted packet. Receiver side will skip
+ * this padding.
+ *
  * Each successfully transformed packet has a valid value for these metadata:
  * - L3 offset: Offset to the first byte of the (outmost) IP header
  *