openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libpam/1.3.1-r0/Linux-PAM-1.3.1/modules/pam_access/pam_access.c
static int isipaddr(const char* string, int* addr_type,
                    struct sockaddr_storage* addr)
{
    struct sockaddr_storage local_addr;
    int is_ip;

    /* We use struct sockaddr_storage addr because
     * struct in_addr/in6_addr is an integral part
     * of struct sockaddr and we doesn't want to
     * use its value.
     */

    if (addr == NULL)
        addr = &local_addr;

    memset(addr, 0, sizeof(struct sockaddr_storage));

    /* first ipv4 */
    if (inet_pton(AF_INET, string, addr) > 0)
    {
        if (addr_type != NULL)
            *addr_type = AF_INET;

        is_ip = YES;
    }
    else if (inet_pton(AF_INET6, string, addr) > 0)
    { /* then ipv6 */
        if (addr_type != NULL)
        {
            *addr_type = AF_INET6;
        }
        is_ip = YES;
    }
    else
        is_ip = NO;

    return is_ip;
}
/* isipaddr - find out if string provided is an IP address or not */
find out if string provided is an IP address or not
find out if string provided is an IP address or not
static int isipaddr(const char* string, int* addr_type,
                    struct sockaddr_storage* addr)
{
    struct sockaddr_storage local_addr;
    int is_ip;
    if (addr == NULL)
        addr = &local_addr;
    memset(addr, 0, sizeof(struct sockaddr_storage));
    if (inet_pton(AF_INET, string, addr) > 0)
    {
        if (addr_type != NULL)
            *addr_type = AF_INET;
        is_ip = YES;
    }
    else if (inet_pton(AF_INET6, string, addr) > 0)
    { 
        if (addr_type != NULL)
        {
            *addr_type = AF_INET6;
        }
        is_ip = YES;
    }
    else
        is_ip = NO;
    return is_ip;
}
static int isipaddr ( const char * string , int * addr_type , struct sockaddr_storage * addr ) { struct sockaddr_storage local_addr ; int is_ip ; if ( addr == NULL ) addr = & local_addr ; memset ( addr , 0 , sizeof ( struct sockaddr_storage ) ) ; if ( inet_pton ( AF_INET , string , addr ) > 0 ) { if ( addr_type != NULL ) * addr_type = AF_INET ; is_ip = YES ; } else if ( inet_pton ( AF_INET6 , string , addr ) > 0 ) { if ( addr_type != NULL ) { * addr_type = AF_INET6 ; } is_ip = YES ; } else is_ip = NO ; return is_ip ; }
isipaddr - find out if string provided is an IP address or not
isipaddr - find out if string provided is an IP address or not
/* We use struct sockaddr_storage addr because
     * struct in_addr/in6_addr is an integral part
     * of struct sockaddr and we doesn't want to
     * use its value.
     */ /* first ipv4 */ /* then ipv6 */