Doxygen Source Code Documentation
xxx_name_to_inet.c File Reference
#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>#include <stdio.h>#include <arpa/inet.h>Go to the source code of this file.
| Functions | |
| char * | xxx_name_to_inet (char *host) | 
Function Documentation
| 
 | 
| 
 Definition at line 14 of file xxx_name_to_inet.c. References AFMALL. Referenced by add_TRUST_host(), main(), and self_to_inet(). 
 00015 {
00016    struct hostent * hostp ;
00017    char * iname = NULL , * str ;
00018    int ll ;
00019 
00020    if( host == NULL || host[0] == '\0' ) return NULL ;
00021 
00022    hostp = gethostbyname(host) ; if( hostp == NULL ) return NULL :
00023 
00024    str = inet_ntoa(*((struct in_addr *)(hostp->h_addr))) ;
00025    if( str == NULL || str[0] == '\0' ) return NULL ;
00026 
00027    ll = strlen(str) ; iname = AFMALL(char, ll+1) ; strcpy(iname,str) ;
00028    return iname ;
00029 }
 | 
 
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
 
 
 
 
       
	   
	   
	   
	  