datapath-windows/ovsext/Netlink/NetlinkBuf.c
/*
 * --------------------------------------------------------------------------
 * NlBufAt --
 *
 *    Returns pointer to buffer at input offset.
 *    bufLen is used to verify that expected data length
 *    is within valid boundaries. Here by boundaries we mean
 *    within head and tail.
 * --------------------------------------------------------------------------
 */


Returns pointer to buffer at input offset.
bufLen is used to verify that expected data length
is within valid boundaries. Here by boundaries we mean
within head and tail.
Returns pointer to buffer at input offset . bufLen is used to verify that expected data length is within valid boundaries . Here by boundaries we mean within head and tail .
PCHAR
NlBufAt(PNL_BUFFER nlBuf, UINT32 offset, UINT32 bufLen)
{
    PCHAR ret = NULL;
    ASSERT(nlBuf);
    if ((!NL_BUF_IS_VALID_OFFSET(nlBuf, offset))) {
        goto done;
    }
    if ((offset + bufLen) > NL_BUF_USED_SPACE(nlBuf)) {
        goto done;
    }
    ret = nlBuf->head + offset;
done:
    return ret;
}
PCHAR NlBufAt ( PNL_BUFFER nlBuf , UINT32 offset , UINT32 bufLen ) { PCHAR ret = NULL ; ASSERT ( nlBuf ) ; if ( ( ! NL_BUF_IS_VALID_OFFSET ( nlBuf , offset ) ) ) { goto done ; } if ( ( offset + bufLen ) > NL_BUF_USED_SPACE ( nlBuf ) ) { goto done ; } ret = nlBuf -> head + offset ; done : return ret ; }
NlBufAt
NlBufAt
/* Check if requested buffer is within head and tail */