mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Add missing rule.[hc] files that should have been part of commit 2449
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
79f80314ed
commit
01b8e1c609
2 changed files with 71 additions and 0 deletions
23
parser/rule.c
Normal file
23
parser/rule.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2014
|
||||
* Canonical Ltd. (All rights reserved)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of version 2 of the GNU General Public
|
||||
* License published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, contact Novell, Inc. or Canonical
|
||||
* Ltd.
|
||||
*/
|
||||
#include "rule.h"
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, rule_t &rule)
|
||||
{
|
||||
return rule.dump(os);
|
||||
};
|
48
parser/rule.h
Normal file
48
parser/rule.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2014
|
||||
* Canonical Ltd. (All rights reserved)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of version 2 of the GNU General Public
|
||||
* License published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, contact Novell, Inc. or Canonical
|
||||
* Ltd.
|
||||
*/
|
||||
#ifndef __AA_RULE_H
|
||||
#define __AA_RULE_H
|
||||
|
||||
#include <list>
|
||||
#include <ostream>
|
||||
|
||||
#include "policydb.h"
|
||||
|
||||
class Profile;
|
||||
|
||||
#define RULE_NOT_SUPPORTED 0
|
||||
#define RULE_ERROR -1
|
||||
#define RULE_OK 1
|
||||
|
||||
class rule_t {
|
||||
public:
|
||||
virtual ~rule_t() { };
|
||||
|
||||
//virtual bool operator<(rule_t const &rhs)const = 0;
|
||||
virtual std::ostream &dump(std::ostream &os) = 0;
|
||||
virtual int expand_variables(void) = 0;
|
||||
virtual int gen_policy_re(Profile &prof) = 0;
|
||||
virtual void post_process(Profile &prof) = 0;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, rule_t &rule);
|
||||
|
||||
typedef std::list<rule_t *> RuleList;
|
||||
|
||||
#endif /* __AA_RULE_H */
|
||||
|
Loading…
Add table
Reference in a new issue