Go to the documentation of this file.
35 #ifndef _OPENVAS_HOSTS_H
36 #define _OPENVAS_HOSTS_H
46 #include <arpa/inet.h>
host_type
Definition: openvas_hosts.h:51
@ HOST_TYPE_CIDR_BLOCK
Definition: openvas_hosts.h:54
GList * hosts
Definition: openvas_hosts.h:95
enum host_type type
Definition: openvas_hosts.h:83
int openvas_hosts_exclude(openvas_hosts_t *, const gchar *, int)
openvas_hosts_t * openvas_hosts_new(const gchar *)
Creates a new openvas_hosts_t structure and the associated hosts objects from the provided hosts_str.
Definition: openvas_hosts.c:1111
unsigned int openvas_hosts_count(const openvas_hosts_t *)
Gets the count of single hosts objects in a hosts collection.
Definition: openvas_hosts.c:1530
int openvas_host_in_hosts(const openvas_host_t *, const struct in6_addr *, const openvas_hosts_t *)
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:1562
int openvas_host_get_addr6(const openvas_host_t *, struct in6_addr *)
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:1723
struct in6_addr addr6
Definition: openvas_hosts.h:81
gchar * name
Definition: openvas_hosts.h:79
unsigned int count
Definition: openvas_hosts.h:97
void openvas_hosts_resolve(openvas_hosts_t *)
Resolves host objects of type name in a hosts collection, replacing hostnames with IPv4 values....
Definition: openvas_hosts.c:1244
@ HOST_TYPE_CIDR6_BLOCK
Definition: openvas_hosts.h:58
openvas_hosts_t * openvas_hosts_new_with_max(const gchar *, unsigned int)
Creates a new openvas_hosts_t structure and the associated hosts objects from the provided hosts_str.
Definition: openvas_hosts.c:912
enum host_type openvas_host_type(const openvas_host_t *)
Gets a host object's type.
Definition: openvas_hosts.c:1614
@ HOST_TYPE_MAX
Definition: openvas_hosts.h:61
unsigned int removed
Definition: openvas_hosts.h:98
gchar * openvas_host_type_str(const openvas_host_t *)
Gets a host's type in printable format.
Definition: openvas_hosts.c:1629
int openvas_host_resolve(const openvas_host_t *, void *, int)
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:1702
@ HOST_TYPE_RANGE6_LONG
Definition: openvas_hosts.h:59
unsigned int openvas_hosts_removed(const openvas_hosts_t *)
Gets the count of single values in hosts string that were removed (duplicates / excluded....
Definition: openvas_hosts.c:1544
struct in_addr addr
Definition: openvas_hosts.h:80
@ HOST_TYPE_NAME
Definition: openvas_hosts.h:52
@ HOST_TYPE_RANGE_SHORT
Definition: openvas_hosts.h:55
int openvas_get_host_type(const gchar *)
Determines the host type in a buffer.
Definition: openvas_hosts.c:758
GList * current
Definition: openvas_hosts.h:96
void openvas_hosts_shuffle(openvas_hosts_t *)
Randomizes the order of the hosts objects in the collection. Not to be used while iterating over the ...
Definition: openvas_hosts.c:1166
@ HOST_TYPE_IPV6
Definition: openvas_hosts.h:57
The structure for Hosts collection.
Definition: openvas_hosts.h:92
openvas_host_t * openvas_hosts_next(openvas_hosts_t *)
Gets the next openvas_host_t from a openvas_hosts_t structure. The state of iteration is kept interna...
Definition: openvas_hosts.c:1125
@ HOST_TYPE_RANGE6_SHORT
Definition: openvas_hosts.h:60
int openvas_hosts_reverse_lookup_only(openvas_hosts_t *)
Removes hosts that don't reverse-lookup from the hosts collection. Not to be used while iterating ove...
Definition: openvas_hosts.c:1435
@ HOST_TYPE_IPV4
Definition: openvas_hosts.h:53
gchar * openvas_host_value_str(const openvas_host_t *)
Gets a host's value in printable format.
Definition: openvas_hosts.c:1645
@ HOST_TYPE_RANGE_LONG
Definition: openvas_hosts.h:56
int openvas_hosts_reverse_lookup_unify(openvas_hosts_t *)
Removes hosts duplicates that reverse-lookup to the same value. Not to be used while iterating over t...
Definition: openvas_hosts.c:1477
void openvas_hosts_reverse(openvas_hosts_t *)
Reverses the order of the hosts objects in the collection. Not to be used while iterating over the si...
Definition: openvas_hosts.c:1206
void openvas_hosts_free(openvas_hosts_t *)
Frees memory occupied by an openvas_hosts_t structure.
Definition: openvas_hosts.c:1145
char * openvas_host_reverse_lookup(openvas_host_t *)
Checks for a host object reverse dns lookup existence.
Definition: openvas_hosts.c:1378
gchar * orig_str
Definition: openvas_hosts.h:94
The structure for a single host object.
Definition: openvas_hosts.h:76