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 int isAllowedSender2(uchar* pszType, struct sockaddr* pFrom,
                            const char* pszFromHost, int bChkDNS)
{
    struct AllowedSenders* pAllow;
    struct AllowedSenders* pAllowRoot = NULL;
    int bNeededDNS = 0; /* partial check because we could not resolve DNS? */
    int ret;

    assert(pFrom != NULL);

    if (setAllowRoot(&pAllowRoot, pszType) != RS_RET_OK)
        return 0; /* if something went wrong, we deny access - that's the better
                     choice... */

    if (pAllowRoot == NULL)
        return 1; /* checking disabled, everything is valid! */

    /* now we loop through the list of allowed senders. As soon as
     * we find a match, we return back (indicating allowed). We loop
     * until we are out of allowed senders. If so, we fall through the
     * loop and the function's terminal return statement will indicate
     * that the sender is disallowed.
     */
    for (pAllow = pAllowRoot; pAllow != NULL; pAllow = pAllow->pNext)
    {
        ret = MaskCmp(&(pAllow->allowedSender), pAllow->SignificantBits, pFrom,
                      pszFromHost, bChkDNS);
        if (ret == 1)
            return 1;
        else if (ret == 2)
            bNeededDNS = 2;
    }
    return bNeededDNS;
}
/* check if a sender is allowed. The root of the the allowed sender.
 * list must be proveded by the caller. As such, this function can be
 * used to check both UDP and TCP allowed sender lists.
 * returns 1, if the sender is allowed, 0 if not and 2 if we could not
 * obtain a result because we would need a dns name, which we don't have
 * (2 was added rgerhards, 2009-11-16).
 * rgerhards, 2005-09-26
 */
check if a sender is allowed. The root of the the allowed sender.
list must be proveded by the caller. As such, this function can be
used to check both UDP and TCP allowed sender lists.
returns 1, if the sender is allowed, 0 if not and 2 if we could not
obtain a result because we would need a dns name, which we don't have
(2 was added rgerhards, 2009-11-16).
check if a sender is allowed . The root of the the allowed sender . list must be proveded by the caller . As such this function can be used to check both UDP and TCP allowed sender lists . returns 1 if the sender is allowed 0 if not and 2 if we could not obtain a result because we would need a dns name which we don ' t have ( 2 was added rgerhards 2009 - 11 - 16 ) .
static int isAllowedSender2(uchar* pszType, struct sockaddr* pFrom,
                            const char* pszFromHost, int bChkDNS)
{
    struct AllowedSenders* pAllow;
    struct AllowedSenders* pAllowRoot = NULL;
    int bNeededDNS = 0; 
    int ret;
    assert(pFrom != NULL);
    if (setAllowRoot(&pAllowRoot, pszType) != RS_RET_OK)
        return 0; 
    if (pAllowRoot == NULL)
        return 1; 
    for (pAllow = pAllowRoot; pAllow != NULL; pAllow = pAllow->pNext)
    {
        ret = MaskCmp(&(pAllow->allowedSender), pAllow->SignificantBits, pFrom,
                      pszFromHost, bChkDNS);
        if (ret == 1)
            return 1;
        else if (ret == 2)
            bNeededDNS = 2;
    }
    return bNeededDNS;
}
static int isAllowedSender2 ( uchar * pszType , struct sockaddr * pFrom , const char * pszFromHost , int bChkDNS ) { struct AllowedSenders * pAllow ; struct AllowedSenders * pAllowRoot = NULL ; int bNeededDNS = 0 ; int ret ; assert ( pFrom != NULL ) ; if ( setAllowRoot ( & pAllowRoot , pszType ) != RS_RET_OK ) return 0 ; if ( pAllowRoot == NULL ) return 1 ; for ( pAllow = pAllowRoot ; pAllow != NULL ; pAllow = pAllow -> pNext ) { ret = MaskCmp ( & ( pAllow -> allowedSender ) , pAllow -> SignificantBits , pFrom , pszFromHost , bChkDNS ) ; if ( ret == 1 ) return 1 ; else if ( ret == 2 ) bNeededDNS = 2 ; } return bNeededDNS ; }
check if a sender is allowed.
check if a sender is allowed .
/* partial check because we could not resolve DNS? */ /* if something went wrong, we deny access - that's the better
                     choice... */ /* checking disabled, everything is valid! */ /* now we loop through the list of allowed senders. As soon as
     * we find a match, we return back (indicating allowed). We loop
     * until we are out of allowed senders. If so, we fall through the
     * loop and the function's terminal return statement will indicate
     * that the sender is disallowed.
     */