Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
policydb.h File Reference
#include <linux/flex_array.h>
#include "symtab.h"
#include "avtab.h"
#include "sidtab.h"
#include "ebitmap.h"
#include "mls_types.h"
#include "context.h"
#include "constraint.h"

Go to the source code of this file.

Data Structures

struct  perm_datum
 
struct  common_datum
 
struct  class_datum
 
struct  role_datum
 
struct  role_trans
 
struct  filename_trans
 
struct  filename_trans_datum
 
struct  role_allow
 
struct  type_datum
 
struct  user_datum
 
struct  level_datum
 
struct  cat_datum
 
struct  range_trans
 
struct  cond_bool_datum
 
struct  ocontext
 
struct  genfs
 
struct  policydb
 
struct  policy_file
 
struct  policy_data
 

Macros

#define DEFAULT_SOURCE   1
 
#define DEFAULT_TARGET   2
 
#define DEFAULT_SOURCE_LOW   1
 
#define DEFAULT_SOURCE_HIGH   2
 
#define DEFAULT_SOURCE_LOW_HIGH   3
 
#define DEFAULT_TARGET_LOW   4
 
#define DEFAULT_TARGET_HIGH   5
 
#define DEFAULT_TARGET_LOW_HIGH   6
 
#define SYM_COMMONS   0
 
#define SYM_CLASSES   1
 
#define SYM_ROLES   2
 
#define SYM_TYPES   3
 
#define SYM_USERS   4
 
#define SYM_BOOLS   5
 
#define SYM_LEVELS   6
 
#define SYM_CATS   7
 
#define SYM_NUM   8
 
#define OCON_ISID   0 /* initial SIDs */
 
#define OCON_FS   1 /* unlabeled file systems */
 
#define OCON_PORT   2 /* TCP and UDP port numbers */
 
#define OCON_NETIF   3 /* network interfaces */
 
#define OCON_NODE   4 /* nodes */
 
#define OCON_FSUSE   5 /* fs_use */
 
#define OCON_NODE6   6 /* IPv6 nodes */
 
#define OCON_NUM   7
 
#define p_commons   symtab[SYM_COMMONS]
 
#define p_classes   symtab[SYM_CLASSES]
 
#define p_roles   symtab[SYM_ROLES]
 
#define p_types   symtab[SYM_TYPES]
 
#define p_users   symtab[SYM_USERS]
 
#define p_bools   symtab[SYM_BOOLS]
 
#define p_levels   symtab[SYM_LEVELS]
 
#define p_cats   symtab[SYM_CATS]
 
#define PERM_SYMTAB_SIZE   32
 
#define POLICYDB_CONFIG_MLS   1
 
#define REJECT_UNKNOWN   0x00000002
 
#define ALLOW_UNKNOWN   0x00000004
 
#define OBJECT_R   "object_r"
 
#define OBJECT_R_VAL   1
 
#define POLICYDB_MAGIC   SELINUX_MAGIC
 
#define POLICYDB_STRING   "SE Linux"
 

Functions

void policydb_destroy (struct policydb *p)
 
int policydb_load_isids (struct policydb *p, struct sidtab *s)
 
int policydb_context_isvalid (struct policydb *p, struct context *c)
 
int policydb_class_isvalid (struct policydb *p, unsigned int class)
 
int policydb_type_isvalid (struct policydb *p, unsigned int type)
 
int policydb_role_isvalid (struct policydb *p, unsigned int role)
 
int policydb_read (struct policydb *p, void *fp)
 
int policydb_write (struct policydb *p, void *fp)
 
u16 string_to_security_class (struct policydb *p, const char *name)
 
u32 string_to_av_perm (struct policydb *p, u16 tclass, const char *name)
 

Macro Definition Documentation

#define ALLOW_UNKNOWN   0x00000004

Definition at line 308 of file policydb.h.

#define DEFAULT_SOURCE   1

Definition at line 64 of file policydb.h.

#define DEFAULT_SOURCE_HIGH   2

Definition at line 71 of file policydb.h.

#define DEFAULT_SOURCE_LOW   1

Definition at line 70 of file policydb.h.

#define DEFAULT_SOURCE_LOW_HIGH   3

Definition at line 72 of file policydb.h.

#define DEFAULT_TARGET   2

Definition at line 65 of file policydb.h.

