OpenVAS Libraries  6.0+beta5
accessrules.h
Go to the documentation of this file.
1 /* OpenVAS: openvas-libraries/base
2  * $Id$
3  * Description: API (structs and protos) for Access Rules
4  *
5  * Authors:
6  * Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
7  *
8  * Copyright:
9  * Copyright (C) 2009 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 
33 #ifndef _OPENVAS_ACCESSRULES_H
34 #define _OPENVAS_ACCESSRULES_H
35 
36 #include <glib.h>
37 
41 typedef enum
42 {
43  ALLOW = 1,
44  REJECT = 2
45 } rule_t;
46 
53 typedef struct accessrule
54 {
56  gchar *ip;
57 
58  gchar *comment;
59 } accessrule_t;
60 
63 
65 gchar *accessrule_ip (const accessrule_t *);
66 gchar *accessrule_comment (const accessrule_t *);
67 
69 int accessrule_set_ip (accessrule_t *, const gchar *);
70 int accessrule_set_comment (accessrule_t *, const gchar *);
71 
72 gchar *accessrule_as_xml (const accessrule_t *);
73 
74 /* Collections of Access Rules. */
75 
79 typedef GHashTable accessrules_t;
80 
85 
86 guint accessrules_to_file (accessrules_t *, gchar *);
88 
89 #endif /* not _OPENVAS_ACCESSRULE_H */