35 #ifndef _OPENVAS_HOSTS_H
36 #define _OPENVAS_HOSTS_H
46 #include <arpa/inet.h>
openvas_hosts_t * openvas_hosts_new_with_max(const gchar *hosts_str, unsigned int max_hosts)
Creates a new openvas_hosts_t structure and the associated hosts objects from the provided hosts_str...
Definition: openvas_hosts.c:912
The structure for a single host object.
Definition: openvas_hosts.h:76
Definition: openvas_hosts.h:60
gchar * openvas_host_value_str(const openvas_host_t *host)
Gets a host's value in printable format.
Definition: openvas_hosts.c:1641
Definition: openvas_hosts.h:54
void openvas_hosts_free(openvas_hosts_t *hosts)
Frees memory occupied by an openvas_hosts_t structure.
Definition: openvas_hosts.c:1145
Definition: openvas_hosts.h:52
Definition: openvas_hosts.h:53
int openvas_host_in_hosts(const openvas_host_t *host, const struct in6_addr *addr, const openvas_hosts_t *hosts)
Returns whether a host has an equal host in a hosts collection. eg. 192.168.10.1 has an equal in list...
Definition: openvas_hosts.c:1559
unsigned int removed
Definition: openvas_hosts.h:98
Definition: openvas_hosts.h:61
Definition: openvas_hosts.h:55
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...
Definition: openvas_hosts.c:1125
gchar * openvas_host_type_str(const openvas_host_t *host)
Gets a host's type in printable format.
Definition: openvas_hosts.c:1625
int openvas_hosts_reverse_lookup_only(openvas_hosts_t *hosts)
Removes hosts that don't reverse-lookup from the hosts collection. Not to be used while iterating ove...
Definition: openvas_hosts.c:1432
GList * current
Definition: openvas_hosts.h:96
int openvas_host_type(const openvas_host_t *host)
Gets a host object's type.
Definition: openvas_hosts.c:1611
gchar * orig_str
Definition: openvas_hosts.h:94
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...
Definition: openvas_hosts.c:1111
GList * hosts
Definition: openvas_hosts.h:95
void openvas_hosts_resolve(openvas_hosts_t *hosts)
Resolves host objects of type name in a hosts collection, replacing hostnames with IPv4 values...
Definition: openvas_hosts.c:1246
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...
Definition: openvas_hosts.c:1698
struct in_addr addr
Definition: openvas_hosts.h:80
struct in6_addr addr6
Definition: openvas_hosts.h:81
host_type
Definition: openvas_hosts.h:51
Definition: openvas_hosts.h:58
unsigned int openvas_hosts_count(const openvas_hosts_t *hosts)
Gets the count of single hosts objects in a hosts collection.
Definition: openvas_hosts.c:1527
unsigned int openvas_hosts_removed(const openvas_hosts_t *hosts)
Gets the count of single values in hosts string that were removed (duplicates / excluded.)
Definition: openvas_hosts.c:1541
int openvas_hosts_reverse_lookup_unify(openvas_hosts_t *hosts)
Removes hosts duplicates that reverse-lookup to the same value. Not to be used while iterating over t...
Definition: openvas_hosts.c:1474
The structure for Hosts collection.
Definition: openvas_hosts.h:92
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 ...
Definition: openvas_hosts.c:1282
enum host_type type
Definition: openvas_hosts.h:83
gchar * name
Definition: openvas_hosts.h:79
Definition: openvas_hosts.h:56
void openvas_hosts_reverse(openvas_hosts_t *hosts)
Reverses the order of the hosts objects in the collection. Not to be used while iterating over the si...
Definition: openvas_hosts.c:1208
Definition: openvas_hosts.h:59
int openvas_host_get_addr6(const openvas_host_t *host, struct in6_addr *ip6)
Gives a host object's value as an IPv6 address. If the host type is hostname, it resolves the IPv4 ad...
Definition: openvas_hosts.c:1719
unsigned int count
Definition: openvas_hosts.h:97
int openvas_get_host_type(const gchar *str_stripped)
Determines the host type in a buffer.
Definition: openvas_hosts.c:758
void openvas_hosts_shuffle(openvas_hosts_t *hosts)
Randomizes the order of the hosts objects in the collection. Not to be used while iterating over the ...
Definition: openvas_hosts.c:1168
Definition: openvas_hosts.h:57
char * openvas_host_reverse_lookup(openvas_host_t *host)
Checks for a host object reverse dns lookup existence.
Definition: openvas_hosts.c:1380