datapath-windows/ovsext/Netlink/NetlinkBuf.c
/*
 * --------------------------------------------------------------------------
 * NlBufCopyAtHead --
 *
 *    Copies the data to the head of the buffer.
 *    It can be seen as special case of NlBufCopyAtOffset with input
 *    offset zero.
 * --------------------------------------------------------------------------
 */


Copies the data to the head of the buffer.
It can be seen as special case of NlBufCopyAtOffset with input
offset zero.
Copies the data to the head of the buffer . It can be seen as special case of NlBufCopyAtOffset with input offset zero .
BOOLEAN
NlBufCopyAtHead(PNL_BUFFER nlBuf, PCHAR data, UINT32 len)
{
    BOOLEAN ret = TRUE;
    ASSERT(nlBuf);
    if (!NL_BUF_CAN_ADD(nlBuf, len, 0)) {
        ret = FALSE;
        goto done;
    }
    if (nlBuf->head == nlBuf->tail) {
        _NlBufCopyAtTailUnsafe(nlBuf, data, len);
        goto done;
    }
    _NlBufCopyAtOffsetUnsafe(nlBuf, data, len, 0);
done:
    return ret;
}
BOOLEAN NlBufCopyAtHead ( PNL_BUFFER nlBuf , PCHAR data , UINT32 len ) { BOOLEAN ret = TRUE ; ASSERT ( nlBuf ) ; if ( ! NL_BUF_CAN_ADD ( nlBuf , len , 0 ) ) { ret = FALSE ; goto done ; } if ( nlBuf -> head == nlBuf -> tail ) { _NlBufCopyAtTailUnsafe ( nlBuf , data , len ) ; goto done ; } _NlBufCopyAtOffsetUnsafe ( nlBuf , data , len , 0 ) ; done : return ret ; }
NlBufCopyAtHead
NlBufCopyAtHead
/* Check if we have enough space */ /* same as inserting in tail */