starter: Remove all ties to pluto/libfreeswan.
authorTobias Brunner <tobias@strongswan.org>
Tue, 15 May 2012 14:37:02 +0000 (16:37 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 11 Jun 2012 15:33:32 +0000 (17:33 +0200)
Moved some types/constants in the process.

src/starter/Android.mk
src/starter/Makefile.am
src/starter/args.c
src/starter/cmp.c
src/starter/confread.c
src/starter/confread.h
src/starter/invokecharon.c
src/starter/parser.y
src/starter/starter.c
src/starter/starterstroke.c

index ece936f..05f28fe 100644 (file)
@@ -14,11 +14,7 @@ invokecharon.h klips.c klips.h
 LOCAL_C_INCLUDES += \
        $(libvstr_PATH) \
        $(strongswan_PATH)/src/libhydra \
-       $(strongswan_PATH)/src/libfreeswan \
        $(strongswan_PATH)/src/libstrongswan \
-       $(strongswan_PATH)/src/libfreeswan \
-       $(strongswan_PATH)/src/pluto \
-       $(strongswan_PATH)/src/whack \
        $(strongswan_PATH)/src/stroke
 
 LOCAL_CFLAGS := $(strongswan_CFLAGS) -DSTART_CHARON \
@@ -37,11 +33,8 @@ LOCAL_ARM_MODE := arm
 LOCAL_PRELINK_MODULE := false
 
 LOCAL_REQUIRED_MODULES := stroke
-ifneq ($(strongswan_BUILD_PLUTO),)
-LOCAL_REQUIRED_MODULES += whack
-endif
 
-LOCAL_SHARED_LIBRARIES += libstrongswan libhydra libfreeswan
+LOCAL_SHARED_LIBRARIES += libstrongswan libhydra
 
 include $(BUILD_EXECUTABLE)
 
index f2062c3..37aa7f2 100644 (file)
@@ -9,10 +9,7 @@ invokecharon.h klips.c klips.h
 INCLUDES = \
 -I${linux_headers} \
 -I$(top_srcdir)/src/libstrongswan \
--I$(top_srcdir)/src/libfreeswan \
 -I$(top_srcdir)/src/libhydra \
--I$(top_srcdir)/src/pluto \
--I$(top_srcdir)/src/whack \
 -I$(top_srcdir)/src/stroke
 
 AM_CFLAGS = \
@@ -27,14 +24,11 @@ AM_CFLAGS = \
 
 AM_YFLAGS = -v -d
 
-starter_LDADD = defs.o $(top_builddir)/src/libfreeswan/libfreeswan.a $(top_builddir)/src/libstrongswan/libstrongswan.la $(top_builddir)/src/libhydra/libhydra.la $(SOCKLIB) $(PTHREADLIB)
+starter_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la $(top_builddir)/src/libhydra/libhydra.la $(SOCKLIB) $(PTHREADLIB)
 EXTRA_DIST = keywords.txt ipsec.conf Android.mk
 MAINTAINERCLEANFILES = keywords.c
 BUILT_SOURCES = parser.h
 
-PLUTODIR=$(top_srcdir)/src/pluto
-SCEPCLIENTDIR=$(top_srcdir)/src/scepclient
-
 if USE_PLUTO
   AM_CFLAGS += -DSTART_PLUTO
 endif
@@ -54,9 +48,6 @@ endif
 keywords.c:    $(srcdir)/keywords.txt $(srcdir)/keywords.h
                $(GPERF) -m 10 -C -G -D -t < $(srcdir)/keywords.txt > $@
 
-defs.o:                $(PLUTODIR)/defs.c $(PLUTODIR)/defs.h
-               $(COMPILE) -c -o $@ $(PLUTODIR)/defs.c
-
 install-exec-local :
                test -e "$(DESTDIR)${sysconfdir}/ipsec.d" || $(INSTALL) -o -d "$(DESTDIR)$(sysconfdir)/ipsec.d" || true
                test -e "$(DESTDIR)${sysconfdir}/ipsec.d/cacerts" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/cacerts" || true
index af088c4..ab0f740 100644 (file)
@@ -20,9 +20,6 @@
 #include <library.h>
 #include <debug.h>
 
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-
 #include "keywords.h"
 #include "confread.h"
 #include "args.h"
index b3caaeb..e65d96f 100644 (file)
 
 #include <string.h>
 
-#include <freeswan.h>
-
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-
 #include "confread.h"
 #include "args.h"
 #include "cmp.h"
index d6d36fa..55392c2 100644 (file)
 #include <library.h>
 #include <debug.h>
 
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-
 #include "keywords.h"
 #include "confread.h"
 #include "args.h"
 #include "files.h"
 
+#define IKE_LIFETIME_DEFAULT         10800 /* 3 hours */
+#define IPSEC_LIFETIME_DEFAULT        3600 /* 1 hour */
+#define SA_REPLACEMENT_MARGIN_DEFAULT  540 /* 9 minutes */
+#define SA_REPLACEMENT_FUZZ_DEFAULT    100 /* 100% of margin */
+#define SA_REPLACEMENT_RETRIES_DEFAULT   3
 
 static const char ike_defaults[] = "aes128-sha1-modp2048,3des-sha1-modp1536";
 static const char esp_defaults[] = "aes128-sha1-modp2048,3des-sha1-modp1536";
@@ -87,8 +89,8 @@ static void default_values(starter_config_t *cfg)
 
        cfg->conn_default.ike                   = strdupnull(ike_defaults);
        cfg->conn_default.esp                   = strdupnull(esp_defaults);
-       cfg->conn_default.sa_ike_life_seconds   = OAKLEY_ISAKMP_SA_LIFETIME_DEFAULT;
-       cfg->conn_default.sa_ipsec_life_seconds = PLUTO_SA_LIFE_DURATION_DEFAULT;
+       cfg->conn_default.sa_ike_life_seconds   = IKE_LIFETIME_DEFAULT;
+       cfg->conn_default.sa_ipsec_life_seconds = IPSEC_LIFETIME_DEFAULT;
        cfg->conn_default.sa_rekey_margin       = SA_REPLACEMENT_MARGIN_DEFAULT;
        cfg->conn_default.sa_rekey_fuzz         = SA_REPLACEMENT_FUZZ_DEFAULT;
        cfg->conn_default.sa_keying_tries       = SA_REPLACEMENT_RETRIES_DEFAULT;
index 5064f6c..9763bf7 100644 (file)
@@ -16,8 +16,6 @@
 #ifndef _IPSEC_CONFREAD_H_
 #define _IPSEC_CONFREAD_H_
 
-#include <freeswan.h>
-#include "../pluto/constants.h"
 #include <kernel/kernel_ipsec.h>
 
 #include "ipsec-parser.h"
@@ -56,6 +54,22 @@ typedef enum {
 } strict_t;
 
 typedef enum {
+               CERT_ALWAYS_SEND,
+               CERT_SEND_IF_ASKED,
+               CERT_NEVER_SEND,
+               CERT_YES_SEND,          /* synonym for CERT_ALWAYS_SEND */
+               CERT_NO_SEND,           /* synonym for CERT_NEVER_SEND */
+} certpolicy_t;
+
+typedef enum {
+               DPD_ACTION_NONE,
+               DPD_ACTION_CLEAR,
+               DPD_ACTION_HOLD,
+               DPD_ACTION_RESTART,
+               DPD_ACTION_UNKNOW,
+} dpd_action_t;
+
+typedef enum {
                /* IPsec options */
                SA_OPTION_AUTHENTICATE  = 1 << 0, /* use AH instead of ESP? */
                SA_OPTION_COMPRESS      = 1 << 1, /* use IPComp */
index 4d7adf5..102d158 100644 (file)
@@ -26,9 +26,6 @@
 #include <library.h>
 #include <debug.h>
 
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-
 #include "confread.h"
 #include "invokecharon.h"
 #include "files.h"
index 58efeef..424e3a9 100644 (file)
@@ -20,9 +20,6 @@
 #include <library.h>
 #include <debug.h>
 
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-
 #include "ipsec-parser.h"
 
 #define YYERROR_VERBOSE
index 7f380c2..40500b6 100644 (file)
 #include <grp.h>
 #include <pthread.h>
 
-#include <freeswan.h>
 #include <library.h>
 #include <hydra.h>
 #include <utils/backtrace.h>
 #include <threading/thread.h>
 #include <debug.h>
 
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-
 #include "confread.h"
 #include "files.h"
 #include "starterstroke.h"
index 28846be..26ac5da 100644 (file)
@@ -29,9 +29,6 @@
 #include <library.h>
 #include <debug.h>
 
-#include <constants.h>
-#include <defs.h>
-
 #include <stroke_msg.h>
 
 #include "starterstroke.h"