summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am6
-rw-r--r--test/Makefile.in487
-rw-r--r--test/bsm/Makefile.am9
-rw-r--r--test/bsm/Makefile.in463
-rw-r--r--test/bsm/generate.c1021
-rw-r--r--test/reference/arg32_recordbin0 -> 50 bytes
-rw-r--r--test/reference/arg32_tokenbin0 -> 25 bytes
-rw-r--r--test/reference/data_recordbin0 -> 39 bytes
-rw-r--r--test/reference/data_tokenbin0 -> 14 bytes
-rw-r--r--test/reference/file_recordbin0 -> 41 bytes
-rw-r--r--test/reference/file_tokenbin0 -> 16 bytes
-rw-r--r--test/reference/header32_tokenbin0 -> 18 bytes
-rw-r--r--test/reference/in_addr_recordbin0 -> 30 bytes
-rw-r--r--test/reference/in_addr_token1
-rw-r--r--test/reference/ip_recordbin0 -> 46 bytes
-rw-r--r--test/reference/ip_tokenbin0 -> 21 bytes
-rw-r--r--test/reference/ipc_recordbin0 -> 31 bytes
-rw-r--r--test/reference/ipc_token1
-rw-r--r--test/reference/iport_recordbin0 -> 28 bytes
-rw-r--r--test/reference/iport_tokenbin0 -> 3 bytes
-rw-r--r--test/reference/opaque_recordbin0 -> 32 bytes
-rw-r--r--test/reference/opaque_tokenbin0 -> 7 bytes
-rw-r--r--test/reference/path_recordbin0 -> 49 bytes
-rw-r--r--test/reference/path_tokenbin0 -> 24 bytes
-rw-r--r--test/reference/process32_recordbin0 -> 62 bytes
-rw-r--r--test/reference/process32_tokenbin0 -> 37 bytes
-rw-r--r--test/reference/process32ex_recordbin0 -> 66 bytes
-rw-r--r--test/reference/process32ex_record-IPv4bin0 -> 66 bytes
-rw-r--r--test/reference/process32ex_record-IPv6bin0 -> 78 bytes
-rw-r--r--test/reference/process32ex_tokenbin0 -> 41 bytes
-rw-r--r--test/reference/process32ex_token-IPv4bin0 -> 41 bytes
-rw-r--r--test/reference/process32ex_token-IPv6bin0 -> 53 bytes
-rw-r--r--test/reference/process64_recordbin0 -> 66 bytes
-rw-r--r--test/reference/process64_tokenbin0 -> 41 bytes
-rw-r--r--test/reference/process64ex_record-IPv4bin0 -> 70 bytes
-rw-r--r--test/reference/process64ex_record-IPv6bin0 -> 82 bytes
-rw-r--r--test/reference/process64ex_token-IPv4bin0 -> 45 bytes
-rw-r--r--test/reference/process64ex_token-IPv6bin0 -> 57 bytes
-rw-r--r--test/reference/return32_recordbin0 -> 31 bytes
-rw-r--r--test/reference/return32_token1
-rw-r--r--test/reference/seq_recordbin0 -> 30 bytes
-rw-r--r--test/reference/seq_token1
-rw-r--r--test/reference/subject32_recordbin0 -> 62 bytes
-rw-r--r--test/reference/subject32_tokenbin0 -> 37 bytes
-rw-r--r--test/reference/subject32ex_recordbin0 -> 78 bytes
-rw-r--r--test/reference/subject32ex_token-IPv4bin0 -> 41 bytes
-rw-r--r--test/reference/subject32ex_token-IPv6bin0 -> 53 bytes
-rw-r--r--test/reference/text_recordbin0 -> 44 bytes
-rw-r--r--test/reference/text_tokenbin0 -> 19 bytes
-rw-r--r--test/reference/trailer_token1
-rw-r--r--test/reference/zonename_recordbin0 -> 37 bytes
-rw-r--r--test/reference/zonename_tokenbin0 -> 12 bytes
-rw-r--r--test/samples/execve-long-args.trailbin0 -> 714 bytes
53 files changed, 1991 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..e52150c
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,6 @@
+#
+# $P4: //depot/projects/trustedbsd/openbsm/test/Makefile.am#1 $
+#
+
+SUBDIRS = \
+ bsm
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 0000000..f2bfda4
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,487 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# $P4: //depot/projects/trustedbsd/openbsm/test/Makefile.in#2 $
+#
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = \
+ bsm
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/bsm/Makefile.am b/test/bsm/Makefile.am
new file mode 100644
index 0000000..8aa7934
--- /dev/null
+++ b/test/bsm/Makefile.am
@@ -0,0 +1,9 @@
+#
+# $P4: //depot/projects/trustedbsd/openbsm/test/bsm/Makefile.am#1 $
+#
+
+INCLUDES = -I$(top_srcdir)
+
+bin_PROGRAMS = generate
+generate_SOURCES = generate.c
+generate_LDADD = $(top_builddir)/libbsm/libbsm.la
diff --git a/test/bsm/Makefile.in b/test/bsm/Makefile.in
new file mode 100644
index 0000000..a77196e
--- /dev/null
+++ b/test/bsm/Makefile.in
@@ -0,0 +1,463 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# $P4: //depot/projects/trustedbsd/openbsm/test/bsm/Makefile.in#2 $
+#
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = generate$(EXEEXT)
+subdir = test/bsm
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_generate_OBJECTS = generate.$(OBJEXT)
+generate_OBJECTS = $(am_generate_OBJECTS)
+generate_DEPENDENCIES = $(top_builddir)/libbsm/libbsm.la
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(generate_SOURCES)
+DIST_SOURCES = $(generate_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = -I$(top_srcdir)
+generate_SOURCES = generate.c
+generate_LDADD = $(top_builddir)/libbsm/libbsm.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/bsm/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/bsm/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+generate$(EXEEXT): $(generate_OBJECTS) $(generate_DEPENDENCIES)
+ @rm -f generate$(EXEEXT)
+ $(LINK) $(generate_OBJECTS) $(generate_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/bsm/generate.c b/test/bsm/generate.c
new file mode 100644
index 0000000..d066246
--- /dev/null
+++ b/test/bsm/generate.c
@@ -0,0 +1,1021 @@
+/*-
+ * Copyright (c) 2006-2007 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $P4: //depot/projects/trustedbsd/openbsm/test/bsm/generate.c#9 $
+ */
+
+/*
+ * Generate a series of BSM token samples in the requested directory.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+
+#include <arpa/inet.h>
+
+#include <bsm/audit_kevents.h>
+#include <bsm/libbsm.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+static int do_records, do_tokens;
+
+static void
+usage(void)
+{
+
+ fprintf(stderr, "generate [-rt] path\n");
+ exit(EX_USAGE);
+}
+
+static int
+open_file(const char *directory, const char *name)
+{
+ char pathname[PATH_MAX];
+ int fd;
+
+ snprintf(pathname, PATH_MAX, "%s/%s", directory, name);
+ (void)unlink(pathname);
+ fd = open(pathname, O_WRONLY | O_CREAT | O_EXCL, 0600);
+ if (fd < 0)
+ err(EX_CANTCREAT, "open: %s", name);
+ return (fd);
+}
+
+static void
+write_file(int fd, void *buffer, size_t buflen, const char *filename)
+{
+ ssize_t len;
+
+ len = write(fd, buffer, buflen);
+ if (len < 0)
+ err(EX_OSERR, "write_file: %s", filename);
+ if (len < buflen)
+ err(EX_OSERR, "write_file: short write: %s", filename);
+}
+
+/*
+ * Write a single token to a file.
+ */
+static void
+write_token(const char *directory, const char *filename, token_t *tok)
+{
+ u_char buffer[MAX_AUDIT_RECORD_SIZE];
+ size_t buflen;
+ int fd;
+
+ buflen = MAX_AUDIT_RECORD_SIZE;
+ if (au_close_token(tok, buffer, &buflen) < 0)
+ err(EX_UNAVAILABLE, "au_close_token");
+ fd = open_file(directory, filename);
+ write_file(fd, buffer, buflen, filename);
+ close(fd);
+}
+
+/*
+ * Write a token to a file, wrapped in audit record header and trailer.
+ */
+static void
+write_record(const char *directory, const char *filename, token_t *tok,
+ short event)
+{
+ u_char buffer[MAX_AUDIT_RECORD_SIZE];
+ size_t buflen;
+ int au, fd;
+
+ au = au_open();
+ if (au < 0)
+ err(EX_UNAVAILABLE, "au_open");
+ if (au_write(au, tok) < 0)
+ err(EX_UNAVAILABLE, "au_write");
+ buflen = MAX_AUDIT_RECORD_SIZE;
+ if (au_close_buffer(au, event, buffer, &buflen) < 0)
+ err(EX_UNAVAILABLE, "au_close_buffer");
+ fd = open_file(directory, filename);
+ write_file(fd, buffer, buflen, filename);
+ close(fd);
+}
+
+static struct timeval file_token_timeval = { 0x12345, 0x67890} ;
+
+static void
+generate_file_token(const char *directory, const char *token_filename)
+{
+ token_t *file_token;
+
+ file_token = au_to_file("test", file_token_timeval);
+ if (file_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_file");
+ write_token(directory, token_filename, file_token);
+}
+
+static void
+generate_file_record(const char *directory, const char *record_filename)
+{
+ token_t *file_token;
+
+ file_token = au_to_file("test", file_token_timeval);
+ if (file_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_file");
+ write_record(directory, record_filename, file_token, AUE_NULL);
+}
+
+/*
+ * AUT_OHEADER
+ */
+
+static int trailer_token_len = 0x12345678;
+
+static void
+generate_trailer_token(const char *directory, const char *token_filename)
+{
+ token_t *trailer_token;
+
+ trailer_token = au_to_trailer(trailer_token_len);
+ if (trailer_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_trailer");
+ write_token(directory, token_filename, trailer_token);
+}
+
+static int header32_token_len = 0x12345678;
+static au_event_t header32_e_type = AUE_OPEN;
+static au_emod_t header32_e_mod = 0x4567;
+static struct timeval header32_tm = { 0x12345, 0x67890 };
+
+static void
+generate_header32_token(const char *directory, const char *token_filename)
+{
+ token_t *header32_token;
+
+ header32_token = au_to_header32_tm(header32_token_len,
+ header32_e_type, header32_e_mod, header32_tm);
+ if (header32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_header32");
+ write_token(directory, token_filename, header32_token);
+}
+
+/*
+ * AUT_HEADER32_EX
+ */
+
+static char data_token_unit_print = AUP_STRING;
+static char data_token_unit_type = AUR_CHAR;
+static char *data_token_data = "SomeData";
+static char data_token_unit_count = sizeof("SomeData") + 1;
+
+static void
+generate_data_token(const char *directory, const char *token_filename)
+{
+ token_t *data_token;
+
+ data_token = au_to_data(data_token_unit_print, data_token_unit_type,
+ data_token_unit_count, data_token_data);
+ if (data_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_data");
+ write_token(directory, token_filename, data_token);
+}
+
+static void
+generate_data_record(const char *directory, const char *record_filename)
+{
+ token_t *data_token;
+
+ data_token = au_to_data(data_token_unit_print, data_token_unit_type,
+ data_token_unit_count, data_token_data);
+ if (data_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_data");
+ write_record(directory, record_filename, data_token, AUE_NULL);
+}
+
+static char ipc_type = AT_IPC_MSG;
+static int ipc_id = 0x12345678;
+
+static void
+generate_ipc_token(const char *directory, const char *token_filename)
+{
+ token_t *ipc_token;
+
+ ipc_token = au_to_ipc(ipc_type, ipc_id);
+ if (ipc_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_ipc");
+ write_token(directory, token_filename, ipc_token);
+}
+
+static void
+generate_ipc_record(const char *directory, const char *record_filename)
+{
+ token_t *ipc_token;
+
+ ipc_token = au_to_ipc(ipc_type, ipc_id);
+ if (ipc_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_ipc");
+ write_record(directory, record_filename, ipc_token, AUE_NULL);
+}
+
+static char *path_token_path = "/test/this/is/a/test";
+
+static void
+generate_path_token(const char *directory, const char *token_filename)
+{
+ token_t *path_token;
+
+ path_token = au_to_path(path_token_path);
+ if (path_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_path");
+ write_token(directory, token_filename, path_token);
+}
+
+static void
+generate_path_record(const char *directory, const char *record_filename)
+{
+ token_t *path_token;
+
+ path_token = au_to_path(path_token_path);
+ if (path_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_path");
+ write_record(directory, record_filename, path_token, AUE_NULL);
+}
+
+static au_id_t subject32_auid = 0x12345678;
+static uid_t subject32_euid = 0x01234567;
+static gid_t subject32_egid = 0x23456789;
+static uid_t subject32_ruid = 0x98765432;
+static gid_t subject32_rgid = 0x09876543;
+static pid_t subject32_pid = 0x13243546;
+static au_asid_t subject32_sid = 0x97867564;
+static au_tid_t subject32_tid = { 0x16593746 };
+static au_tid_addr_t subject32_tid_addr = { 0x16593746 };
+
+static void
+generate_subject32_token(const char *directory, const char *token_filename)
+{
+ token_t *subject32_token;
+
+ subject32_tid.machine = inet_addr("127.0.0.1");
+
+ subject32_token = au_to_subject32(subject32_auid, subject32_euid,
+ subject32_egid, subject32_ruid, subject32_rgid, subject32_pid,
+ subject32_sid, &subject32_tid);
+ if (subject32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_subject32");
+ write_token(directory, token_filename, subject32_token);
+}
+
+static void
+generate_subject32_record(const char *directory, const char *record_filename)
+{
+ token_t *subject32_token;
+
+ subject32_tid.machine = inet_addr("127.0.0.1");
+
+ subject32_token = au_to_subject32(subject32_auid, subject32_euid,
+ subject32_egid, subject32_ruid, subject32_rgid, subject32_pid,
+ subject32_sid, &subject32_tid);
+ if (subject32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_subject32");
+ write_record(directory, record_filename, subject32_token, AUE_NULL);
+}
+
+static void
+generate_subject32ex_token(const char *directory, const char *token_filename,
+ u_int32_t type)
+{
+ token_t *subject32ex_token;
+ char *buf;
+
+ buf = (char *)malloc(strlen(token_filename) + 6);
+ if (type == AU_IPv6) {
+ inet_pton(AF_INET6, "fe80::1", subject32_tid_addr.at_addr);
+ subject32_tid_addr.at_type = AU_IPv6;
+ sprintf(buf, "%s%s", token_filename, "-IPv6");
+ } else {
+ subject32_tid_addr.at_addr[0] = inet_addr("127.0.0.1");
+ subject32_tid_addr.at_type = AU_IPv4;
+ sprintf(buf, "%s%s", token_filename, "-IPv4");
+ }
+
+ subject32ex_token = au_to_subject32_ex(subject32_auid, subject32_euid,
+ subject32_egid, subject32_ruid, subject32_rgid, subject32_pid,
+ subject32_sid, &subject32_tid_addr);
+ if (subject32ex_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_subject32_ex");
+ write_token(directory, buf, subject32ex_token);
+ free(buf);
+}
+
+static void
+generate_subject32ex_record(const char *directory, const char *record_filename,
+ u_int32_t type)
+{
+ token_t *subject32ex_token;
+ char *buf;
+
+ buf = (char *)malloc(strlen(record_filename) + 6);
+ if (type == AU_IPv6) {
+ inet_pton(AF_INET6, "fe80::1", subject32_tid_addr.at_addr);
+ subject32_tid_addr.at_type = AU_IPv6;
+ sprintf(buf, "%s%s", record_filename, "-IPv6");
+ } else {
+ subject32_tid_addr.at_addr[0] = inet_addr("127.0.0.1");
+ subject32_tid_addr.at_type = AU_IPv4;
+ sprintf(buf, "%s%s", record_filename, "-IPv4");
+ }
+
+ subject32ex_token = au_to_subject32_ex(subject32_auid, subject32_euid,
+ subject32_egid, subject32_ruid, subject32_rgid, subject32_pid,
+ subject32_sid, &subject32_tid_addr);
+ if (subject32ex_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_subject32_ex");
+ write_record(directory, record_filename, subject32ex_token, AUE_NULL);
+ free(buf);
+}
+
+static au_id_t process32_auid = 0x12345678;
+static uid_t process32_euid = 0x01234567;
+static gid_t process32_egid = 0x23456789;
+static uid_t process32_ruid = 0x98765432;
+static gid_t process32_rgid = 0x09876543;
+static pid_t process32_pid = 0x13243546;
+static au_asid_t process32_sid = 0x97867564;
+static au_tid_t process32_tid = { 0x16593746 };
+static au_tid_addr_t process32_tid_addr = { 0x16593746 };
+
+static void
+generate_process32_token(const char *directory, const char *token_filename)
+{
+ token_t *process32_token;
+
+ process32_tid.machine = inet_addr("127.0.0.1");
+
+ process32_token = au_to_process32(process32_auid, process32_euid,
+ process32_egid, process32_ruid, process32_rgid, process32_pid,
+ process32_sid, &process32_tid);
+ if (process32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_process32");
+ write_token(directory, token_filename, process32_token);
+}
+
+static void
+generate_process32_record(const char *directory, const char *record_filename)
+{
+ token_t *process32_token;
+
+ process32_tid.machine = inet_addr("127.0.0.1");
+
+ process32_token = au_to_process32(process32_auid, process32_euid,
+ process32_egid, process32_ruid, process32_rgid, process32_pid,
+ process32_sid, &process32_tid);
+ if (process32_token == NULL)
+ err(EX_UNAVAILABLE, "au_ti_process32");
+ write_record(directory, record_filename, process32_token, AUE_NULL);
+}
+
+static void
+generate_process32ex_token(const char *directory, const char *token_filename,
+ u_int32_t type)
+{
+ token_t *process32ex_token;
+ char *buf;
+
+ buf = (char *)malloc(strlen(token_filename) + 6);
+ if (type == AU_IPv6) {
+ inet_pton(AF_INET6, "fe80::1", process32_tid_addr.at_addr);
+ process32_tid_addr.at_type = AU_IPv6;
+ sprintf(buf, "%s%s", token_filename, "-IPv6");
+ } else {
+ process32_tid_addr.at_addr[0] = inet_addr("127.0.0.1");
+ process32_tid_addr.at_type = AU_IPv4;
+ sprintf(buf, "%s%s", token_filename, "-IPv4");
+ }
+
+ process32ex_token = au_to_process32_ex(process32_auid, process32_euid,
+ process32_egid, process32_ruid, process32_rgid, process32_pid,
+ process32_sid, &process32_tid_addr);
+ if (process32ex_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_process32_ex");
+ write_token(directory, buf, process32ex_token);
+ free(buf);
+}
+
+static void
+generate_process32ex_record(const char *directory, const char *record_filename,
+ u_int32_t type)
+{
+ token_t *process32ex_token;
+ char *buf;
+
+ buf = (char *)malloc(strlen(record_filename) + 6);
+ if (type == AU_IPv6) {
+ inet_pton(AF_INET6, "fe80::1", process32_tid_addr.at_addr);
+ process32_tid_addr.at_type = AU_IPv6;
+ sprintf(buf, "%s%s", record_filename, "-IPv6");
+ } else {
+ process32_tid_addr.at_addr[0] = inet_addr("127.0.0.1");
+ process32_tid_addr.at_type = AU_IPv4;
+ sprintf(buf, "%s%s", record_filename, "-IPv4");
+ }
+
+ process32ex_token = au_to_process32_ex(process32_auid, process32_euid,
+ process32_egid, process32_ruid, process32_rgid, process32_pid,
+ process32_sid, &process32_tid_addr);
+ if (process32ex_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_process32_ex");
+ write_record(directory, buf, process32ex_token, AUE_NULL);
+ free(buf);
+}
+
+static au_id_t process64_auid = 0x12345678;
+static uid_t process64_euid = 0x01234567;
+static gid_t process64_egid = 0x23456789;
+static uid_t process64_ruid = 0x98765432;
+static gid_t process64_rgid = 0x09876543;
+static pid_t process64_pid = 0x13243546;
+static au_asid_t process64_sid = 0x97867564;
+static au_tid_t process64_tid = { 0x16593746 };
+static au_tid_addr_t process64_tid_addr = { 0x16593746 };
+
+static void
+generate_process64_token(const char *directory, const char *token_filename)
+{
+ token_t *process64_token;
+
+ process64_tid.machine = inet_addr("127.0.0.1");
+
+ process64_token = au_to_process64(process64_auid, process64_euid,
+ process64_egid, process64_ruid, process64_rgid, process64_pid,
+ process64_sid, &process64_tid);
+ if (process64_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_process64");
+ write_token(directory, token_filename, process64_token);
+}
+
+static void
+generate_process64_record(const char *directory, const char *record_filename)
+{
+ token_t *process64_token;
+
+ process64_tid.machine = inet_addr("127.0.0.1");
+
+ process64_token = au_to_process64(process64_auid, process64_euid,
+ process64_egid, process64_ruid, process64_rgid, process64_pid,
+ process64_sid, &process64_tid);
+ if (process64_token == NULL)
+ err(EX_UNAVAILABLE, "au_ti_process64");
+ write_record(directory, record_filename, process64_token, AUE_NULL);
+}
+
+static void
+generate_process64ex_token(const char *directory, const char *token_filename,
+ u_int32_t type)
+{
+ token_t *process64ex_token;
+ char *buf;
+
+ buf = (char *)malloc(strlen(token_filename) + 6);
+ if (type == AU_IPv6) {
+ inet_pton(AF_INET6, "fe80::1", process64_tid_addr.at_addr);
+ process64_tid_addr.at_type = AU_IPv6;
+ sprintf(buf, "%s%s", token_filename, "-IPv6");
+ } else {
+ process64_tid_addr.at_addr[0] = inet_addr("127.0.0.1");
+ process64_tid_addr.at_type = AU_IPv4;
+ sprintf(buf, "%s%s", token_filename, "-IPv4");
+ }
+
+ process64ex_token = au_to_process64_ex(process64_auid, process64_euid,
+ process64_egid, process64_ruid, process64_rgid, process64_pid,
+ process64_sid, &process64_tid_addr);
+ if (process64ex_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_process64_ex");
+ write_token(directory, buf, process64ex_token);
+ free(buf);
+}
+
+static void
+generate_process64ex_record(const char *directory, const char *record_filename,
+ u_int32_t type)
+{
+ token_t *process64ex_token;
+ char *buf;
+
+ buf = (char *)malloc(strlen(record_filename) + 6);
+ if (type == AU_IPv6) {
+ inet_pton(AF_INET6, "fe80::1", process64_tid_addr.at_addr);
+ process64_tid_addr.at_type = AU_IPv6;
+ sprintf(buf, "%s%s", record_filename, "-IPv6");
+ } else {
+ process64_tid_addr.at_addr[0] = inet_addr("127.0.0.1");
+ process64_tid_addr.at_type = AU_IPv4;
+ sprintf(buf, "%s%s", record_filename, "-IPv4");
+ }
+
+ process64ex_token = au_to_process64_ex(process64_auid, process64_euid,
+ process64_egid, process64_ruid, process64_rgid, process64_pid,
+ process64_sid, &process64_tid_addr);
+ if (process64ex_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_process64_ex");
+ write_record(directory, buf, process64ex_token, AUE_NULL);
+ free(buf);
+}
+
+static char return32_status = 0xd7;
+static uint32_t return32_ret = 0x12345678;
+
+static void
+generate_return32_token(const char *directory, const char *token_filename)
+{
+ token_t *return32_token;
+
+ return32_token = au_to_return32(return32_status, return32_ret);
+ if (return32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_return32");
+ write_token(directory, token_filename, return32_token);
+}
+
+static void
+generate_return32_record(const char *directory, const char *record_filename)
+{
+ token_t *return32_token;
+
+ return32_token = au_to_return32(return32_status, return32_ret);
+ if (return32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_return32");
+ write_record(directory, record_filename, return32_token, AUE_NULL);
+}
+
+static char *text_token_text = "This is a test.";
+
+static void
+generate_text_token(const char *directory, const char *token_filename)
+{
+ token_t *text_token;
+
+ text_token = au_to_text(text_token_text);
+ if (text_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_text");
+ write_token(directory, token_filename, text_token);
+}
+
+static void
+generate_text_record(const char *directory, const char *record_filename)
+{
+ token_t *text_token;
+
+ text_token = au_to_text(text_token_text);
+ if (text_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_text");
+ write_record(directory, record_filename, text_token, AUE_NULL);
+}
+
+static char opaque_token_data[] = {0xaa, 0xbb, 0xcc, 0xdd};
+static int opaque_token_bytes = sizeof(opaque_token_data);
+
+static void
+generate_opaque_token(const char *directory, const char *token_filename)
+{
+ token_t *opaque_token;
+
+ opaque_token = au_to_opaque(opaque_token_data, opaque_token_bytes);
+ if (opaque_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_opaque");
+ write_token(directory, token_filename, opaque_token);
+}
+
+static void
+generate_opaque_record(const char *directory, const char *record_filename)
+{
+ token_t *opaque_token;
+
+ opaque_token = au_to_opaque(opaque_token_data, opaque_token_bytes);
+ if (opaque_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_opaque");
+ write_record(directory, record_filename, opaque_token, AUE_NULL);
+}
+
+static struct in_addr in_addr_token_addr;
+
+static void
+generate_in_addr_token(const char *directory, const char *token_filename)
+{
+ token_t *in_addr_token;
+
+ in_addr_token_addr.s_addr = inet_addr("192.168.100.15");
+
+ in_addr_token = au_to_in_addr(&in_addr_token_addr);
+ if (in_addr_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_in_addr");
+ write_token(directory, token_filename, in_addr_token);
+}
+
+static void
+generate_in_addr_record(const char *directory, const char *record_filename)
+{
+ token_t *in_addr_token;
+
+ in_addr_token_addr.s_addr = inet_addr("192.168.100.15");
+
+ in_addr_token = au_to_in_addr(&in_addr_token_addr);
+ if (in_addr_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_in_addr");
+ write_record(directory, record_filename, in_addr_token, AUE_NULL);
+}
+
+static struct ip ip_token_ip;
+static u_char ip_token_ip_v = 4;
+static uint16_t ip_token_ip_id = 0x5478;
+static u_char ip_token_ip_ttl = 64;
+static u_char ip_token_ip_p = IPPROTO_ICMP;
+static struct in_addr ip_token_ip_src;
+static struct in_addr ip_token_ip_dst;
+
+static void
+generate_ip_token(const char *directory, const char *token_filename)
+{
+ token_t *ip_token;
+
+ ip_token_ip_src.s_addr = inet_addr("192.168.100.155");
+ ip_token_ip_dst.s_addr = inet_addr("192.168.110.48");
+
+ memset(&ip_token_ip, 0, sizeof(ip_token_ip));
+ ip_token_ip.ip_v = ip_token_ip_v;
+ ip_token_ip.ip_len = htons(sizeof(ip_token_ip));
+ ip_token_ip.ip_id = htons(ip_token_ip_id);
+ ip_token_ip.ip_ttl = ip_token_ip_ttl;
+ ip_token_ip.ip_p = ip_token_ip_p;
+ ip_token_ip.ip_src = ip_token_ip_src;
+ ip_token_ip.ip_dst = ip_token_ip_dst;
+
+ ip_token = au_to_ip(&ip_token_ip);
+ if (ip_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_ip");
+ write_token(directory, token_filename, ip_token);
+}
+
+static void
+generate_ip_record(const char *directory, const char *record_filename)
+{
+ token_t *ip_token;
+
+ ip_token_ip_src.s_addr = inet_addr("192.168.100.155");
+ ip_token_ip_dst.s_addr = inet_addr("192.168.110.48");
+
+ memset(&ip_token_ip, 0, sizeof(ip_token_ip));
+ ip_token_ip.ip_v = ip_token_ip_v;
+ ip_token_ip.ip_len = htons(sizeof(ip_token_ip));
+ ip_token_ip.ip_id = htons(ip_token_ip_id);
+ ip_token_ip.ip_ttl = ip_token_ip_ttl;
+ ip_token_ip.ip_p = ip_token_ip_p;
+ ip_token_ip.ip_src = ip_token_ip_src;
+ ip_token_ip.ip_dst = ip_token_ip_dst;
+
+ ip_token = au_to_ip(&ip_token_ip);
+ if (ip_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_ip");
+ write_record(directory, record_filename, ip_token, AUE_NULL);
+}
+
+static u_int16_t iport_token_iport;
+
+static void
+generate_iport_token(const char *directory, const char *token_filename)
+{
+ token_t *iport_token;
+
+ iport_token_iport = htons(80);
+
+ iport_token = au_to_iport(iport_token_iport);
+ if (iport_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_iport");
+ write_token(directory, token_filename, iport_token);
+}
+
+static void
+generate_iport_record(const char *directory, const char *record_filename)
+{
+ token_t *iport_token;
+
+ iport_token_iport = htons(80);
+
+ iport_token = au_to_iport(iport_token_iport);
+ if (iport_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_iport");
+ write_record(directory, record_filename, iport_token, AUE_NULL);
+}
+
+static char arg32_token_n = 3;
+static char *arg32_token_text = "test_arg32_token";
+static uint32_t arg32_token_v = 0xabcdef00;
+
+static void
+generate_arg32_token(const char *directory, const char *token_filename)
+{
+ token_t *arg32_token;
+
+ arg32_token = au_to_arg32(arg32_token_n, arg32_token_text,
+ arg32_token_v);
+ if (arg32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_arg32");
+ write_token(directory, token_filename, arg32_token);
+}
+
+static void
+generate_arg32_record(const char *directory, const char *record_filename)
+{
+ token_t *arg32_token;
+
+ arg32_token = au_to_arg32(arg32_token_n, arg32_token_text,
+ arg32_token_v);
+ if (arg32_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_arg32");
+ write_record(directory, record_filename, arg32_token, AUE_NULL);
+}
+
+static long seq_audit_count = 0x12345678;
+
+static void
+generate_seq_token(const char *directory, const char *token_filename)
+{
+ token_t *seq_token;
+
+ seq_token = au_to_seq(seq_audit_count);
+ if (seq_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_seq");
+ write_token(directory, token_filename, seq_token);
+}
+
+static void
+generate_seq_record(const char *directory, const char *record_filename)
+{
+ token_t *seq_token;
+
+ seq_token = au_to_seq(seq_audit_count);
+ if (seq_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_seq");
+ write_record(directory, record_filename, seq_token, AUE_NULL);
+}
+
+/*
+ * AUT_ACL
+ */
+
+static void
+generate_attr_token(const char *directory, const char *token_filename)
+{
+ token_t *attr_token;
+
+}
+
+static void
+generate_attr_record(const char *directory, const char *record_filename)
+{
+ token_t *attr_token;
+
+}
+
+static void
+generate_ipc_perm_token(const char *directory, const char *token_filename)
+{
+ token_t *ipc_perm_token;
+
+}
+
+static void
+generate_ipc_perm_record(const char *directory, const char *record_filename)
+{
+ token_t *ipc_perm_token;
+
+}
+
+/*
+ * AUT_LABEL
+ */
+
+static void
+generate_groups_token(const char *directory, const char *token_filename)
+{
+ token_t *groups_token;
+
+}
+
+static void
+generate_groups_record(const char *directory, const char *record_filename)
+{
+ token_t *groups_token;
+
+}
+
+/*
+ * AUT_ILABEL
+ */
+
+/*
+ * AUT_SLABEL
+ */
+
+/*
+ * AUT_CLEAR
+ */
+
+/*
+ * AUT_PRIV
+ */
+
+/*
+ * AUT_UPRIV
+ */
+
+/*
+ * AUT_LIAISON
+ */
+
+/*
+ * AUT_NEWGROUPS
+ */
+
+/*
+ * AUT_EXEC_ARGS
+ */
+
+/*
+ * AUT_EXEC_ENV
+ */
+
+static void
+generate_attr32_token(const char *directory, const char *token_filename)
+{
+ token_t *attr32_token;
+
+}
+
+static void
+generate_attr32_record(const char *directory, const char *record_filename)
+{
+ token_t *attr32_token;
+
+}
+
+static char *zonename_sample = "testzone";
+
+static void
+generate_zonename_token(const char *directory, const char *token_filename)
+{
+ token_t *zonename_token;
+
+ zonename_token = au_to_zonename(zonename_sample);
+ if (zonename_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_zonename");
+ write_token(directory, token_filename, zonename_token);
+}
+
+static void
+generate_zonename_record(const char *directory, const char *record_filename)
+{
+ token_t *zonename_token;
+
+ zonename_token = au_to_zonename(zonename_sample);
+ if (zonename_token == NULL)
+ err(EX_UNAVAILABLE, "au_to_zonename");
+ write_record(directory, record_filename, zonename_token, AUE_NULL);
+}
+
+int
+main(int argc, char *argv[])
+{
+ const char *directory;
+ int ch;
+
+ while ((ch = getopt(argc, argv, "rt")) != -1) {
+ switch (ch) {
+ case 'r':
+ do_records++;
+ break;
+
+ case 't':
+ do_tokens++;
+ break;
+
+ default:
+ usage();
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 1)
+ usage();
+
+ directory = argv[0];
+
+ if (mkdir(directory, 0755) < 0 && errno != EEXIST)
+ err(EX_OSERR, "mkdir: %s", directory);
+
+ if (do_tokens) {
+ generate_file_token(directory, "file_token");
+ generate_trailer_token(directory, "trailer_token");
+ generate_header32_token(directory, "header32_token");
+ generate_data_token(directory, "data_token");
+ generate_ipc_token(directory, "ipc_token");
+ generate_path_token(directory, "path_token");
+ generate_subject32_token(directory, "subject32_token");
+ generate_subject32ex_token(directory, "subject32ex_token",
+ AU_IPv4);
+ generate_subject32ex_token(directory, "subject32ex_token",
+ AU_IPv6);
+ generate_process32_token(directory, "process32_token");
+ generate_process32ex_token(directory, "process32ex_token",
+ AU_IPv4);
+ generate_process32ex_token(directory, "process32ex_token",
+ AU_IPv6);
+ generate_process64_token(directory, "process64_token");
+ generate_process64ex_token(directory, "process64ex_token",
+ AU_IPv4);
+ generate_process64ex_token(directory, "process64ex_token",
+ AU_IPv6);
+ generate_return32_token(directory, "return32_token");
+ generate_text_token(directory, "text_token");
+ generate_opaque_token(directory, "opaque_token");
+ generate_in_addr_token(directory, "in_addr_token");
+ generate_ip_token(directory, "ip_token");
+ generate_iport_token(directory, "iport_token");
+ generate_arg32_token(directory, "arg32_token");
+ generate_seq_token(directory, "seq_token");
+ generate_attr_token(directory, "attr_token");
+ generate_ipc_perm_token(directory, "ipc_perm_token");
+ generate_groups_token(directory, "groups_token");
+ generate_attr32_token(directory, "attr32_token");
+ generate_zonename_token(directory, "zonename_token");
+ }
+
+ if (do_records) {
+ generate_file_record(directory, "file_record");
+ generate_data_record(directory, "data_record");
+ generate_ipc_record(directory, "ipc_record");
+ generate_path_record(directory, "path_record");
+ generate_subject32_record(directory, "subject32_record");
+ generate_subject32ex_record(directory, "subject32ex_record",
+ AU_IPv4);
+ generate_subject32ex_record(directory, "subject32ex_record",
+ AU_IPv6);
+ generate_process32_record(directory, "process32_record");
+ generate_process32ex_record(directory, "process32ex_record",
+ AU_IPv4);
+ generate_process32ex_record(directory, "process32ex_record",
+ AU_IPv6);
+ generate_process64_record(directory, "process64_record");
+ generate_process64ex_record(directory, "process64ex_record",
+ AU_IPv4);
+ generate_process64ex_record(directory, "process64ex_record",
+ AU_IPv6);
+ generate_return32_record(directory, "return32_record");
+ generate_text_record(directory, "text_record");
+ generate_opaque_record(directory, "opaque_record");
+ generate_in_addr_record(directory, "in_addr_record");
+ generate_ip_record(directory, "ip_record");
+ generate_iport_record(directory, "iport_record");
+ generate_arg32_record(directory, "arg32_record");
+ generate_seq_record(directory, "seq_record");
+ generate_attr_record(directory, "attr_record");
+ generate_ipc_perm_record(directory, "ipc_perm_record");
+ generate_groups_record(directory, "groups_record");
+ generate_attr32_record(directory, "attr32_record");
+ generate_zonename_record(directory, "zonename_record");
+ }
+
+ return (0);
+}
diff --git a/test/reference/arg32_record b/test/reference/arg32_record
new file mode 100644
index 0000000..2222ed0
--- /dev/null
+++ b/test/reference/arg32_record
Binary files differ
diff --git a/test/reference/arg32_token b/test/reference/arg32_token
new file mode 100644
index 0000000..3401aa1
--- /dev/null
+++ b/test/reference/arg32_token
Binary files differ
diff --git a/test/reference/data_record b/test/reference/data_record
new file mode 100644
index 0000000..8088f4e
--- /dev/null
+++ b/test/reference/data_record
Binary files differ
diff --git a/test/reference/data_token b/test/reference/data_token
new file mode 100644
index 0000000..e000b8a
--- /dev/null
+++ b/test/reference/data_token
Binary files differ
diff --git a/test/reference/file_record b/test/reference/file_record
new file mode 100644
index 0000000..b56d5cc
--- /dev/null
+++ b/test/reference/file_record
Binary files differ
diff --git a/test/reference/file_token b/test/reference/file_token
new file mode 100644
index 0000000..8b6daa6
--- /dev/null
+++ b/test/reference/file_token
Binary files differ
diff --git a/test/reference/header32_token b/test/reference/header32_token
new file mode 100644
index 0000000..dd72c1c
--- /dev/null
+++ b/test/reference/header32_token
Binary files differ
diff --git a/test/reference/in_addr_record b/test/reference/in_addr_record
new file mode 100644
index 0000000..4f308e0
--- /dev/null
+++ b/test/reference/in_addr_record
Binary files differ
diff --git a/test/reference/in_addr_token b/test/reference/in_addr_token
new file mode 100644
index 0000000..56b32a7
--- /dev/null
+++ b/test/reference/in_addr_token
@@ -0,0 +1 @@
+*ˬd \ No newline at end of file
diff --git a/test/reference/ip_record b/test/reference/ip_record
new file mode 100644
index 0000000..aee40a7
--- /dev/null
+++ b/test/reference/ip_record
Binary files differ
diff --git a/test/reference/ip_token b/test/reference/ip_token
new file mode 100644
index 0000000..96572a4
--- /dev/null
+++ b/test/reference/ip_token
Binary files differ
diff --git a/test/reference/ipc_record b/test/reference/ipc_record
new file mode 100644
index 0000000..4510f88
--- /dev/null
+++ b/test/reference/ipc_record
Binary files differ
diff --git a/test/reference/ipc_token b/test/reference/ipc_token
new file mode 100644
index 0000000..7d7690b
--- /dev/null
+++ b/test/reference/ipc_token
@@ -0,0 +1 @@
+"4Vx \ No newline at end of file
diff --git a/test/reference/iport_record b/test/reference/iport_record
new file mode 100644
index 0000000..1375efb
--- /dev/null
+++ b/test/reference/iport_record
Binary files differ
diff --git a/test/reference/iport_token b/test/reference/iport_token
new file mode 100644
index 0000000..0225a76
--- /dev/null
+++ b/test/reference/iport_token
Binary files differ
diff --git a/test/reference/opaque_record b/test/reference/opaque_record
new file mode 100644
index 0000000..247d6f2
--- /dev/null
+++ b/test/reference/opaque_record
Binary files differ
diff --git a/test/reference/opaque_token b/test/reference/opaque_token
new file mode 100644
index 0000000..02460d3
--- /dev/null
+++ b/test/reference/opaque_token
Binary files differ
diff --git a/test/reference/path_record b/test/reference/path_record
new file mode 100644
index 0000000..0d32b86
--- /dev/null
+++ b/test/reference/path_record
Binary files differ
diff --git a/test/reference/path_token b/test/reference/path_token
new file mode 100644
index 0000000..18d8eef
--- /dev/null
+++ b/test/reference/path_token
Binary files differ
diff --git a/test/reference/process32_record b/test/reference/process32_record
new file mode 100644
index 0000000..9a3f7d9
--- /dev/null
+++ b/test/reference/process32_record
Binary files differ
diff --git a/test/reference/process32_token b/test/reference/process32_token
new file mode 100644
index 0000000..a58adad
--- /dev/null
+++ b/test/reference/process32_token
Binary files differ
diff --git a/test/reference/process32ex_record b/test/reference/process32ex_record
new file mode 100644
index 0000000..aa2cb56
--- /dev/null
+++ b/test/reference/process32ex_record
Binary files differ
diff --git a/test/reference/process32ex_record-IPv4 b/test/reference/process32ex_record-IPv4
new file mode 100644
index 0000000..6250b9c
--- /dev/null
+++ b/test/reference/process32ex_record-IPv4
Binary files differ
diff --git a/test/reference/process32ex_record-IPv6 b/test/reference/process32ex_record-IPv6
new file mode 100644
index 0000000..22a3249
--- /dev/null
+++ b/test/reference/process32ex_record-IPv6
Binary files differ
diff --git a/test/reference/process32ex_token b/test/reference/process32ex_token
new file mode 100644
index 0000000..ba84a2a
--- /dev/null
+++ b/test/reference/process32ex_token
Binary files differ
diff --git a/test/reference/process32ex_token-IPv4 b/test/reference/process32ex_token-IPv4
new file mode 100644
index 0000000..dd0ae66
--- /dev/null
+++ b/test/reference/process32ex_token-IPv4
Binary files differ
diff --git a/test/reference/process32ex_token-IPv6 b/test/reference/process32ex_token-IPv6
new file mode 100644
index 0000000..3442428
--- /dev/null
+++ b/test/reference/process32ex_token-IPv6
Binary files differ
diff --git a/test/reference/process64_record b/test/reference/process64_record
new file mode 100644
index 0000000..d8fca8e
--- /dev/null
+++ b/test/reference/process64_record
Binary files differ
diff --git a/test/reference/process64_token b/test/reference/process64_token
new file mode 100644
index 0000000..268b2c3
--- /dev/null
+++ b/test/reference/process64_token
Binary files differ
diff --git a/test/reference/process64ex_record-IPv4 b/test/reference/process64ex_record-IPv4
new file mode 100644
index 0000000..3b7a728
--- /dev/null
+++ b/test/reference/process64ex_record-IPv4
Binary files differ
diff --git a/test/reference/process64ex_record-IPv6 b/test/reference/process64ex_record-IPv6
new file mode 100644
index 0000000..6563e25
--- /dev/null
+++ b/test/reference/process64ex_record-IPv6
Binary files differ
diff --git a/test/reference/process64ex_token-IPv4 b/test/reference/process64ex_token-IPv4
new file mode 100644
index 0000000..92ae1da
--- /dev/null
+++ b/test/reference/process64ex_token-IPv4
Binary files differ
diff --git a/test/reference/process64ex_token-IPv6 b/test/reference/process64ex_token-IPv6
new file mode 100644
index 0000000..1cbc259
--- /dev/null
+++ b/test/reference/process64ex_token-IPv6
Binary files differ
diff --git a/test/reference/return32_record b/test/reference/return32_record
new file mode 100644
index 0000000..e57d26c
--- /dev/null
+++ b/test/reference/return32_record
Binary files differ
diff --git a/test/reference/return32_token b/test/reference/return32_token
new file mode 100644
index 0000000..e7a2098
--- /dev/null
+++ b/test/reference/return32_token
@@ -0,0 +1 @@
+'×4Vx \ No newline at end of file
diff --git a/test/reference/seq_record b/test/reference/seq_record
new file mode 100644
index 0000000..75cea17
--- /dev/null
+++ b/test/reference/seq_record
Binary files differ
diff --git a/test/reference/seq_token b/test/reference/seq_token
new file mode 100644
index 0000000..99b51cf
--- /dev/null
+++ b/test/reference/seq_token
@@ -0,0 +1 @@
+/4Vx \ No newline at end of file
diff --git a/test/reference/subject32_record b/test/reference/subject32_record
new file mode 100644
index 0000000..f96d84c
--- /dev/null
+++ b/test/reference/subject32_record
Binary files differ
diff --git a/test/reference/subject32_token b/test/reference/subject32_token
new file mode 100644
index 0000000..2263fe5
--- /dev/null
+++ b/test/reference/subject32_token
Binary files differ
diff --git a/test/reference/subject32ex_record b/test/reference/subject32ex_record
new file mode 100644
index 0000000..1d949a6
--- /dev/null
+++ b/test/reference/subject32ex_record
Binary files differ
diff --git a/test/reference/subject32ex_token-IPv4 b/test/reference/subject32ex_token-IPv4
new file mode 100644
index 0000000..a40a3c5
--- /dev/null
+++ b/test/reference/subject32ex_token-IPv4
Binary files differ
diff --git a/test/reference/subject32ex_token-IPv6 b/test/reference/subject32ex_token-IPv6
new file mode 100644
index 0000000..01bbcb6
--- /dev/null
+++ b/test/reference/subject32ex_token-IPv6
Binary files differ
diff --git a/test/reference/text_record b/test/reference/text_record
new file mode 100644
index 0000000..2f3fce2
--- /dev/null
+++ b/test/reference/text_record
Binary files differ
diff --git a/test/reference/text_token b/test/reference/text_token
new file mode 100644
index 0000000..12d5819
--- /dev/null
+++ b/test/reference/text_token
Binary files differ
diff --git a/test/reference/trailer_token b/test/reference/trailer_token
new file mode 100644
index 0000000..138e0b3
--- /dev/null
+++ b/test/reference/trailer_token
@@ -0,0 +1 @@
+±4Vx \ No newline at end of file
diff --git a/test/reference/zonename_record b/test/reference/zonename_record
new file mode 100644
index 0000000..cfb9e26
--- /dev/null
+++ b/test/reference/zonename_record
Binary files differ
diff --git a/test/reference/zonename_token b/test/reference/zonename_token
new file mode 100644
index 0000000..3a3ebdc
--- /dev/null
+++ b/test/reference/zonename_token
Binary files differ
diff --git a/test/samples/execve-long-args.trail b/test/samples/execve-long-args.trail
new file mode 100644
index 0000000..0ad3af0
--- /dev/null
+++ b/test/samples/execve-long-args.trail
Binary files differ
OpenPOWER on IntegriCloud