Index: libabac/AUTHORS
===================================================================
--- libabac/AUTHORS	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
+++ libabac/AUTHORS	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -0,0 +1,2 @@
+Mike Ryan <mikeryan@ISI.EDU>
+    "Nothing beats a good IPA on draft."
Index: libabac/COPYING
===================================================================
--- libabac/COPYING	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
+++ libabac/COPYING	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -0,0 +1,19 @@
+Copyright (c) 2010 University of Southern California
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: libabac/INSTALL
===================================================================
--- libabac/INSTALL	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
+++ libabac/INSTALL	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -0,0 +1,3 @@
+./configure --with-strongswan=<path>
+make
+sudo make install
Index: libabac/Makefile.am
===================================================================
--- libabac/Makefile.am	(revision 15200beba77a0ea12f6dcaabfa529d03962d71fc)
+++ libabac/Makefile.am	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -1,3 +1,4 @@
 lib_LTLIBRARIES = libabac.la
+bin_PROGRAMS = abac_prover abac_prover_plus
 
 libabac_la_SOURCES = \
@@ -18,10 +19,22 @@
     utlist.h
 
+abac_prover_SOURCES = prover.c abac.h
+abac_prover_LDADD = -labac
+
+abac_prover_plus_SOURCES = prover_plus.cc abac.hh
+abac_prover_plus_LDADD = -labac
+
+LIBSTRONGSWAN_source = @LIBSTRONGSWAN_source@
+
 libabac_la_LDFLAGS = -version-info 1:0:1
 
-libabac_la_LIBADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
-verifier.o :	$(top_builddir)/config.status
+libabac_la_LIBADD = -lstrongswan
 
-INCLUDES = -I$(top_srcdir)/src/libstrongswan
+INCLUDES = -I$(LIBSTRONGSWAN_source)/src/libstrongswan
 AM_CFLAGS = \
 	-DPLUGINS=\""${libstrongswan_plugins}\""
