summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2014-09-19 14:30:53 -0700
committerBen Pfaff <blp@nicira.com>2014-09-19 14:36:55 -0700
commit824c061a995d8bbcb3c78c750ebbae6859660998 (patch)
tree3d85b974ce4838b4c8a07b7304c177921161f121 /datapath-windows/ovsext
parentdb8823415f79d09297843558d4a3f962d1937b3c (diff)
downloadopenvswitch-824c061a995d8bbcb3c78c750ebbae6859660998.tar.gz
datapath-windows: add OvsCompareString() to compare strings
In this patch we implement a utility function to compare ANSI strings using the Rtl* functions. As much as possible, in an NDIS driver, we stick to Rtl* functions for memory/string manipulation. Signed-off-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext')
-rw-r--r--datapath-windows/ovsext/Util.c14
-rw-r--r--datapath-windows/ovsext/Util.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Util.c b/datapath-windows/ovsext/Util.c
index 51360a8f9..2dfba8e3a 100644
--- a/datapath-windows/ovsext/Util.c
+++ b/datapath-windows/ovsext/Util.c
@@ -87,3 +87,17 @@ OvsAppendList(PLIST_ENTRY dst, PLIST_ENTRY src)
src->Flink = src;
src->Blink = src;
}
+
+BOOLEAN
+OvsCompareString(PVOID string1, PVOID string2)
+{
+ /*
+ * Not a super-efficient string compare since we walk over the strings
+ * twice: to initialize, and then to do the comparison.
+ */
+ STRING str1, str2;
+
+ RtlInitString(&str1, string1);
+ RtlInitString(&str2, string2);
+ return RtlEqualString(&str1, &str2, FALSE);
+}
diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h
index c45d48881..e75220931 100644
--- a/datapath-windows/ovsext/Util.h
+++ b/datapath-windows/ovsext/Util.h
@@ -75,4 +75,6 @@ VOID OvsAppendList(PLIST_ENTRY dst, PLIST_ENTRY src);
#define BIT16(_x) ((UINT16)0x1 << (_x))
#define BIT32(_x) ((UINT32)0x1 << (_x))
+BOOLEAN OvsCompareString(PVOID string1, PVOID string2);
+
#endif /* __UTIL_H_ */