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/runtime/msg.c
static rsRetVal MsgSerialize(smsg_t * pThis, strm_t * pStrm)
    {
        uchar* psz;
        int len;
        DEFiRet;

        assert(pThis != NULL);
        assert(pStrm != NULL);

        /* then serialize elements */
        CHKiRet(obj.BeginSerialize(pStrm, (obj_t*)pThis));
        objSerializeSCALAR(pStrm, iProtocolVersion, SHORT);
        objSerializeSCALAR(pStrm, iSeverity, SHORT);
        objSerializeSCALAR(pStrm, iFacility, SHORT);
        objSerializeSCALAR(pStrm, msgFlags, INT);
        objSerializeSCALAR(pStrm, ttGenTime, INT);
        objSerializeSCALAR(pStrm, tRcvdAt, SYSLOGTIME);
        objSerializeSCALAR(pStrm, tTIMESTAMP, SYSLOGTIME);

        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszTAG"), PROPTYPE_PSZ,
                                  (void*)((pThis->iLenTAG < CONF_TAG_BUFSIZE)
                                              ? pThis->TAG.szBuf
                                              : pThis->TAG.pszTAG)));

        objSerializePTR(pStrm, pszRawMsg, PSZ);
        objSerializePTR(pStrm, pszHOSTNAME, PSZ);
        getInputName(pThis, &psz, &len);
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszInputName"),
                                  PROPTYPE_PSZ, (void*)psz));
        psz = getRcvFrom(pThis);
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRcvFrom"),
                                  PROPTYPE_PSZ, (void*)psz));
        psz = getRcvFromIP(pThis);
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRcvFromIP"),
                                  PROPTYPE_PSZ, (void*)psz));
        psz = pThis->pszStrucData;
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszStrucData"),
                                  PROPTYPE_PSZ, (void*)psz));
        if (pThis->json != NULL)
        {
            psz = (uchar*)json_object_get_string(pThis->json);
            CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("json"),
                                      PROPTYPE_PSZ, (void*)psz));
        }
        if (pThis->localvars != NULL)
        {
            psz = (uchar*)json_object_get_string(pThis->localvars);
            CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("localvars"),
                                      PROPTYPE_PSZ, (void*)psz));
        }

        objSerializePTR(pStrm, pCSAPPNAME, CSTR);
        objSerializePTR(pStrm, pCSPROCID, CSTR);
        objSerializePTR(pStrm, pCSMSGID, CSTR);

        objSerializePTR(pStrm, pszUUID, PSZ);

        if (pThis->pRuleset != NULL)
        {
            CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRuleset"),
                                      PROPTYPE_PSZ,
                                      rulesetGetName(pThis->pRuleset)));
        }

        /* offset must be serialized after pszRawMsg, because we need that to
         * obtain the correct MSG size.
         */
        objSerializeSCALAR(pStrm, offMSG, SHORT);

        CHKiRet(obj.EndSerialize(pStrm));

    finalize_it:
        RETiRet;
    }
/* This method serializes a message object. That means the whole
     * object is modified into text form. That text form is suitable for
     * later reconstruction of the object by calling MsgDeSerialize().
     * The most common use case for this method is the creation of an
     * on-disk representation of the message object.
     * We do not serialize the cache properties. We re-create them when needed.
     * This saves us a lot of memory. Performance is no concern, as serializing
     * is a so slow operation that recration of the caches does not count. Also,
     * we do not serialize --currently none--, as this is only a helper variable
     * during msg construction - and never again used later.
     * rgerhards, 2008-01-03
     */
