Acked-by: Ankur Sharma <ankursha...@vmware.com>
________________________________________
From: dev <dev-boun...@openvswitch.org> on behalf of Eitan Eliahu 
<elia...@vmware.com>
Sent: Friday, October 10, 2014 11:08 AM
To: dev@openvswitch.org
Subject: [ovs-dev] [PATCH 1/4] Upcall NL packet format:  Add NL utilities

Add NlAttrSize and NlAttrTotalSize

Signed-off-by: Eitan Eliahu <elia...@vmware.com>
---
 datapath-windows/ovsext/Netlink/Netlink.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/datapath-windows/ovsext/Netlink/Netlink.h 
b/datapath-windows/ovsext/Netlink/Netlink.h
index cd55647..cd69f3a 100644
--- a/datapath-windows/ovsext/Netlink/Netlink.h
+++ b/datapath-windows/ovsext/Netlink/Netlink.h
@@ -137,6 +137,28 @@ NlAttrLen(const PNL_ATTR nla)
     return nla->nlaLen;
 }

+/*
+ * ---------------------------------------------------------------------------
+ * Default maximum payload size for each type of attribute.
+ * ---------------------------------------------------------------------------
+ */
+UINT32
+static __inline NlAttrSize(UINT32 payload)
+{
+    return NLA_HDRLEN + payload;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Total length including padding.
+ * ---------------------------------------------------------------------------
+ */
+UINT32
+static __inline NlAttrTotalSize(UINT32 payload)
+{
+    return NLA_ALIGN(NlAttrSize(payload));
+}
+
 /* Netlink attribute validation */
 BOOLEAN NlAttrValidate(const PNL_ATTR, const PNL_POLICY);

--
1.9.4.msysgit.0

_______________________________________________
dev mailing list
dev@openvswitch.org
https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=f6EhnZ0ORGZNt5QbYmRaOxfWfx%2Bqd3KEiPf3%2FYaollU%3D%0A&m=eHeHfEAq%2FgQSW1m5niOCq2EWqLiZDHZKwYu4LF8%2BWXM%3D%0A&s=bf002a8514168fd52837173f921c246e92ab84336773d4ce73c183f465fe8631
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to