lib/socket-util.c
/* Translates 'host_name', which must be a string representation of an IP
 * address, into a numeric IP address in '*addr'.  Returns 0 if successful,
 * otherwise a positive errno value. */
Translates 'host_name', which must be a string representation of an IP
address, into a numeric IP address in '*addr'.  Returns 0 if successful,
otherwise a positive errno value.
Translates ' host_name ' which must be a string representation of an IP address into a numeric IP address in ' * addr ' . Returns 0 if successful otherwise a positive errno value .
int
lookup_ip(const char *host_name, struct in_addr *addr)
{
    if (!ip_parse(host_name, &addr->s_addr)) {
        static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
        VLOG_ERR_RL(&rl, "\"%s\" is not a valid IP address", host_name);
        return ENOENT;
    }
    return 0;
}
int lookup_ip ( const char * host_name , struct in_addr * addr ) { if ( ! ip_parse ( host_name , & addr -> s_addr ) ) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT ( 1 , 5 ) ; VLOG_ERR_RL ( & rl , " \" \" " , host_name ) ; return ENOENT ; } return 0 ; }
Translates 'host_name', which must be a string representation of an IP
 address, into a numeric IP address in '*addr'.
Translates ' host_name ' which must be a string representation of an IP address into a numeric IP address in ' * addr ' .