diff options
Diffstat (limited to 'tools/flask/utils')
| -rw-r--r-- | tools/flask/utils/Makefile | 15 | ||||
| -rw-r--r-- | tools/flask/utils/get-bool.c | 9 | ||||
| -rw-r--r-- | tools/flask/utils/getenforce.c | 3 | ||||
| -rw-r--r-- | tools/flask/utils/label-pci.c | 17 | ||||
| -rw-r--r-- | tools/flask/utils/loadpolicy.c | 3 | ||||
| -rw-r--r-- | tools/flask/utils/set-bool.c | 5 | ||||
| -rw-r--r-- | tools/flask/utils/setenforce.c | 7 |
7 files changed, 25 insertions, 34 deletions
diff --git a/tools/flask/utils/Makefile b/tools/flask/utils/Makefile index 3ac6ac210a..458f9aad23 100644 --- a/tools/flask/utils/Makefile +++ b/tools/flask/utils/Makefile @@ -1,11 +1,8 @@ XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk -LIBFLASK_ROOT = $(XEN_ROOT)/tools/flask/libflask - CFLAGS += -Wall -g -Werror CFLAGS += $(CFLAGS_libxenctrl) -CFLAGS += -I$(LIBFLASK_ROOT)/include TESTDIR = testsuite/tmp TESTFLAGS= -DTESTING @@ -19,22 +16,22 @@ CLIENTS_OBJS := $(patsubst flask-%,%.o,$(CLIENTS)) all: $(CLIENTS) flask-loadpolicy: loadpolicy.o - $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@ flask-setenforce: setenforce.o - $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@ flask-getenforce: getenforce.o - $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@ flask-label-pci: label-pci.o - $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@ flask-get-bool: get-bool.o - $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@ flask-set-bool: set-bool.o - $(CC) $(LDFLAGS) $< $(LDLIBS) -L$(LIBFLASK_ROOT) -lflask $(LDLIBS_libxenctrl) -o $@ + $(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@ .PHONY: clean clean: diff --git a/tools/flask/utils/get-bool.c b/tools/flask/utils/get-bool.c index c0cd7c870e..7833522f01 100644 --- a/tools/flask/utils/get-bool.c +++ b/tools/flask/utils/get-bool.c @@ -16,7 +16,6 @@ #include <string.h> #include <unistd.h> #include <inttypes.h> -#include <libflask.h> static void usage(char **argv) { @@ -29,11 +28,11 @@ static int all_bools(xc_interface *xch) int err = 0, i = 0, curr, pend; char name[256]; while (1) { - err = flask_getbool_byid(xch, i, name, &curr, &pend); + err = xc_flask_getbool_byid(xch, i, name, sizeof name, &curr, &pend); if (err < 0) { if (errno == ENOENT) return 0; - fprintf(stderr, "flask_getbool: Unable to get boolean #%d: %s (%d)", + fprintf(stderr, "xc_flask_getbool: Unable to get boolean #%d: %s (%d)", i, strerror(errno), err); return 2; } @@ -69,9 +68,9 @@ int main(int argc, char **argv) goto done; } - err = flask_getbool_byname(xch, argv[1], &curr, &pend); + err = xc_flask_getbool_byname(xch, argv[1], &curr, &pend); if (err) { - fprintf(stderr, "flask_getbool: Unable to get boolean %s: %s (%d)", + fprintf(stderr, "xc_flask_getbool: Unable to get boolean %s: %s (%d)", argv[1], strerror(errno), err); err = 2; goto done; diff --git a/tools/flask/utils/getenforce.c b/tools/flask/utils/getenforce.c index 281fc814e6..fedf336906 100644 --- a/tools/flask/utils/getenforce.c +++ b/tools/flask/utils/getenforce.c @@ -16,7 +16,6 @@ #include <sys/stat.h> #include <string.h> #include <unistd.h> -#include <libflask.h> static void usage (int argCnt, const char *args[]) { @@ -41,7 +40,7 @@ int main (int argCnt, const char *args[]) goto done; } - ret = flask_getenforce(xch); + ret = xc_flask_getenforce(xch); if ( ret < 0 ) { errno = -ret; diff --git a/tools/flask/utils/label-pci.c b/tools/flask/utils/label-pci.c index da0cb610f4..9ddb713cf4 100644 --- a/tools/flask/utils/label-pci.c +++ b/tools/flask/utils/label-pci.c @@ -16,7 +16,6 @@ #include <string.h> #include <unistd.h> #include <inttypes.h> -#include <libflask.h> /* Pulled from linux/include/linux/ioport.h */ #define IORESOURCE_TYPE_BITS 0x00001f00 /* Resource type */ @@ -69,9 +68,9 @@ int main (int argCnt, char *argv[]) goto done; } - ret = flask_add_device(xch, sbdf, argv[2]); + ret = xc_flask_add_device(xch, sbdf, argv[2]); if (ret) { - fprintf(stderr, "flask_add_device: Unable to set context of PCI device %s (0x%x) to %s: %d\n", + fprintf(stderr, "xc_flask_add_device: Unable to set context of PCI device %s (0x%x) to %s: %d\n", argv[1], sbdf, argv[2], ret); err = 2; goto done; @@ -80,9 +79,9 @@ int main (int argCnt, char *argv[]) while (fscanf(f, "0x%"SCNx64" 0x%"SCNx64" 0x%"SCNx64"\n", &start, &end, &flags) == 3) { if (flags & IORESOURCE_IO) { // printf("Port %"PRIx64"-%"PRIx64"\n", start, end); - ret = flask_add_ioport(xch, start, end, argv[2]); + ret = xc_flask_add_ioport(xch, start, end, argv[2]); if (ret) { - fprintf(stderr, "flask_add_ioport %"PRIx64"-%"PRIx64" failed: %d\n", + fprintf(stderr, "xc_flask_add_ioport %"PRIx64"-%"PRIx64" failed: %d\n", start, end, ret); err = 2; } @@ -90,9 +89,9 @@ int main (int argCnt, char *argv[]) start >>= 12; end >>= 12; // printf("IOMEM %"PRIx64"-%"PRIx64"\n", start, end); - ret = flask_add_iomem(xch, start, end, argv[2]); + ret = xc_flask_add_iomem(xch, start, end, argv[2]); if (ret) { - fprintf(stderr, "flask_add_iomem %"PRIx64"-%"PRIx64" failed: %d\n", + fprintf(stderr, "xc_flask_add_iomem %"PRIx64"-%"PRIx64" failed: %d\n", start, end, ret); err = 2; } @@ -108,9 +107,9 @@ int main (int argCnt, char *argv[]) if (fscanf(f, "%" SCNu64, &start) != 1) start = 0; if (start) { - ret = flask_add_pirq(xch, start, argv[2]); + ret = xc_flask_add_pirq(xch, start, argv[2]); if (ret) { - fprintf(stderr, "flask_add_pirq %"PRIu64" failed: %d\n", + fprintf(stderr, "xc_flask_add_pirq %"PRIu64" failed: %d\n", start, ret); err = 2; } diff --git a/tools/flask/utils/loadpolicy.c b/tools/flask/utils/loadpolicy.c index 4e99c71e2a..f347b97451 100644 --- a/tools/flask/utils/loadpolicy.c +++ b/tools/flask/utils/loadpolicy.c @@ -17,7 +17,6 @@ #include <sys/stat.h> #include <string.h> #include <unistd.h> -#include <libflask.h> #define USE_MMAP @@ -94,7 +93,7 @@ int main (int argCnt, const char *args[]) } #endif - ret = flask_load(xch, polMemCp, info.st_size); + ret = xc_flask_load(xch, polMemCp, info.st_size); if ( ret < 0 ) { errno = -ret; diff --git a/tools/flask/utils/set-bool.c b/tools/flask/utils/set-bool.c index cde25cdcd6..4b847c5ec8 100644 --- a/tools/flask/utils/set-bool.c +++ b/tools/flask/utils/set-bool.c @@ -16,7 +16,6 @@ #include <string.h> #include <unistd.h> #include <inttypes.h> -#include <libflask.h> static void usage(char **argv) { @@ -56,9 +55,9 @@ int main(int argc, char **argv) goto done; } - err = flask_setbool(xch, argv[1], value, 1); + err = xc_flask_setbool(xch, argv[1], value, 1); if (err) { - fprintf(stderr, "flask_setbool: Unable to set boolean %s=%s: %s (%d)", + fprintf(stderr, "xc_flask_setbool: Unable to set boolean %s=%s: %s (%d)", argv[1], argv[2], strerror(errno), err); err = 2; goto done; diff --git a/tools/flask/utils/setenforce.c b/tools/flask/utils/setenforce.c index 63928bdd3a..0a92d53184 100644 --- a/tools/flask/utils/setenforce.c +++ b/tools/flask/utils/setenforce.c @@ -16,7 +16,6 @@ #include <sys/stat.h> #include <string.h> #include <unistd.h> -#include <libflask.h> static void usage (int argCnt, const char *args[]) { @@ -45,12 +44,12 @@ int main (int argCnt, const char *args[]) if( strlen(args[1]) == 1 && (args[1][0] == '0' || args[1][0] == '1')){ mode = strtol(args[1], &end, 10); - ret = flask_setenforce(xch, mode); + ret = xc_flask_setenforce(xch, mode); } else { if( strcasecmp(args[1], "enforcing") == 0 ){ - ret = flask_setenforce(xch, 1); + ret = xc_flask_setenforce(xch, 1); } else if( strcasecmp(args[1], "permissive") == 0 ){ - ret = flask_setenforce(xch, 0); + ret = xc_flask_setenforce(xch, 0); } else { usage(argCnt, args); } |