+
+ACLOCAL_AMFLAGS=-I m4
+
+library_includedir=$(includedir)
+library_include_HEADERS = abac.h abac.hh
Index: libabac/README
===================================================================
--- libabac/README	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
+++ libabac/README	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -0,0 +1,1 @@
+This is libabac. Documentation forthcoming.
Index: libabac/autogen.sh
===================================================================
--- libabac/autogen.sh	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
+++ libabac/autogen.sh	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+LIBTOOLIZE=`which glibtoolize 2>/dev/null`
+case "$LIBTOOLIZE" in
+	/* )	;;
+	*  )	LIBTOOLIZE=`which libtoolize 2>/dev/null`
+		case "$LIBTOOLIZE" in
+			/* )	;;
+			*  )	LIBTOOLIZE=libtoolize
+				;;
+		esac
+		;;
+esac
+
+$LIBTOOLIZE --force &&
+aclocal &&
+automake -a &&
+autoconf
+
Index: libabac/configure.ac
===================================================================
--- libabac/configure.ac	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
+++ libabac/configure.ac	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -0,0 +1,64 @@
+AC_INIT([libabac], [0.1], [mikeryan@ISI.EDU])
+AC_CONFIG_SRCDIR([abac_role.c])
+AM_INIT_AUTOMAKE([foreign])
+LT_INIT
+
+AC_CONFIG_MACRO_DIR([m4])
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+
+AC_ARG_ENABLE(debug,
+    [AC_HELP_STRING([--enable-debug], [build with debug symbols])],
+    [CFLAGS+="-g "],[])
+
+# Checks for libraries.
+AC_ARG_WITH([strongswan],
+    [AS_HELP_STRING([--with-strongswan=PATH], [location of strongswan-4.4.0 source tree])],
+    [LIBSTRONGSWAN_source=$withval],
+    [AC_ERROR([path to strongswan-4.4.0 source tree required])])
+test -d $LIBSTRONGSWAN_source || AC_ERROR([strongswan source dir not found. Don't use ~, use \$HOME.])
+AC_SUBST([LIBSTRONGSWAN_source])
+
+# this is so wrong
+libstrongswan_plugins=$(grep libstrongswan_plugins $LIBSTRONGSWAN_source/Makefile | awk -F= '{ print $2 }')
+test -z "$libstrongswan_plugins" && AC_ERROR([Can't find libstrongswan plugins. Make sure you've run ./configure --enable-monolithic in the strongswan source tree])
+AC_SUBST(libstrongswan_plugins)
+
+# Checks for header files.
+AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_TYPE_SIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT8_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([atexit memset strchr strdup])
+
+# snagged from strongswan, required
+AC_CHECK_FUNC(
+        [register_printf_specifier],
+        [AC_DEFINE(HAVE_PRINTF_SPECIFIER)],
+        [AC_CHECK_FUNC(
+                [register_printf_function],
+                [AC_DEFINE(HAVE_PRINTF_FUNCTION)],
+                [
+                        AC_MSG_NOTICE([printf does not support custom format specifiers!])
+                        vstr=true
+                ]
+        )]
+)
+
+if test x$vstr = xtrue; then
+        AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])])
+        AC_DEFINE(USE_VSTR)
+fi
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
Index: libabac/prover.c
===================================================================
--- libabac/prover.c	(revision 15200beba77a0ea12f6dcaabfa529d03962d71fc)
+++ libabac/prover.c	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -2,6 +2,5 @@
 #include <stdio.h>
 
-#include "abac.h"
-#include "abac_util.h"
+#include <abac.h>
 
 int main(int argc, char **argv) {
@@ -16,6 +15,4 @@
     abac_context_t *ctx = abac_context_new();
     abac_context_load_directory(ctx, argv[1]);
-
-    debug_printf("querying\n");
 
     abac_credential_t **credentials = abac_context_query(ctx,
Index: libabac/prover.cc
===================================================================
--- libabac/prover.cc	(revision 15200beba77a0ea12f6dcaabfa529d03962d71fc)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#include <err.h>
-#include <stdio.h>
-#include <vector>
-
-#include "abac.hh"
-#include "abac_util.h"
-
-using namespace ABAC;
-using std::vector;
-
-int main(int argc, char **argv) {
-    int i;
-    abac_credential_t *cred;
-
-    if (argc < 2)
-        errx(1, "Usage: %s <keystore>", argv[0]);
-
-    libabac_init();
-
-    Context ctx;
-    ctx.load_directory(argv[1]);
-
-    debug_printf("querying\n");
-
-    bool success;
-    vector<Credential> credentials = ctx.query(
-        "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create",
-        "5839d714b16bbe108642c5eb586c2173420bed19",
-        success
-    );
-
-    if (success)
-        puts("success");
-    for (vector<Credential>::iterator i = credentials.begin(); i != credentials.end(); ++i) {
-        printf("credential %s <- %s\n",
-            i->head().string(),
-            i->tail().string()
-        );
-    }
-
-    libabac_deinit();
-
-    return 0;
-}
Index: libabac/prover_plus.cc
===================================================================
--- libabac/prover_plus.cc	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
+++ libabac/prover_plus.cc	(revision 6ede88cd11345c8461b661168f5187234abdc2f0)
@@ -0,0 +1,41 @@
+#include <err.h>
+#include <stdio.h>
+#include <vector>
+
+#include <abac.hh>
+
+using namespace ABAC;
+using std::vector;
+
+int main(int argc, char **argv) {
+    int i;
+    abac_credential_t *cred;
+
+    if (argc < 2)
+        errx(1, "Usage: %s <keystore>", argv[0]);
+
+    libabac_init();
+
+    Context ctx;
+    ctx.load_directory(argv[1]);
+
+    bool success;
+    vector<Credential> credentials = ctx.query(
+        "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create",
+        "5839d714b16bbe108642c5eb586c2173420bed19",
+        success
+    );
+
+    if (success)
+        puts("success");
+    for (vector<Credential>::iterator i = credentials.begin(); i != credentials.end(); ++i) {
+        printf("credential %s <- %s\n",
+            i->head().string(),
+            i->tail().string()
+        );
+    }
+
+    libabac_deinit();
+
+    return 0;
+}
