aboutsummaryrefslogtreecommitdiffstats
path: root/src/starter
diff options
context:
space:
mode:
Diffstat (limited to 'src/starter')
-rw-r--r--src/starter/Makefile.am18
-rw-r--r--src/starter/interfaces.c2
-rw-r--r--src/starter/interfaces.h4
-rw-r--r--src/starter/parser.l4
-rw-r--r--src/starter/starter.c6
-rw-r--r--src/starter/starterstroke.c24
-rw-r--r--src/starter/starterwhack.c6
7 files changed, 40 insertions, 24 deletions
diff --git a/src/starter/Makefile.am b/src/starter/Makefile.am
index e9c707c2b..57205665f 100644
--- a/src/starter/Makefile.am
+++ b/src/starter/Makefile.am
@@ -30,20 +30,20 @@ if USE_CHARON
AM_CFLAGS += -DSTART_CHARON
endif
-lex.yy.c: parser.l parser.y parser.h y.tab.c
- $(LEX) --nounput $<
+lex.yy.c: $(srcdir)/parser.l $(srcdir)/parser.y $(srcdir)/parser.h
+ $(LEX) $(srcdir)/parser.l
-y.tab.c: parser.y parser.l parser.h
- $(YACC) -v -d $<
+y.tab.c: $(srcdir)/parser.y $(srcdir)/parser.l $(srcdir)/parser.h
+ $(YACC) -v -d $(srcdir)/parser.y
-y.tab.h: parser.y parser.l parser.h
- $(YACC) -v -d $<
+y.tab.h: $(srcdir)/parser.y $(srcdir)/parser.l $(srcdir)/parser.h
+ $(YACC) -v -d $(srcdir)/parser.y
-keywords.c: keywords.txt keywords.h
- $(GPERF) -C -G -t < $< > $@
+keywords.c: $(srcdir)/keywords.txt $(srcdir)/keywords.h
+ $(GPERF) -C -G -D -t < $(srcdir)/keywords.txt > $@
defs.o: $(PLUTODIR)/defs.c $(PLUTODIR)/defs.h
- $(COMPILE) -c -o $@ $<
+ $(COMPILE) -c -o $@ $(PLUTODIR)/defs.c
install-exec-local :
test -e "$(DESTDIR)${sysconfdir}/ipsec.d" || $(INSTALL) -o ${ipsecuser} -g ${ipsecgroup} -d "$(DESTDIR)$(sysconfdir)/ipsec.d" || true
diff --git a/src/starter/interfaces.c b/src/starter/interfaces.c
index 04cfc9f77..f28aca33e 100644
--- a/src/starter/interfaces.c
+++ b/src/starter/interfaces.c
@@ -16,14 +16,12 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <linux/if.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <freeswan.h>
-#include <ipsec_tunnel.h>
#include <constants.h>
#include <defs.h>
diff --git a/src/starter/interfaces.h b/src/starter/interfaces.h
index 324b0cc2f..08257f73a 100644
--- a/src/starter/interfaces.h
+++ b/src/starter/interfaces.h
@@ -17,7 +17,9 @@
#ifndef _STARTER_INTERFACES_H_
#define _STARTER_INTERFACES_H_
-#include <linux/if.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
#include "../pluto/constants.h"
diff --git a/src/starter/parser.l b/src/starter/parser.l
index 7b93e53b7..582371e4f 100644
--- a/src/starter/parser.l
+++ b/src/starter/parser.l
@@ -1,3 +1,5 @@
+%option noinput
+%option nounput
%{
/* FreeS/WAN config file parser (parser.l)
* Copyright (C) 2001 Mathieu Lafon - Arkoon Network Security
@@ -23,8 +25,6 @@
#define MAX_INCLUDE_DEPTH 20
-#define YY_NO_INPUT
-#define YY_NO_UNPUT
extern void yyerror(const char *);
extern int yylex (void);
diff --git a/src/starter/starter.c b/src/starter/starter.c
index db4756e9e..b66ebdefb 100644
--- a/src/starter/starter.c
+++ b/src/starter/starter.c
@@ -328,11 +328,11 @@ int main (int argc, char **argv)
/* determine if we have a native netkey IPsec stack */
if (!starter_netkey_init())
{
- plog("no netkey IPSec stack detected");
+ plog("no netkey IPsec stack detected");
if (!starter_klips_init())
{
- plog("no KLIPS IPSec stack detected");
- exit(LSB_RC_FAILURE);
+ plog("no KLIPS IPsec stack detected");
+ plog("no known IPsec stack detected, ignoring!");
}
}
diff --git a/src/starter/starterstroke.c b/src/starter/starterstroke.c
index a695feb46..c36afe64b 100644
--- a/src/starter/starterstroke.c
+++ b/src/starter/starterstroke.c
@@ -21,10 +21,10 @@
#include <stddef.h>
#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <linux/xfrm.h>
#include <freeswan.h>
@@ -42,6 +42,15 @@
#define IPV6_LEN 16
/**
+ * Mode of an IPsec SA, must be the same as in charons kernel_ipsec.h
+ */
+enum ipsec_mode_t {
+ MODE_TRANSPORT = 1,
+ MODE_TUNNEL,
+ MODE_BEET
+};
+
+/**
* Authentication methods, must be the same as in charons authenticator.h
*/
enum auth_method_t {
@@ -68,9 +77,12 @@ static char* push_string(stroke_msg_t *msg, char *string)
static int send_stroke_msg (stroke_msg_t *msg)
{
- struct sockaddr_un ctl_addr = { AF_UNIX, CHARON_CTL_FILE };
+ struct sockaddr_un ctl_addr;
int byte_count;
char buffer[64];
+
+ ctl_addr.sun_family = AF_UNIX;
+ strcpy(ctl_addr.sun_path, CHARON_CTL_FILE);
/* starter is not called from commandline, and therefore absolutely silent */
msg->output_verbosity = -1;
@@ -247,20 +259,20 @@ int starter_stroke_add_conn(starter_config_t *cfg, starter_conn_t *conn)
if (conn->policy & POLICY_TUNNEL)
{
- msg.add_conn.mode = XFRM_MODE_TUNNEL;
+ msg.add_conn.mode = MODE_TUNNEL;
}
else if (conn->policy & POLICY_BEET)
{
- msg.add_conn.mode = XFRM_MODE_BEET;
+ msg.add_conn.mode = MODE_BEET;
}
else if (conn->policy & POLICY_PROXY)
{
- msg.add_conn.mode = XFRM_MODE_TRANSPORT;
+ msg.add_conn.mode = MODE_TRANSPORT;
msg.add_conn.proxy_mode = TRUE;
}
else
{
- msg.add_conn.mode = XFRM_MODE_TRANSPORT;
+ msg.add_conn.mode = MODE_TRANSPORT;
}
if (!(conn->policy & POLICY_DONT_REKEY))
diff --git a/src/starter/starterwhack.c b/src/starter/starterwhack.c
index 0588cf35b..4bc76de01 100644
--- a/src/starter/starterwhack.c
+++ b/src/starter/starterwhack.c
@@ -19,6 +19,7 @@
#include <sys/un.h>
#include <stddef.h>
#include <unistd.h>
+#include <string.h>
#include <errno.h>
#include <freeswan.h>
@@ -56,11 +57,14 @@ pack_str (char **p, char **next, char **roof)
static int
send_whack_msg (whack_message_t *msg)
{
- struct sockaddr_un ctl_addr = { AF_UNIX, PLUTO_CTL_FILE };
+ struct sockaddr_un ctl_addr;
int sock;
ssize_t len;
char *str_next, *str_roof;
+ ctl_addr.sun_family = AF_UNIX;
+ strcpy(ctl_addr.sun_path, PLUTO_CTL_FILE);
+
/* pack strings */
str_next = (char *)msg->string;
str_roof = (char *)&msg->string[sizeof(msg->string)];