39 main (
int argc,
char **argv)
67 char name[INET_ADDRSTRLEN], name6[INET6_ADDRSTRLEN];
69 struct in6_addr addr6;
73 fprintf (stderr,
"ERROR - %s: Couldn't resolve IPv4 address.\n",
80 if (inet_ntop (AF_INET, &addr,
name,
sizeof (
name)) == NULL)
82 printf (
"inet_ntop() error.\n");
88 fprintf (stderr,
"ERROR - %s: Couldn't resolve IPv6 address.\n",
96 if (inet_ntop (AF_INET6, &addr6, name6,
sizeof (name6)) == NULL)
98 printf (
"inet_ntop() error.\n");
The structure for a single host object.
gchar * openvas_host_value_str(const openvas_host_t *host)
Gets a host's value in printable format.
Protos and data structures for Hosts collections and single hosts objects.
void openvas_hosts_free(openvas_hosts_t *hosts)
Frees memory occupied by an openvas_hosts_t structure.
int main(int argc, char **argv)
openvas_host_t * openvas_hosts_next(openvas_hosts_t *hosts)
Gets the next openvas_host_t from a openvas_hosts_t structure. The state of iteration is kept interna...
gchar * openvas_host_type_str(const openvas_host_t *host)
Gets a host's type in printable format.
openvas_hosts_t * openvas_hosts_new(const gchar *hosts_str)
Creates a new openvas_hosts_t structure and the associated hosts objects from the provided hosts_str.
int openvas_host_resolve(const openvas_host_t *host, void *dst, int family)
Resolves a host object's name to an IPv4 or IPv6 address. Host object should be of type HOST_TYPE_NAM...
enum host_type openvas_host_type(const openvas_host_t *host)
Gets a host object's type.
unsigned int openvas_hosts_count(const openvas_hosts_t *hosts)
Gets the count of single hosts objects in a hosts collection.
unsigned int openvas_hosts_removed(const openvas_hosts_t *hosts)
Gets the count of single values in hosts string that were removed (duplicates / excluded....
The structure for Hosts collection.
int openvas_hosts_exclude(openvas_hosts_t *hosts, const char *excluded_str, int resolve)
Excludes a set of hosts provided as a string from a hosts collection. Not to be used while iterating ...