OpenVAS Libraries
6.0+beta5
Main Page
Related Pages
Data Structures
Files
File List
Globals
base
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
{
55
rule_t
rule
;
56
gchar *
ip
;
57
gchar *
comment
;
59
}
accessrule_t
;
60
61
accessrule_t
*
accessrule_new
(
void
);
62
void
accessrule_free
(
accessrule_t
*);
63
64
rule_t
accessrule_rule
(
const
accessrule_t
*);
65
gchar *
accessrule_ip
(
const
accessrule_t
*);
66
gchar *
accessrule_comment
(
const
accessrule_t
*);
67
68
int
accessrule_set_rule
(
accessrule_t
*,
const
rule_t
);
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
81
accessrules_t
*
accessrules_new
();
82
void
accessrules_free
(
accessrules_t
*);
83
guint
accessrules_size
(
accessrules_t
*);
84
void
accessrules_add
(
accessrules_t
*,
accessrule_t
*);
85
86
guint
accessrules_to_file
(
accessrules_t
*, gchar *);
87
accessrules_t
*
accessrules_from_file
(gchar *);
88
89
#endif
/* not _OPENVAS_ACCESSRULE_H */
Generated by
1.8.4