#define DEFAULT_TARGET_HIGH   5

Definition at line 74 of file policydb.h.

#define DEFAULT_TARGET_LOW   4

Definition at line 73 of file policydb.h.

#define DEFAULT_TARGET_LOW_HIGH   6

Definition at line 75 of file policydb.h.

#define OBJECT_R   "object_r"

Definition at line 310 of file policydb.h.

#define OBJECT_R_VAL   1

Definition at line 311 of file policydb.h.

#define OCON_FS   1 /* unlabeled file systems */

Definition at line 208 of file policydb.h.

#define OCON_FSUSE   5 /* fs_use */

Definition at line 212 of file policydb.h.

#define OCON_ISID   0 /* initial SIDs */

Definition at line 207 of file policydb.h.

#define OCON_NETIF   3 /* network interfaces */

Definition at line 210 of file policydb.h.

#define OCON_NODE   4 /* nodes */

Definition at line 211 of file policydb.h.

#define OCON_NODE6   6 /* IPv6 nodes */

Definition at line 213 of file policydb.h.

#define OCON_NUM   7

Definition at line 214 of file policydb.h.

#define OCON_PORT   2 /* TCP and UDP port numbers */

Definition at line 209 of file policydb.h.

#define p_bools   symtab[SYM_BOOLS]

Definition at line 227 of file policydb.h.

#define p_cats   symtab[SYM_CATS]

Definition at line 229 of file policydb.h.

#define p_classes   symtab[SYM_CLASSES]

Definition at line 223 of file policydb.h.

#define p_commons   symtab[SYM_COMMONS]

Definition at line 222 of file policydb.h.

#define p_levels   symtab[SYM_LEVELS]

Definition at line 228 of file policydb.h.

#define p_roles   symtab[SYM_ROLES]

Definition at line 224 of file policydb.h.

#define p_types   symtab[SYM_TYPES]

Definition at line 225 of file policydb.h.

#define p_users   symtab[SYM_USERS]

Definition at line 226 of file policydb.h.

#define PERM_SYMTAB_SIZE   32

Definition at line 302 of file policydb.h.

#define POLICYDB_CONFIG_MLS   1

Definition at line 304 of file policydb.h.

#define POLICYDB_MAGIC   SELINUX_MAGIC

Definition at line 313 of file policydb.h.

#define POLICYDB_STRING   "SE Linux"

Definition at line 314 of file policydb.h.

#define REJECT_UNKNOWN   0x00000002

Definition at line 307 of file policydb.h.

#define SYM_BOOLS   5

Definition at line 201 of file policydb.h.

#define SYM_CATS   7

Definition at line 203 of file policydb.h.

#define SYM_CLASSES   1

Definition at line 197 of file policydb.h.

#define SYM_COMMONS   0

Definition at line 196 of file policydb.h.

#define SYM_LEVELS   6

Definition at line 202 of file policydb.h.

#define SYM_NUM   8

Definition at line 204 of file policydb.h.

#define SYM_ROLES   2

Definition at line 198 of file policydb.h.

#define SYM_TYPES   3

Definition at line 199 of file policydb.h.

#define SYM_USERS   4

Definition at line 200 of file policydb.h.

Function Documentation

int policydb_class_isvalid ( struct policydb p,
unsigned int  class 
)

Definition at line 899 of file policydb.c.

int policydb_context_isvalid ( struct policydb p,
struct context c 
)

Definition at line 924 of file policydb.c.

void policydb_destroy ( struct policydb p)

Definition at line 768 of file policydb.c.

int policydb_load_isids ( struct policydb p,
struct sidtab s 
)

Definition at line 867 of file policydb.c.

int policydb_read ( struct policydb p,
void fp 
)

Definition at line 2215 of file policydb.c.

int policydb_role_isvalid ( struct policydb p,
unsigned int  role 
)

Definition at line 906 of file policydb.c.

int policydb_type_isvalid ( struct policydb p,
unsigned int  type 
)

Definition at line 913 of file policydb.c.

int policydb_write ( struct policydb p,
void fp 
)

Definition at line 3292 of file policydb.c.

u32 string_to_av_perm ( struct policydb p,
u16  tclass,
const char name 
)

Definition at line 1784 of file policydb.c.

u16 string_to_security_class ( struct policydb p,
const char name 
)

Definition at line 1773 of file policydb.c.