*: NO_DNS option *: (...will add on...) -{section: List of Condor IP addr functions} - -{code} -// from condor_c++_util/get_full_hostname.cpp - -extern char* get_full_hostname( const char*, - struct in_addr *sin_addrp = NULL ); - -extern char* get_full_hostname_from_hostent( struct hostent* host_ptr, - const char* host ); - -// from condor_util_lib/condor_netdb.c - -struct hostent * -condor_gethostbyname(const char *name); - -struct hostent * -condor_gethostbyaddr(const char *addr, SOCKET_LENGTH_TYPE len, int type); - -int -condor_gethostname(char *name, size_t namelen); - -// from condor_util_lib/internet.c -// internet.c is a total failure...... tons of old-style codings - -int is_ipaddr(const char *inbuf, struct in_addr *sin_addr); - -int is_ipaddr_no_wildcard(const char *inbuf, struct in_addr *sin_addr); - -int is_ipaddr_wildcard(const char *inbuf, struct in_addr *sin_addr, struct in_addr *mask_addr); - -int is_valid_network( const char *network, struct in_addr *ip, struct in_addr *mask); - -int is_valid_sinful( const char *sinful ); - -// there are many more from internet.c. omitted at this time. - -{endcode} - -{subsection: Condor NetDB} - -Condor defines its own netdb-related functions (proxy functions) for its own DNS system called NO_DNS. - {section: Test required} Don't forget below lists. @@ -93,6 +50,16 @@ {section: Converting utility functions} +{subsection: is_ipaddr} + +{code} +int is_ipaddr(const char *inbuf, struct in_addr *sin_addr) +{endcode} + +is_ipaddr() does convert string representation of IP address into numerical representation(in_addr). And, it returns FALSE if it fails. + +Original implementation was just re-invention of inet_ntop()/inet_ntoa(). So, I replaced to new implementation that calls inet_ntop() twice. (with AF_INET and AF_INET6) + {subsection: get_full_hostname} It uses gethostbyname() which has been obsoleted. It should call getaddrinfo() instead. The function has about 150-200 lines of code. At the end of function, it tail-calls get_full_hostname_from_hostent(). struct hostent is also deprecated structure. @@ -125,6 +92,49 @@ It seems assign() is only used by these Shared* thing. So maybe we could end up with refactoring it. +{section: List of Condor IP addr functions} + +{code} +// from condor_c++_util/get_full_hostname.cpp + +extern char* get_full_hostname( const char*, + struct in_addr *sin_addrp = NULL ); + +extern char* get_full_hostname_from_hostent( struct hostent* host_ptr, + const char* host ); + +// from condor_util_lib/condor_netdb.c + +struct hostent * +condor_gethostbyname(const char *name); + +struct hostent * +condor_gethostbyaddr(const char *addr, SOCKET_LENGTH_TYPE len, int type); + +int +condor_gethostname(char *name, size_t namelen); + +// from condor_util_lib/internet.c +// internet.c is a total failure...... tons of old-style codings + +int is_ipaddr(const char *inbuf, struct in_addr *sin_addr); + +int is_ipaddr_no_wildcard(const char *inbuf, struct in_addr *sin_addr); + +int is_ipaddr_wildcard(const char *inbuf, struct in_addr *sin_addr, struct in_addr *mask_addr); + +int is_valid_network( const char *network, struct in_addr *ip, struct in_addr *mask); + +int is_valid_sinful( const char *sinful ); + +// there are many more from internet.c. omitted at this time. + +{endcode} + +{subsection: Condor NetDB} + +Condor defines its own netdb-related functions (proxy functions) for its own DNS system called NO_DNS. + {section: What is it?} TCP_FORWARDING_HOST ?