Files
xen/tools/flask/libflask/include/libflask.h
T
Keir Fraser 5cc436c1d2 libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).

Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.

There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.

All libxc callers have been adjusted accordingly.

Also update QEMU_TAG for corresponding qemu change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:30:19 +01:00

55 lines
2.5 KiB
C

/*
*
* Authors: Michael LeMay, <mdlemay@epoch.ncsc.mil>
* George Coker, <gscoker@alpha.ncsc.mil>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*/
#ifndef __LIBFLASK_H__
#define __LIBFLASK_H__
#include <stdint.h>
#include <xen/xen.h>
#include <xen/xsm/flask_op.h>
#include <xenctrl.h>
int flask_load(xc_interface *xc_handle, char *buf, uint32_t size);
int flask_context_to_sid(xc_interface *xc_handle, char *buf, uint32_t size, uint32_t *sid);
int flask_sid_to_context(xc_interface *xc_handle, int sid, char *buf, uint32_t size);
int flask_getenforce(xc_interface *xc_handle);
int flask_setenforce(xc_interface *xc_handle, int mode);
int flask_add_pirq(xc_interface *xc_handle, unsigned int pirq, char *scontext);
int flask_add_ioport(xc_interface *xc_handle, unsigned long low, unsigned long high,
char *scontext);
int flask_add_iomem(xc_interface *xc_handle, unsigned long low, unsigned long high,
char *scontext);
int flask_add_device(xc_interface *xc_handle, unsigned long device, char *scontext);
int flask_del_pirq(xc_interface *xc_handle, unsigned int pirq);
int flask_del_ioport(xc_interface *xc_handle, unsigned long low, unsigned long high);
int flask_del_iomem(xc_interface *xc_handle, unsigned long low, unsigned long high);
int flask_del_device(xc_interface *xc_handle, unsigned long device);
int flask_access(xc_interface *xc_handle, const char *scon, const char *tcon,
u_int16_t tclass, u_int32_t req,
u_int32_t *allowed, u_int32_t *decided,
u_int32_t *auditallow, u_int32_t *auditdeny,
u_int32_t *seqno);
int flask_avc_cachestats(xc_interface *xc_handle, char *buf, int size);
int flask_policyvers(xc_interface *xc_handle, char *buf, int size);
int flask_avc_hashstats(xc_interface *xc_handle, char *buf, int size);
int flask_getavc_threshold(xc_interface *xc_handle);
int flask_setavc_threshold(xc_interface *xc_handle, int threshold);
#define flask_add_single_ioport(x, l, s) flask_add_ioport(x, l, l, s)
#define flask_add_single_iomem(x, l, s) flask_add_iomem(x, l, l, s)
#define flask_del_single_ioport(x, l) flask_del_ioport(x, l, l)
#define flask_del_single_iomem(x, l) flask_del_iomem(x, l, l);
#define OCON_PIRQ_STR "pirq"
#define OCON_IOPORT_STR "ioport"
#define OCON_IOMEM_STR "iomem"
#define OCON_DEVICE_STR "pcidevice"
#define INITCONTEXTLEN 256
#endif /* __LIBFLASK_H__ */