00001 /* $Id$ */ 00002 00003 00004 #ifdef HAVE_CONFIG_H 00005 #include "config.h" 00006 #endif 00007 00008 00009 /* Convert from "a.b.c.d" IP address string into 00010 * an in_addr structure. Returns 0 on failure, 00011 * and 1 on success. 00012 */ 00013 int inet_aton(const char *cp, struct in_addr *addr) 00014 { 00015 if( cp==NULL || addr==NULL ) 00016 { 00017 return(0); 00018 } 00019 00020 addr->s_addr = inet_addr(cp); 00021 return (addr->s_addr == INADDR_NONE) ? 0 : 1; 00022 }