3
* Authors: Michael LeMay, <mdlemay@epoch.ncsc.mil>
4
* George Coker, <gscoker@alpha.ncsc.mil>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2,
8
* as published by the Free Software Foundation.
11
#ifndef __LIBFLASK_H__
12
#define __LIBFLASK_H__
16
#include <xen/xsm/flask_op.h>
18
int flask_load(int xc_handle, char *buf, uint32_t size);
19
int flask_context_to_sid(int xc_handle, char *buf, uint32_t size, uint32_t *sid);
20
int flask_sid_to_context(int xc_handle, int sid, char *buf, uint32_t size);
21
int flask_getenforce(int xc_handle);
22
int flask_setenforce(int xc_handle, int mode);
23
int flask_add_pirq(int xc_handle, unsigned int pirq, char *scontext);
24
int flask_add_ioport(int xc_handle, unsigned long low, unsigned long high,
26
int flask_add_iomem(int xc_handle, unsigned long low, unsigned long high,
28
int flask_add_device(int xc_handle, unsigned long device, char *scontext);
29
int flask_del_pirq(int xc_handle, unsigned int pirq);
30
int flask_del_ioport(int xc_handle, unsigned long low, unsigned long high);
31
int flask_del_iomem(int xc_handle, unsigned long low, unsigned long high);
32
int flask_del_device(int xc_handle, unsigned long device);
33
int flask_access(int xc_handle, const char *scon, const char *tcon,
34
u_int16_t tclass, u_int32_t req,
35
u_int32_t *allowed, u_int32_t *decided,
36
u_int32_t *auditallow, u_int32_t *auditdeny,
38
int flask_avc_cachestats(int xc_handle, char *buf, int size);
39
int flask_policyvers(int xc_handle, char *buf, int size);
40
int flask_avc_hashstats(int xc_handle, char *buf, int size);
41
int flask_getavc_threshold(int xc_handle);
42
int flask_setavc_threshold(int xc_handle, int threshold);
43
#define flask_add_single_ioport(x, l, s) flask_add_ioport(x, l, l, s)
44
#define flask_add_single_iomem(x, l, s) flask_add_iomem(x, l, l, s)
45
#define flask_del_single_ioport(x, l) flask_del_ioport(x, l, l)
46
#define flask_del_single_iomem(x, l) flask_del_iomem(x, l, l);
48
#define OCON_PIRQ_STR "pirq"
49
#define OCON_IOPORT_STR "ioport"
50
#define OCON_IOMEM_STR "iomem"
51
#define OCON_DEVICE_STR "pcidevice"
52
#define INITCONTEXTLEN 256
53
#endif /* __LIBFLASK_H__ */