~sbeattie/apparmor/apparmor-precise-proposed

« back to all changes in this revision

Viewing changes to parser/libapparmor_re/chfa.h

  • Committer: Jamie Strandboge
  • Date: 2012-03-02 17:12:15 UTC
  • Revision ID: jamie@canonical.com-20120302171215-rnheljjnhxiv5qwa
Tags: 2.7.99-0ubuntu2
* New upstream release which also pulls in 2.7.0-1 changes from Debian.
  For the sake of simplicity, I have added the 2.7.0-1 changelog entry after
  2.7.0-0ubuntu7 even though chronologically it appeared in Debian between
  2.7.0-0ubuntu4 and 2.7.0-0ubuntu5.
  - LP: #940422 (FFe)
* Drop the following patches, included upstream:
  - 0003-commits-through-r1882.patch
  - 0004-lp887992.patch
  - 0005-lp884748.patch
  - 0006-lp870992.patch
  - 0007-lp860856.patch
  - 0008-lp852062.patch
  - 0009-lp851977.patch
  - 0010-lp890894.patch
  - 0011-lp817956.patch
  - 0012-lp458922.patch
  - 0013-lp769148.patch
  - 0014-lp904548.patch
  - 0015-lp712584.patch
  - 0016-lp562831.patch
  - 0017-lp662906.patch
  - 0018-deny-home-pki-so.patch
  - 0019-lp899963.patch
  - 0020-lp912754a.patch
  - 0021-lp912754b.patch
  - 0022-workaround-lp851986.patch
  - 0023-syslog-ng-needs-dac-read-search.patch
  - 0024-fix-python-and-ruby-autogeneration.patch
  - 0025-lp914184.patch
  - 0026-lp914190.patch
  - 0027-lp914386.patch
  - 0028-testsuite-fixes.patch
  - 0029-lp917628.patch
  - 0030-lp916285.patch
  - 0031-lp917639.patch
  - 0032-lp917641.patch
  - 0033-add-ubuntu-helpers-to-plugins-common.patch
  - 0034-lp917859.patch
  - 0035-kde-should-use-kde4.patch
  - 0036-lp929531.patch
  - 0036-fix-manpage-errors.patch
* Rename 0037-add-aa-easyprof.patch 0003-add-aa-easyprof.patch
* debian/apparmor-profiles.postrm: clean out autogenerated files created by
  apparmor-profiles.postinst (Closes: 656451)
* debian/patches/0004-lp918879.patch: allow /etc/drirc in the X abstraction
  (LP: #918879)
* debian/patches/0005-disable-minimization.patch: do to LP: 940362,
  minimization is not working correctly. Disable it for now.
* debian/po/pt.po add new Portuguese translation, thanks to Pedro Ribeiro,
  (Closes: 651434).
* debian/control: do not require initramfs-tools on !linux-any
  (Closes: 651297).
* debian/{control,rules,debhelper/*}: move dh_apparmor into separate
  binary package, out of debhelper (Closes: 649784).
* debian/{control,rules}: fix up lack of real build-indep.
* debian/patches/0036-fix-manpage-errors.patch: minor man page cleanups.
* merge changes from Ubuntu (r1443).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (C) 2006, 2007 Andreas Gruenbacher <agruen@suse.de>
 
3
 * Copyright (c) 2003-2008 Novell, Inc. (All rights reserved)
 
4
 * Copyright 2009-2012 Canonical Ltd.
 
5
 *
 
6
 * The libapparmor library is licensed under the terms of the GNU
 
7
 * Lesser General Public License, version 2.1. Please see the file
 
8
 * COPYING.LGPL.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 *
 
18
 *
 
19
 * Create a compressed hfa (chfa) from and hfa
 
20
 */
 
21
#ifndef __LIBAA_RE_CHFA_H
 
22
#define __LIBAA_RE_CHFA_H
 
23
 
 
24
#include <map>
 
25
#include <vector>
 
26
 
 
27
#include "hfa.h"
 
28
 
 
29
using namespace std;
 
30
 
 
31
class CHFA {
 
32
        typedef vector<pair<const State *, size_t> > DefaultBase;
 
33
        typedef vector<pair<const State *, const State *> > NextCheck;
 
34
      public:
 
35
        CHFA(DFA &dfa, map<uchar, uchar> &eq, dfaflags_t flags);
 
36
        void dump(ostream & os);
 
37
        void flex_table(ostream &os, const char *name);
 
38
        void init_free_list(vector<pair<size_t, size_t> > &free_list,
 
39
                            size_t prev, size_t start);
 
40
        bool fits_in(vector<pair<size_t, size_t> > &free_list, size_t base,
 
41
                     StateTrans &cases);
 
42
        void insert_state(vector<pair<size_t, size_t> > &free_list,
 
43
                          State *state, DFA &dfa);
 
44
 
 
45
      private:
 
46
        vector<uint32_t> accept;
 
47
        vector<uint32_t> accept2;
 
48
        DefaultBase default_base;
 
49
        NextCheck next_check;
 
50
        map<const State *, size_t> num;
 
51
        map<uchar, uchar> &eq;
 
52
        uchar max_eq;
 
53
        size_t first_free;
 
54
};
 
55
 
 
56
#endif /* __LIBAA_RE_CHFA_H */