diff mbox series

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

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

Commit Message

Github ODP bot Dec. 21, 2017, 11 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: 177eeff39e19289e771119cfdffc515cb16f9db5
 ** Merge commit sha: b3c4632b8d6f0fb1635f4ec9eedd9862b727f5a5
 **/
 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 4c3c498cd..a6a622f13 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -238,6 +238,10 @@  typedef struct odp_ipsec_capability_t {
 	 */
 	odp_support_t retain_header;
 
+	/** Implementation will automatically truncate TFC padding in received
+	 *  packets */
+	odp_bool_t 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.
@@ -1206,6 +1210,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):
@@ -1271,6 +1281,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
  *