Ejemplo n.º 1
0
Archivo: Netlink.c Proyecto: 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;
}
Ejemplo n.º 2
0
/*
 * --------------------------------------------------------------------------
 * 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;
}