summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Netlink
diff options
context:
space:
mode:
authorSairam Venugopal <vsairam@vmware.com>2016-12-16 14:28:12 -0800
committerGurucharan Shetty <guru@ovn.org>2016-12-20 09:33:30 -0800
commite68988b8afea1cb3c3c07f9e67aedc07b49bce75 (patch)
tree257f93edab910dd98c4d71aeb45eb3b756c3e6b2 /datapath-windows/ovsext/Netlink
parent7fd123b627f35a7da6aa534276760405d66ccbbe (diff)
downloadopenvswitch-e68988b8afea1cb3c3c07f9e67aedc07b49bce75.tar.gz
datapath-windows: Conntrack - Enable FTP support
Enable the support for tracking FTP connections in the Connection tracker. This checks an incoming ftp control connection to extract the related data connection. When a matching data connection arrives, it would then update the connection entry to point to the original control connection. Signed-off-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Netlink')
-rw-r--r--datapath-windows/ovsext/Netlink/Netlink.c16
-rw-r--r--datapath-windows/ovsext/Netlink/Netlink.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Netlink/Netlink.c b/datapath-windows/ovsext/Netlink/Netlink.c
index 24322053c..a63f06623 100644
--- a/datapath-windows/ovsext/Netlink/Netlink.c
+++ b/datapath-windows/ovsext/Netlink/Netlink.c
@@ -992,6 +992,22 @@ NlAttrGetU64(const PNL_ATTR nla)
/*
* ---------------------------------------------------------------------------
+ * Returns the string value in 'nla''s payload.
+ * Returns NULL if it is not a proper '\0' terminated string.
+ * ---------------------------------------------------------------------------
+ */
+PCHAR
+NlAttrGetString(const PNL_ATTR nla)
+{
+ ASSERT(nla->nlaLen >= NLA_HDRLEN);
+ if (!memchr(NlAttrGet(nla), '\0', nla->nlaLen - NLA_HDRLEN)) {
+ return NULL;
+ }
+ return NlAttrGet(nla);
+}
+
+/*
+ * ---------------------------------------------------------------------------
* Validate the netlink attribute against the policy
* ---------------------------------------------------------------------------
*/
diff --git a/datapath-windows/ovsext/Netlink/Netlink.h b/datapath-windows/ovsext/Netlink/Netlink.h
index 363f57501..964c0e5f5 100644
--- a/datapath-windows/ovsext/Netlink/Netlink.h
+++ b/datapath-windows/ovsext/Netlink/Netlink.h
@@ -138,6 +138,7 @@ UINT8 NlAttrGetU8(const PNL_ATTR nla);
UINT16 NlAttrGetU16(const PNL_ATTR nla);
UINT32 NlAttrGetU32(const PNL_ATTR nla);
UINT64 NlAttrGetU64(const PNL_ATTR nla);
+PCHAR NlAttrGetString(const PNL_ATTR nla);
const PNL_ATTR NlAttrFind__(const PNL_ATTR attrs,
UINT32 size, UINT16 type);
const PNL_ATTR NlAttrFindNested(const PNL_ATTR nla,