3
* Canonical Ltd. (All rights reserved)
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of version 2 of the GNU General Public
7
* License published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, contact Novell, Inc. or Canonical
18
#ifndef __AA_AF_RULE_H
19
#define __AA_AF_RULE_H
28
enum cond_side { local_cond, peer_cond, either_cond };
30
struct supported_cond {
38
class af_rule: public rule_t {
51
af_rule(const char *name): af_name(name), sock_type(NULL),
52
sock_type_n(-1), proto(NULL), proto_n(0), label(NULL),
53
peer_label(NULL), mode(0), audit(0), deny(0)
64
bool cond_check(struct supported_cond *cond, struct cond_entry *ent,
65
bool peer, const char *rname);
66
int move_base_cond(struct cond_entry *conds, bool peer);
68
virtual bool has_peer_conds(void) { return peer_label ? true : false; }
69
virtual ostream &dump_prefix(ostream &os);
70
virtual ostream &dump_local(ostream &os);
71
virtual ostream &dump_peer(ostream &os);
72
virtual ostream &dump(ostream &os);
73
virtual int expand_variables(void);
74
virtual int gen_policy_re(Profile &prof) = 0;
75
virtual void post_process(Profile &prof unused) { };
78
#endif /* __AA_AF_RULE_H */