openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/tools/rsyslogd.c
rsRetVal parseAndSubmitMessage(const uchar* const hname,
                               const uchar* const hnameIP,
                               const uchar* const msg, const int len,
                               const int flags, const flowControl_t flowCtlType,
                               prop_t* const pInputName,
                               const struct syslogTime* const stTime,
                               const time_t ttGenTime,
                               ruleset_t* const pRuleset)
{
    prop_t* pProp = NULL;
    smsg_t* pMsg = NULL;
    DEFiRet;

    /* we now create our own message object and submit it to the queue */
    if (stTime == NULL)
    {
        CHKiRet(msgConstruct(&pMsg));
    }
    else
    {
        CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime));
    }
    if (pInputName != NULL)
        MsgSetInputName(pMsg, pInputName);
    MsgSetRawMsg(pMsg, (char*)msg, len);
    MsgSetFlowControlType(pMsg, flowCtlType);
    MsgSetRuleset(pMsg, pRuleset);
    pMsg->msgFlags = flags | NEEDS_PARSING;

    MsgSetRcvFromStr(pMsg, hname, ustrlen(hname), &pProp);
    CHKiRet(prop.Destruct(&pProp));
    CHKiRet(MsgSetRcvFromIPStr(pMsg, hnameIP, ustrlen(hnameIP), &pProp));
    CHKiRet(prop.Destruct(&pProp));
    CHKiRet(submitMsg2(pMsg));

finalize_it:
    if (iRet != RS_RET_OK)
    {
        DBGPRINTF("parseAndSubmitMessage() error, discarding msg: %s\n", msg);
        if (pMsg != NULL)
        {
            msgDestruct(&pMsg);
        }
    }
    RETiRet;
}
/* This takes a received message that must be decoded and submits it to
 * the main message queue. This is a legacy function which is being provided
 * to aid older input plugins that do not support message creation via
 * the new interfaces themselves. It is not recommended to use this
 * function for new plugins. -- rgerhards, 2009-10-12
 */
This takes a received message that must be decoded and submits it to
the main message queue. This is a legacy function which is being provided
to aid older input plugins that do not support message creation via
the new interfaces themselves. It is not recommended to use this
function for new plugins.
This takes a received message that must be decoded and submits it to the main message queue . This is a legacy function which is being provided to aid older input plugins that do not support message creation via the new interfaces themselves . It is not recommended to use this function for new plugins .
rsRetVal parseAndSubmitMessage(const uchar* const hname,
                               const uchar* const hnameIP,
                               const uchar* const msg, const int len,
                               const int flags, const flowControl_t flowCtlType,
                               prop_t* const pInputName,
                               const struct syslogTime* const stTime,
                               const time_t ttGenTime,
                               ruleset_t* const pRuleset)
{
    prop_t* pProp = NULL;
    smsg_t* pMsg = NULL;
    DEFiRet;
    if (stTime == NULL)
    {
        CHKiRet(msgConstruct(&pMsg));
    }
    else
    {
        CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime));
    }
    if (pInputName != NULL)
        MsgSetInputName(pMsg, pInputName);
    MsgSetRawMsg(pMsg, (char*)msg, len);
    MsgSetFlowControlType(pMsg, flowCtlType);
    MsgSetRuleset(pMsg, pRuleset);
    pMsg->msgFlags = flags | NEEDS_PARSING;
    MsgSetRcvFromStr(pMsg, hname, ustrlen(hname), &pProp);
    CHKiRet(prop.Destruct(&pProp));
    CHKiRet(MsgSetRcvFromIPStr(pMsg, hnameIP, ustrlen(hnameIP), &pProp));
    CHKiRet(prop.Destruct(&pProp));
    CHKiRet(submitMsg2(pMsg));
finalize_it:
    if (iRet != RS_RET_OK)
    {
        DBGPRINTF("parseAndSubmitMessage() error, discarding msg: %s\n", msg);
        if (pMsg != NULL)
        {
            msgDestruct(&pMsg);
        }
    }
    RETiRet;
}
rsRetVal parseAndSubmitMessage ( const uchar * const hname , const uchar * const hnameIP , const uchar * const msg , const int len , const int flags , const flowControl_t flowCtlType , prop_t * const pInputName , const struct syslogTime * const stTime , const time_t ttGenTime , ruleset_t * const pRuleset ) { prop_t * pProp = NULL ; smsg_t * pMsg = NULL ; DEFiRet ; if ( stTime == NULL ) { CHKiRet ( msgConstruct ( & pMsg ) ) ; } else { CHKiRet ( msgConstructWithTime ( & pMsg , stTime , ttGenTime ) ) ; } if ( pInputName != NULL ) MsgSetInputName ( pMsg , pInputName ) ; MsgSetRawMsg ( pMsg , ( char * ) msg , len ) ; MsgSetFlowControlType ( pMsg , flowCtlType ) ; MsgSetRuleset ( pMsg , pRuleset ) ; pMsg -> msgFlags = flags | NEEDS_PARSING ; MsgSetRcvFromStr ( pMsg , hname , ustrlen ( hname ) , & pProp ) ; CHKiRet ( prop . Destruct ( & pProp ) ) ; CHKiRet ( MsgSetRcvFromIPStr ( pMsg , hnameIP , ustrlen ( hnameIP ) , & pProp ) ) ; CHKiRet ( prop . Destruct ( & pProp ) ) ; CHKiRet ( submitMsg2 ( pMsg ) ) ; finalize_it : if ( iRet != RS_RET_OK ) { DBGPRINTF ( " \n " , msg ) ; if ( pMsg != NULL ) { msgDestruct ( & pMsg ) ; } } RETiRet ; }
This takes a received message that must be decoded and submits it to
 the main message queue.
This takes a received message that must be decoded and submits it to the main message queue .
/* we now create our own message object and submit it to the queue */