OpenVAS Libraries  7.0.9
openvas_networking.h
Go to the documentation of this file.
1 /* openvas-libraries/base
2  * $Id$
3  * Description: OpenVAS Networking related API.
4  *
5  * Authors:
6  * Hani Benhabiles <hani.benhabiles@greenbone.net>
7  *
8  * Copyright:
9  * Copyright (C) 2013 Greenbone Networks GmbH
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2,
13  * or, at your option, any later version as published by the Free
14  * Software Foundation
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <arpa/inet.h>
30 #include <net/if.h>
31 #include <sys/types.h>
32 #include <ifaddrs.h>
33 #include <netdb.h>
34 #include <glib.h>
35 #include <errno.h>
36 #include <ctype.h>
37 #include <assert.h>
38 
39 #include "array.h"
40 
41 #ifndef _OPENVAS_NETWORKING_H
42 #define _OPENVAS_NETWORKING_H
43 
47 struct range
48 {
49  gchar *comment; /* Comment. */
50  int end; /* End port. 0 for single port. */
51  int exclude; /* Whether to exclude range. */
52  gchar *id; /* UUID. */
53  int start; /* Start port. */
54  int type; /* Port protocol. */
55 };
56 typedef struct range range_t;
57 
64 typedef enum
65 {
70 
71 int
72 openvas_source_iface_init (const char *);
73 
74 int
76 
77 int
78 openvas_source_set_socket (int, int, int);
79 
80 void
81 openvas_source_addr (void *);
82 
83 void
84 openvas_source_addr6 (void *);
85 
86 void
87 openvas_source_addr_as_addr6 (struct in6_addr *);
88 
89 char *
91 
92 char *
94 
95 void
96 ipv4_as_ipv6 (const struct in_addr *, struct in6_addr *);
97 
98 int
99 openvas_resolve (const char *, void *, int);
100 
101 int
102 openvas_resolve_as_addr6 (const char *, struct in6_addr *);
103 
104 int
105 validate_port_range (const char *);
106 
107 array_t*
108 port_range_ranges (const char *);
109 
110 int
112 
113 #endif /* not _OPENVAS_NETWORKING_H */