/* * --------------------------------------------------------------------------- * Adds Genl Header to the NL_BUF. * --------------------------------------------------------------------------- */ BOOLEAN NlMsgPutGenlHdr(PNL_BUFFER buf, PGENL_MSG_HDR genlMsg) { if ((NlBufCopyAtOffset(buf, (PCHAR)genlMsg, GENL_HDRLEN, NLMSG_HDRLEN))) { return TRUE; } return FALSE; }
/* * --------------------------------------------------------------------------- * Adds Netlink Header to the NL_BUF. * --------------------------------------------------------------------------- */ BOOLEAN NlMsgPutNlHdr(PNL_BUFFER buf, PNL_MSG_HDR nlMsg) { if ((NlBufCopyAtOffset(buf, (PCHAR)nlMsg, NLMSG_HDRLEN, 0))) { return TRUE; } return FALSE; }
/* * --------------------------------------------------------------------------- * Adds OVS Header to the NL_BUF. * --------------------------------------------------------------------------- */ BOOLEAN NlMsgPutOvsHdr(PNL_BUFFER buf, POVS_HDR ovsHdr) { if ((NlBufCopyAtOffset(buf, (PCHAR)ovsHdr, OVS_HDRLEN, GENL_HDRLEN + NLMSG_HDRLEN))) { return TRUE; } return FALSE; }
/* * -------------------------------------------------------------------------- * NlBufCopyAtOffsetUninit -- * * Memsets the buffer portion of length len at head with zero. * * If the offset is earlier then tail end then it first creates * space of size input length at input offset by moving the existing * data forward. * -------------------------------------------------------------------------- */ PCHAR NlBufCopyAtOffsetUninit(PNL_BUFFER nlBuf, UINT32 len, UINT32 offset) { PCHAR ret = NULL; if ((NlBufCopyAtOffset(nlBuf, NULL, len, offset)) == FALSE) { goto done; } ret = nlBuf->head + offset; done: return ret; }