Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
match.c File Reference
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/err.h>
#include <linux/kref.h>
#include "include/apparmor.h"
#include "include/match.h"

Go to the source code of this file.

Functions

void aa_dfa_free_kref (struct kref *kref)
 
struct aa_dfaaa_dfa_unpack (void *blob, size_t size, int flags)
 
unsigned int aa_dfa_match_len (struct aa_dfa *dfa, unsigned int start, const char *str, int len)
 
unsigned int aa_dfa_match (struct aa_dfa *dfa, unsigned int start, const char *str)
 
unsigned int aa_dfa_next (struct aa_dfa *dfa, unsigned int state, const char c)
 

Function Documentation

void aa_dfa_free_kref ( struct kref kref)

aa_dfa_free_kref - free aa_dfa by kref (called by aa_put_dfa) : kref callback for freeing of a dfa (NOT NULL)

Definition at line 184 of file match.c.

unsigned int aa_dfa_match ( struct aa_dfa dfa,
unsigned int  start,
const char str 
)

aa_dfa_match - traverse to find state stops at : the dfa to match against (NOT NULL) : the state of the dfa to start matching in : the null terminated string of bytes to match against the dfa (NOT NULL)

aa_dfa_match will match against the dfa and return the state it finished matching in. The final state can be used to look up the accepting label, or as the start state of a continuing match.

Returns: final state reached after input is consumed

Definition at line 349 of file match.c.

unsigned int aa_dfa_match_len ( struct aa_dfa dfa,
unsigned int  start,
const char str,
int  len 
)

aa_dfa_match_len - traverse to find state stops at : the dfa to match against (NOT NULL) : the state of the dfa to start matching in : the string of bytes to match against the dfa (NOT NULL) : length of the string of bytes to match

aa_dfa_match_len will match against the dfa and return the state it finished matching in. The final state can be used to look up the accepting label, or as the start state of a continuing match.

This function will happily match again the 0 byte and only finishes when input is consumed.

Returns: final state reached after input is consumed

Definition at line 299 of file match.c.

unsigned int aa_dfa_next ( struct aa_dfa dfa,
unsigned int  state,
const char  c 
)

aa_dfa_next - step one character to the next state in the dfa : the dfa to tranverse (NOT NULL) : the state to start in : the input character to transition on

aa_dfa_match will step through the dfa by one input character

Returns: state reach after input

Definition at line 397 of file match.c.

struct aa_dfa* aa_dfa_unpack ( void blob,
size_t  size,
int  flags 
)
read

aa_dfa_unpack - unpack the binary tables of a serialized dfa : aligned serialized stream of data to unpack (NOT NULL) : size of data to unpack : flags controlling what type of accept tables are acceptable

Unpack a dfa that has been serialized. To find information on the dfa format look in Documentation/security/apparmor.txt Assumes the dfa stream has been aligned on a 8 byte boundary

Returns: an unpacked dfa ready for matching or ERR_PTR on failure

Definition at line 202 of file match.c.