This method serializes a message object. That means the whole
object is modified into text form. That text form is suitable for
later reconstruction of the object by calling MsgDeSerialize().
The most common use case for this method is the creation of an
on-disk representation of the message object.
We do not serialize the cache properties. We re-create them when needed.
This saves us a lot of memory. Performance is no concern, as serializing
is a so slow operation that recration of the caches does not count.
This method serializes a message object . That means the whole object is modified into text form . That text form is suitable for later reconstruction of the object by calling MsgDeSerialize () . The most common use case for this method is the creation of an on - disk representation of the message object . We do not serialize the cache properties . We re - create them when needed . This saves us a lot of memory . Performance is no concern as serializing is a so slow operation that recration of the caches does not count .
static rsRetVal MsgSerialize(smsg_t * pThis, strm_t * pStrm)
    {
        uchar* psz;
        int len;
        DEFiRet;
        assert(pThis != NULL);
        assert(pStrm != NULL);
        CHKiRet(obj.BeginSerialize(pStrm, (obj_t*)pThis));
        objSerializeSCALAR(pStrm, iProtocolVersion, SHORT);
        objSerializeSCALAR(pStrm, iSeverity, SHORT);
        objSerializeSCALAR(pStrm, iFacility, SHORT);
        objSerializeSCALAR(pStrm, msgFlags, INT);
        objSerializeSCALAR(pStrm, ttGenTime, INT);
        objSerializeSCALAR(pStrm, tRcvdAt, SYSLOGTIME);
        objSerializeSCALAR(pStrm, tTIMESTAMP, SYSLOGTIME);
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszTAG"), PROPTYPE_PSZ,
                                  (void*)((pThis->iLenTAG < CONF_TAG_BUFSIZE)
                                              ? pThis->TAG.szBuf
                                              : pThis->TAG.pszTAG)));
        objSerializePTR(pStrm, pszRawMsg, PSZ);
        objSerializePTR(pStrm, pszHOSTNAME, PSZ);
        getInputName(pThis, &psz, &len);
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszInputName"),
                                  PROPTYPE_PSZ, (void*)psz));
        psz = getRcvFrom(pThis);
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRcvFrom"),
                                  PROPTYPE_PSZ, (void*)psz));
        psz = getRcvFromIP(pThis);
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRcvFromIP"),
                                  PROPTYPE_PSZ, (void*)psz));
        psz = pThis->pszStrucData;
        CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszStrucData"),
                                  PROPTYPE_PSZ, (void*)psz));
        if (pThis->json != NULL)
        {
            psz = (uchar*)json_object_get_string(pThis->json);
            CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("json"),
                                      PROPTYPE_PSZ, (void*)psz));
        }
        if (pThis->localvars != NULL)
        {
            psz = (uchar*)json_object_get_string(pThis->localvars);
            CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("localvars"),
                                      PROPTYPE_PSZ, (void*)psz));
        }
        objSerializePTR(pStrm, pCSAPPNAME, CSTR);
        objSerializePTR(pStrm, pCSPROCID, CSTR);
        objSerializePTR(pStrm, pCSMSGID, CSTR);
        objSerializePTR(pStrm, pszUUID, PSZ);
        if (pThis->pRuleset != NULL)
        {
            CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRuleset"),
                                      PROPTYPE_PSZ,
                                      rulesetGetName(pThis->pRuleset)));
        }
        objSerializeSCALAR(pStrm, offMSG, SHORT);
        CHKiRet(obj.EndSerialize(pStrm));
    finalize_it:
        RETiRet;
    }
static rsRetVal MsgSerialize ( smsg_t * pThis , strm_t * pStrm ) { uchar * psz ; int len ; DEFiRet ; assert ( pThis != NULL ) ; assert ( pStrm != NULL ) ; CHKiRet ( obj . BeginSerialize ( pStrm , ( obj_t * ) pThis ) ) ; objSerializeSCALAR ( pStrm , iProtocolVersion , SHORT ) ; objSerializeSCALAR ( pStrm , iSeverity , SHORT ) ; objSerializeSCALAR ( pStrm , iFacility , SHORT ) ; objSerializeSCALAR ( pStrm , msgFlags , INT ) ; objSerializeSCALAR ( pStrm , ttGenTime , INT ) ; objSerializeSCALAR ( pStrm , tRcvdAt , SYSLOGTIME ) ; objSerializeSCALAR ( pStrm , tTIMESTAMP , SYSLOGTIME ) ; CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , ( void * ) ( ( pThis -> iLenTAG < CONF_TAG_BUFSIZE ) ? pThis -> TAG . szBuf : pThis -> TAG . pszTAG ) ) ) ; objSerializePTR ( pStrm , pszRawMsg , PSZ ) ; objSerializePTR ( pStrm , pszHOSTNAME , PSZ ) ; getInputName ( pThis , & psz , & len ) ; CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , ( void * ) psz ) ) ; psz = getRcvFrom ( pThis ) ; CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , ( void * ) psz ) ) ; psz = getRcvFromIP ( pThis ) ; CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , ( void * ) psz ) ) ; psz = pThis -> pszStrucData ; CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , ( void * ) psz ) ) ; if ( pThis -> json != NULL ) { psz = ( uchar * ) json_object_get_string ( pThis -> json ) ; CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , ( void * ) psz ) ) ; } if ( pThis -> localvars != NULL ) { psz = ( uchar * ) json_object_get_string ( pThis -> localvars ) ; CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , ( void * ) psz ) ) ; } objSerializePTR ( pStrm , pCSAPPNAME , CSTR ) ; objSerializePTR ( pStrm , pCSPROCID , CSTR ) ; objSerializePTR ( pStrm , pCSMSGID , CSTR ) ; objSerializePTR ( pStrm , pszUUID , PSZ ) ; if ( pThis -> pRuleset != NULL ) { CHKiRet ( obj . SerializeProp ( pStrm , UCHAR_CONSTANT ( " " ) , PROPTYPE_PSZ , rulesetGetName ( pThis -> pRuleset ) ) ) ; } objSerializeSCALAR ( pStrm , offMSG , SHORT ) ; CHKiRet ( obj . EndSerialize ( pStrm ) ) ; finalize_it : RETiRet ; }
This method serializes a message object.
This method serializes a message object .
/* then serialize elements */ /* offset must be serialized after pszRawMsg, because we need that to
         * obtain the correct MSG size.
         */