merging changes from portability branch back to trunk
important change for developers: %Y replaces %D to print identities!
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -41,6 +41,15 @@
|
||||
#define IPV4_LEN 4
|
||||
#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
|
||||
*/
|
||||
@@ -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))
|
||||
|
||||
@@ -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)];
|
||||
|
||||
Reference in New Issue
Block a user