Ejemplo n.º 1
0
/*
 * ---------------------------------------------------------------------------
 * Prepare a 'OVS_MESSAGE_ERROR' message.
 * ---------------------------------------------------------------------------
 */
VOID
NlBuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgError, UINT errorCode)
{
    NL_BUFFER nlBuffer;

    NlBufInit(&nlBuffer, (PCHAR)msgError, sizeof *msgError);
    NlFillNlHdr(&nlBuffer, NLMSG_ERROR, 0,
                msgIn->nlMsg.nlmsgSeq, msgIn->nlMsg.nlmsgPid);

    msgError->errorMsg.error = errorCode;
    msgError->errorMsg.nlMsg = msgIn->nlMsg;
    msgError->nlMsg.nlmsgLen = sizeof(OVS_MESSAGE_ERROR);
}
Ejemplo n.º 2
0
Archivo: Netlink.c Proyecto: 18SUN/ovs
/*
 * ---------------------------------------------------------------------------
 * Prepare a 'OVS_MESSAGE_ERROR' message.
 * ---------------------------------------------------------------------------
 */
VOID
NlBuildErrorMsg(POVS_MESSAGE msgIn, POVS_MESSAGE_ERROR msgError,
                UINT errorCode, UINT32 *replyLen)
{
    NL_BUFFER nlBuffer;

    ASSERT(errorCode != NL_ERROR_PENDING);

    NlBufInit(&nlBuffer, (PCHAR)msgError, sizeof *msgError);
    NlFillNlHdr(&nlBuffer, NLMSG_ERROR, 0,
                msgIn->nlMsg.nlmsgSeq, msgIn->nlMsg.nlmsgPid);

    msgError->errorMsg.error = errorCode;
    msgError->errorMsg.nlMsg = msgIn->nlMsg;
    msgError->nlMsg.nlmsgLen = sizeof(OVS_MESSAGE_ERROR);

    *replyLen = msgError->nlMsg.nlmsgLen;
}