OpenVAS Libraries  6.0+beta5
Functions
hg_utils.h File Reference

Go to the source code of this file.

Functions

int hg_resolv (char *, struct in6_addr *, int)
 Resolve an hostname. More...
 
char * hg_name_to_domain (char *name)
 
void hg_hosts_cleanup (struct hg_host *)
 Frees all hosts that are linked in hosts, using hg_host_cleanup. More...
 
void hg_host_cleanup (struct hg_host *)
 
int hg_get_name_from_ip (struct in6_addr *, char *, int)
 
int hg_valid_ip_addr (char *)
 

Function Documentation

int hg_get_name_from_ip ( struct in6_addr *  ip,
char *  hostname,
int  sz 
)
Parameters
[out]hostnamePointer to buffer that will contain hostname if successful.
[in]szSize of hostname buffer hostname.
Returns
Always returns 0.
void hg_host_cleanup ( struct hg_host )
void hg_hosts_cleanup ( struct hg_host hosts)

Frees all hosts that are linked in hosts, using hg_host_cleanup.

Parameters
hostshost list to free.
char* hg_name_to_domain ( char *  hostname)

input : hostname (ie : www.if.arf.com) returns: if.arf.com

If the input is arf.com returns : NULL

int hg_resolv ( char *  ,
struct in6_addr *  ,
int   
)

Resolve an hostname.

Todo:
getaddrinfo: host might resolve to more than one ip. In this case (ai->ai_next != NULL). This should somehow be respected, probably needs changes to interface.
int hg_valid_ip_addr ( char *  hostname)
Returns
0 if adress info for hostname could be found, 1 otherwise.