Signed-off-by: Ankur Sharma <ankursha...@vmware.com> Acked-by: Nithin Raju <nit...@vmware.com> --- datapath-windows/ovsext/Netlink/Netlink.c | 24 ++++++++++++++++++++++++ datapath-windows/ovsext/Netlink/Netlink.h | 2 ++ 2 files changed, 26 insertions(+)
diff --git a/datapath-windows/ovsext/Netlink/Netlink.c b/datapath-windows/ovsext/Netlink/Netlink.c index 0d3539c..cfbc73a 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.c +++ b/datapath-windows/ovsext/Netlink/Netlink.c @@ -761,6 +761,18 @@ NlAttrGetU8(const PNL_ATTR nla) /* * --------------------------------------------------------------------------- + * Returns the 16-bit host byte order value in 'nla''s payload. + * Asserts that 'nla''s payload is at least 2 bytes long. + * --------------------------------------------------------------------------- + */ +UINT16 +NlAttrGetU16(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, UINT16); +} + +/* + * --------------------------------------------------------------------------- * Returns the 32-bit host byte order value in 'nla''s payload. * Asserts that 'nla''s payload is at least 4 bytes long. * --------------------------------------------------------------------------- @@ -773,6 +785,18 @@ NlAttrGetU32(const PNL_ATTR nla) /* * --------------------------------------------------------------------------- + * Returns the 64-bit host byte order value in 'nla''s payload. + * Asserts that 'nla''s payload is at least 8 bytes long. + * --------------------------------------------------------------------------- + */ +UINT64 +NlAttrGetU64(const PNL_ATTR nla) +{ + return NL_ATTR_GET_AS(nla, UINT64); +} + +/* + * --------------------------------------------------------------------------- * Validate the netlink attribute against the policy * --------------------------------------------------------------------------- */ diff --git a/datapath-windows/ovsext/Netlink/Netlink.h b/datapath-windows/ovsext/Netlink/Netlink.h index 0551b73..a9f62bc 100644 --- a/datapath-windows/ovsext/Netlink/Netlink.h +++ b/datapath-windows/ovsext/Netlink/Netlink.h @@ -91,7 +91,9 @@ const PVOID NlAttrGetUnspec(const PNL_ATTR nla, UINT32 size); BE64 NlAttrGetBe64(const PNL_ATTR nla); BE32 NlAttrGetBe32(const PNL_ATTR nla); UINT8 NlAttrGetU8(const PNL_ATTR nla); +UINT16 NlAttrGetU16(const PNL_ATTR nla); UINT32 NlAttrGetU32(const PNL_ATTR nla); +UINT64 NlAttrGetU64(const PNL_ATTR nla); const PNL_ATTR NlAttrFind__(const PNL_ATTR attrs, UINT32 size, UINT16 type); const PNL_ATTR NlAttrFindNested(const PNL_ATTR nla, -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev