예제 #1
0
파일: Netlink.c 프로젝트: 18SUN/ovs
/*
 * ---------------------------------------------------------------------------
 * Adds data of length 'len' to the head of NL_BUF.
 * Refer nl_msg_push for more details.
 * ---------------------------------------------------------------------------
 */
BOOLEAN
NlMsgPutHead(PNL_BUFFER buf, const PCHAR data, UINT32 len)
{
    len = NLMSG_ALIGN(len);
    if (NlBufCopyAtHead(buf, data, len)) {
        return TRUE;
    }

    return FALSE;
}
예제 #2
0
파일: NetlinkBuf.c 프로젝트: chixiaobo/ovs
/*
 * --------------------------------------------------------------------------
 * NlBufCopyAtHeadUninit --
 *
 *    Memsets the buffer portion of length len at head with zero.
 * --------------------------------------------------------------------------
 */
PCHAR
NlBufCopyAtHeadUninit(PNL_BUFFER nlBuf, UINT32 len)
{
    PCHAR ret = NULL;

    if ((NlBufCopyAtHead(nlBuf, NULL, len)) == FALSE) {
        goto done;
    }

    ret = nlBuf->head;

done:
    return ret;
}