summaryrefslogtreecommitdiff
path: root/src/whack
diff options
context:
space:
mode:
Diffstat (limited to 'src/whack')
-rw-r--r--src/whack/Android.mk30
-rw-r--r--src/whack/Makefile.am6
-rw-r--r--src/whack/Makefile.in14
-rw-r--r--src/whack/whack.c10
-rw-r--r--src/whack/whack.h3
5 files changed, 56 insertions, 7 deletions
diff --git a/src/whack/Android.mk b/src/whack/Android.mk
new file mode 100644
index 000000000..bf5ec0e98
--- /dev/null
+++ b/src/whack/Android.mk
@@ -0,0 +1,30 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+# copy-n-paste from Makefile.am
+LOCAL_SRC_FILES := \
+whack.c whack.h
+
+# build whack ------------------------------------------------------------------
+
+LOCAL_C_INCLUDES += \
+ $(libvstr_PATH) \
+ $(strongswan_PATH)/src/libstrongswan \
+ $(strongswan_PATH)/src/libfreeswan \
+ $(strongswan_PATH)/src/libhydra \
+ $(strongswan_PATH)/src/pluto
+
+LOCAL_CFLAGS := $(strongswan_CFLAGS)
+
+LOCAL_MODULE := whack
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_ARM_MODE := arm
+
+LOCAL_PRELINK_MODULE := false
+
+LOCAL_SHARED_LIBRARIES += libstrongswan libfreeswan
+
+include $(BUILD_EXECUTABLE)
+
diff --git a/src/whack/Makefile.am b/src/whack/Makefile.am
index 316a83312..23374475e 100644
--- a/src/whack/Makefile.am
+++ b/src/whack/Makefile.am
@@ -1,6 +1,7 @@
ipsec_PROGRAMS = whack
-whack_SOURCES = whack.c whack.h
+whack_SOURCES = \
+whack.c whack.h
INCLUDES = \
-I$(top_srcdir)/src/libstrongswan \
@@ -12,5 +13,6 @@ whack_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
$(top_builddir)/src/libfreeswan/libfreeswan.a
-AM_CFLAGS = -DDEBUG
+AM_CFLAGS = -DDEBUG -DIPSEC_PIDDIR=\"${piddir}\"
+EXTRA_DIST = Android.mk
diff --git a/src/whack/Makefile.in b/src/whack/Makefile.in
index f62c2bfc0..fd768e995 100644
--- a/src/whack/Makefile.in
+++ b/src/whack/Makefile.in
@@ -168,6 +168,9 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
+attest_plugins = @attest_plugins@
+axis2c_CFLAGS = @axis2c_CFLAGS@
+axis2c_LIBS = @axis2c_LIBS@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
@@ -176,6 +179,7 @@ build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
c_plugins = @c_plugins@
+clearsilver_LIBS = @clearsilver_LIBS@
datadir = @datadir@
datarootdir = @datarootdir@
dbusservicedir = @dbusservicedir@
@@ -192,11 +196,13 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
+imcvdir = @imcvdir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
ipsecdir = @ipsecdir@
ipsecgroup = @ipsecgroup@
+ipseclibdir = @ipseclibdir@
ipsecuser = @ipsecuser@
libcharon_plugins = @libcharon_plugins@
libdir = @libdir@
@@ -240,6 +246,7 @@ sharedstatedir = @sharedstatedir@
soup_CFLAGS = @soup_CFLAGS@
soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
+starter_plugins = @starter_plugins@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
@@ -250,7 +257,9 @@ top_srcdir = @top_srcdir@
urandom_device = @urandom_device@
xml_CFLAGS = @xml_CFLAGS@
xml_LIBS = @xml_LIBS@
-whack_SOURCES = whack.c whack.h
+whack_SOURCES = \
+whack.c whack.h
+
INCLUDES = \
-I$(top_srcdir)/src/libstrongswan \
-I$(top_srcdir)/src/libfreeswan \
@@ -261,7 +270,8 @@ whack_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
$(top_builddir)/src/libfreeswan/libfreeswan.a
-AM_CFLAGS = -DDEBUG
+AM_CFLAGS = -DDEBUG -DIPSEC_PIDDIR=\"${piddir}\"
+EXTRA_DIST = Android.mk
all: all-am
.SUFFIXES:
diff --git a/src/whack/whack.c b/src/whack/whack.c
index ac2d3ea40..a7945d6d8 100644
--- a/src/whack/whack.c
+++ b/src/whack/whack.c
@@ -176,7 +176,7 @@ static void help(void)
" \\\n "
" [--debug-control]"
" [--debug-lifecycle]"
- " [--debug-klips]"
+ " [--debug-kernel]"
" [--debug-dns]"
" \\\n "
" [--debug-natt]"
@@ -207,6 +207,7 @@ static void help(void)
" [--listcrls]"
" [--listocsp]"
" [--listcards]"
+ " [--listplugins]"
" [--listall]"
"\n\n"
"purge: whack"
@@ -379,6 +380,7 @@ enum {
LST_CRLS,
LST_OCSP,
LST_CARDS,
+ LST_PLUGINS,
LST_ALL,
# define LST_LAST LST_ALL /* last list option */
@@ -571,6 +573,7 @@ static const struct option long_opts[] = {
{ "listcrls", no_argument, NULL, LST_CRLS + OO },
{ "listocsp", no_argument, NULL, LST_OCSP + OO },
{ "listcards", no_argument, NULL, LST_CARDS + OO },
+ { "listplugins", no_argument, NULL, LST_PLUGINS + OO },
{ "listall", no_argument, NULL, LST_ALL + OO },
/* options for an end description */
@@ -797,12 +800,14 @@ static void check_end(whack_end_t *this, whack_end_t *that,
static void get_secret(int sock)
{
- const char *buf, *secret;
+ const char *buf = NULL, *secret;
int len;
fflush(stdout);
usleep(20000); /* give fflush time for flushing */
+#ifdef HAVE_GETPASS
buf = getpass("Enter: ");
+#endif
secret = (buf == NULL)? "" : buf;
/* send the secret to pluto */
@@ -1232,6 +1237,7 @@ int main(int argc, char **argv)
case LST_CRLS: /* --listcrls */
case LST_OCSP: /* --listocsp */
case LST_CARDS: /* --listcards */
+ case LST_PLUGINS: /* --listplugins */
msg.whack_list |= LELEM(c - LST_ALGS);
continue;
diff --git a/src/whack/whack.h b/src/whack/whack.h
index f8e6a9a88..c92eaf3cf 100644
--- a/src/whack/whack.h
+++ b/src/whack/whack.h
@@ -333,8 +333,9 @@ enum rc_type {
#define LIST_CRLS 0x0200 /* list all crls */
#define LIST_OCSP 0x0400 /* list all ocsp cache entries */
#define LIST_CARDS 0x0800 /* list all smartcard records */
+#define LIST_PLUGINS 0x1000 /* list all plugins with dependencies */
-#define LIST_ALL LRANGES(LIST_ALGS, LIST_CARDS) /* all list options */
+#define LIST_ALL LRANGES(LIST_ALGS, LIST_PLUGINS) /* all list options */
/* options of whack --reread*** command */