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/net.c
static rsRetVal PermittedPeerWildcardCompile(permittedPeers_t* pPeer)
{
    uchar* pC;
    uchar* pStart;
    DEFiRet;

    assert(pPeer != NULL);
    assert(pPeer->pszID != NULL);

    /* first check if we have a wildcard */
    for (pC = pPeer->pszID; *pC != '\0' && *pC != '*'; ++pC)
        /*EMPTY, just skip*/;

    if (*pC == '\0')
    {
        /* no wildcard found, we are mostly done */
        pPeer->etryType = PERM_PEER_TYPE_PLAIN;
        FINALIZE;
    }

    /* if we reach this point, the string contains wildcards. So let's
     * compile the structure. To do so, we must parse from dot to dot
     * and create a wildcard entry for each domain component we find.
     * We must also flag problems if we have an asterisk in the middle
     * of the text (it is supported at the start or end only).
     */
    pPeer->etryType = PERM_PEER_TYPE_WILDCARD;
    pC = pPeer->pszID;
    while (*pC != '\0')
    {
        pStart = pC;
        /* find end of domain component */
        for (; *pC != '\0' && *pC != '.'; ++pC)
            /*EMPTY, just skip*/;
        CHKiRet(AddPermittedPeerWildcard(pPeer, pStart, pC - pStart));
        /* now check if we have an empty component at end of string */
        if (*pC == '.' && *(pC + 1) == '\0')
        {
            /* pStart is a dummy, it is not used if length is 0 */
            CHKiRet(AddPermittedPeerWildcard(pPeer, pStart, 0));
        }
        if (*pC != '\0')
            ++pC;
    }

finalize_it:
    if (iRet != RS_RET_OK)
    {
        LogError(0, iRet, "error compiling wildcard expression '%s'",
                 pPeer->pszID);
    }
    RETiRet;
}
/* Compile a wildcard. The function first checks if there is a wildcard
 * present and compiles it only if so ;) It sets the etryType status
 * accordingly.
 * rgerhards, 2008-05-27
 */
Compile a wildcard. The function first checks if there is a wildcard
present and compiles it only if so ;) It sets the etryType status
accordingly.
Compile a wildcard . The function first checks if there is a wildcard present and compiles it only if so ; ) It sets the etryType status accordingly .
static rsRetVal PermittedPeerWildcardCompile(permittedPeers_t* pPeer)
{
    uchar* pC;
    uchar* pStart;
    DEFiRet;
    assert(pPeer != NULL);
    assert(pPeer->pszID != NULL);
    for (pC = pPeer->pszID; *pC != '\0' && *pC != '*'; ++pC)
        ;
    if (*pC == '\0')
    {
        pPeer->etryType = PERM_PEER_TYPE_PLAIN;
        FINALIZE;
    }
    pPeer->etryType = PERM_PEER_TYPE_WILDCARD;
    pC = pPeer->pszID;
    while (*pC != '\0')
    {
        pStart = pC;
        for (; *pC != '\0' && *pC != '.'; ++pC)
            ;
        CHKiRet(AddPermittedPeerWildcard(pPeer, pStart, pC - pStart));
        if (*pC == '.' && *(pC + 1) == '\0')
        {
            CHKiRet(AddPermittedPeerWildcard(pPeer, pStart, 0));
        }
        if (*pC != '\0')
            ++pC;
    }
finalize_it:
    if (iRet != RS_RET_OK)
    {
        LogError(0, iRet, "error compiling wildcard expression '%s'",
                 pPeer->pszID);
    }
    RETiRet;
}
static rsRetVal PermittedPeerWildcardCompile ( permittedPeers_t * pPeer ) { uchar * pC ; uchar * pStart ; DEFiRet ; assert ( pPeer != NULL ) ; assert ( pPeer -> pszID != NULL ) ; for ( pC = pPeer -> pszID ; * pC != ' \0 ' && * pC != ' ' ; ++ pC ) ; if ( * pC == ' \0 ' ) { pPeer -> etryType = PERM_PEER_TYPE_PLAIN ; FINALIZE ; } pPeer -> etryType = PERM_PEER_TYPE_WILDCARD ; pC = pPeer -> pszID ; while ( * pC != ' \0 ' ) { pStart = pC ; for ( ; * pC != ' \0 ' && * pC != ' ' ; ++ pC ) ; CHKiRet ( AddPermittedPeerWildcard ( pPeer , pStart , pC - pStart ) ) ; if ( * pC == ' ' && * ( pC + 1 ) == ' \0 ' ) { CHKiRet ( AddPermittedPeerWildcard ( pPeer , pStart , 0 ) ) ; } if ( * pC != ' \0 ' ) ++ pC ; } finalize_it : if ( iRet != RS_RET_OK ) { LogError ( 0 , iRet , " " , pPeer -> pszID ) ; } RETiRet ; }
Compile a wildcard.
Compile a wildcard .
/* first check if we have a wildcard */ /*EMPTY, just skip*/ /* no wildcard found, we are mostly done */ /* if we reach this point, the string contains wildcards. So let's
     * compile the structure. To do so, we must parse from dot to dot
     * and create a wildcard entry for each domain component we find.
     * We must also flag problems if we have an asterisk in the middle
     * of the text (it is supported at the start or end only).
     */ /* find end of domain component */ /*EMPTY, just skip*/ /* now check if we have an empty component at end of string */ /* pStart is a dummy, it is not used if length is 0 */