Skip to content

Commit

Permalink
datapath-windows: Add support for getting 64 and 16 bit attributes.
Browse files Browse the repository at this point in the history
Signed-off-by: Ankur Sharma <[email protected]>
Acked-by: Nithin Raju <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
ankursh authored and blp committed Sep 17, 2014
1 parent 5ab37d7 commit 8722e8f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions datapath-windows/ovsext/Netlink/Netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,18 @@ NlAttrGetU8(const PNL_ATTR nla)
return NL_ATTR_GET_AS(nla, UINT8);
}

/*
* ---------------------------------------------------------------------------
* 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.
Expand All @@ -771,6 +783,18 @@ NlAttrGetU32(const PNL_ATTR nla)
return NL_ATTR_GET_AS(nla, UINT32);
}

/*
* ---------------------------------------------------------------------------
* 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
Expand Down
2 changes: 2 additions & 0 deletions datapath-windows/ovsext/Netlink/Netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8722e8f

Please sign in to comment.