Skip to content

Commit

Permalink
datapath-windows: Upcall NL packet format: Add NL utilities
Browse files Browse the repository at this point in the history
Add NlAttrSize and NlAttrTotalSize

Signed-off-by: Eitan Eliahu <[email protected]>
Acked-by: Ankur Sharma <[email protected]>
Acked-by: Nithin Raju <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
EitanEliahu authored and blp committed Oct 15, 2014
1 parent 0722ee5 commit 152f11b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions datapath-windows/ovsext/Netlink/Netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 payloadSize)
{
return NLA_HDRLEN + payloadSize;
}

/*
* ---------------------------------------------------------------------------
* Total length including padding.
* ---------------------------------------------------------------------------
*/
UINT32
static __inline NlAttrTotalSize(UINT32 payloadSize)
{
return NLA_ALIGN(NlAttrSize(payloadSize));
}

/* Netlink attribute validation */
BOOLEAN NlAttrValidate(const PNL_ATTR, const PNL_POLICY);

Expand Down

0 comments on commit 152f11b

Please sign in to comment.