1 diff -Naur strongswan-2.7.0/Makefile.inc strongswan-2.7.0-patched/Makefile.inc
2 --- strongswan-2.7.0/Makefile.inc 2006-01-25 18:23:15.000000000 +0100
3 +++ strongswan-2.7.0-patched/Makefile.inc 2006-04-28 08:56:38.000000000 +0200
5 FINALLIBDIR=$(INC_USRLOCAL)/lib/ipsec
6 LIBDIR=$(DESTDIR)$(FINALLIBDIR)
8 +# sharedlibdir is where shared libraries go
9 +SHAREDLIBDIR=$(DESTDIR)$(INC_USRLOCAL)/lib
11 # where the appropriate manpage tree is located
12 # location within INC_USRLOCAL
14 # include PKCS11-based smartcard support
17 +# support IKEv2 via charon
20 # Default PKCS11 library
21 # Uncomment this line if using OpenSC <= 0.9.6
22 PKCS11_DEFAULT_LIB=\"/usr/lib/pkcs11/opensc-pkcs11.so\"
23 diff -Naur strongswan-2.7.0/programs/Makefile strongswan-2.7.0-patched/programs/Makefile
24 --- strongswan-2.7.0/programs/Makefile 2006-04-17 13:04:45.000000000 +0200
25 +++ strongswan-2.7.0-patched/programs/Makefile 2006-04-28 08:56:38.000000000 +0200
30 +ifeq ($(USE_IKEV2),true)
35 @echo "Please read doc/intro.html or INSTALL before running make"
37 diff -Naur strongswan-2.7.0/programs/ipsec/ipsec.in strongswan-2.7.0-patched/programs/ipsec/ipsec.in
38 --- strongswan-2.7.0/programs/ipsec/ipsec.in 2006-03-09 21:09:33.000000000 +0100
39 +++ strongswan-2.7.0-patched/programs/ipsec/ipsec.in 2006-04-28 08:56:38.000000000 +0200
41 export IPSEC_DIR IPSEC_CONFS IPSEC_LIBDIR IPSEC_EXECDIR
43 IPSEC_STARTER_PID="/var/run/starter.pid"
44 +IPSEC_CHARON_PID="/var/run/charon.pid"
46 # standardize PATH, and export it for everything else's benefit
47 PATH="${IPSEC_SBINDIR}":/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin
51 $IPSEC_EXECDIR/whack --name "$1" --terminate
52 + if test -e $IPSEC_CHARON_PID
54 + $IPSEC_EXECDIR/stroke down "$1"
58 listalgs|listpubkeys|listcerts|listcacerts|\
62 $IPSEC_EXECDIR/whack "$@" "--$op"
63 + if test -e $IPSEC_CHARON_PID
65 + $IPSEC_EXECDIR/stroke "$op"
73 $IPSEC_EXECDIR/whack "--$op"
74 + if test -e $IPSEC_CHARON_PID
76 + $IPSEC_EXECDIR/stroke "$op"
79 $IPSEC_EXECDIR/whack --name "$1" "--$op"
80 + if test -e $IPSEC_CHARON_PID
82 + $IPSEC_EXECDIR/stroke "$op" "$1"
90 $IPSEC_EXECDIR/whack --name "$1" --initiate
91 + if test -e $IPSEC_CHARON_PID
93 + $IPSEC_EXECDIR/stroke up "$1"
98 diff -Naur strongswan-2.7.0/programs/pluto/Makefile strongswan-2.7.0-patched/programs/pluto/Makefile
99 --- strongswan-2.7.0/programs/pluto/Makefile 2006-01-25 18:22:19.000000000 +0100
100 +++ strongswan-2.7.0-patched/programs/pluto/Makefile 2006-04-28 08:56:38.000000000 +0200
105 +# enable IKEv2 support
106 +ifeq ($(USE_IKEV2),true)
110 # This compile option activates the leak detective
111 ifeq ($(USE_LEAK_DETECTIVE),true)
112 DEFINES+= -DLEAK_DETECTIVE
113 diff -Naur strongswan-2.7.0/programs/pluto/demux.c strongswan-2.7.0-patched/programs/pluto/demux.c
114 --- strongswan-2.7.0/programs/pluto/demux.c 2005-02-18 22:08:59.000000000 +0100
115 +++ strongswan-2.7.0-patched/programs/pluto/demux.c 2006-04-28 08:56:13.000000000 +0200
116 @@ -1196,6 +1196,21 @@
121 +#define IKEV2_VERSION_OFFSET 17
122 +#define IKEV2_VERSION 0x20
124 + /* ignore IKEv2 packets - they will be handled by charon */
125 + if (pbs_room(&md->packet_pbs) > IKEV2_VERSION_OFFSET
126 + && md->packet_pbs.start[IKEV2_VERSION_OFFSET] == IKEV2_VERSION)
128 + DBG(DBG_CONTROLMORE,
129 + DBG_log(" ignoring IKEv2 packet")
138 @@ -1229,6 +1244,7 @@
139 if (md->packet_pbs.roof - md->packet_pbs.cur >= (ptrdiff_t)isakmp_hdr_desc.size)
141 struct isakmp_hdr *hdr = (struct isakmp_hdr *)md->packet_pbs.cur;
143 if ((hdr->isa_version >> ISA_MAJ_SHIFT) != ISAKMP_MAJOR_VERSION)
145 SEND_NOTIFICATION(INVALID_MAJOR_VERSION);
146 diff -Naur strongswan-2.7.0/programs/starter/Makefile strongswan-2.7.0-patched/programs/starter/Makefile
147 --- strongswan-2.7.0/programs/starter/Makefile 2006-02-17 20:34:02.000000000 +0100
148 +++ strongswan-2.7.0-patched/programs/starter/Makefile 2006-04-28 08:56:38.000000000 +0200
150 DEFINES+= -DLEAK_DETECTIVE
153 +# Enable charon support
154 +ifeq ($(USE_IKEV2),true)
158 INCLUDES=-I${FREESWANDIR}/linux/include
159 CFLAGS=$(DEFINES) $(INCLUDES) -Wall
160 CFLAGS+=-DIPSEC_EXECDIR=\"${FINALLIBEXECDIR}\" -DIPSEC_CONFDDIR=\"${FINALCONFDDIR}\"
162 starterwhack.o klips.o netkey.o interfaces.o exec.o cmp.o confread.o \
163 loglite.o ${PLUTO_OBJS}
165 +# Build charon-only objs
166 +ifeq ($(USE_IKEV2),true)
167 + OBJS+= invokecharon.o starterstroke.o
170 DISTSRC=$(OBJS:.o=.c)
171 DISTSRC+=cmp.h confread.h confwrite.h exec.h files.h interfaces.h klips.h netkey.h
172 DISTSRC+=parser.h args.h invokepluto.h starterwhack.h keywords.h keywords.txt
173 diff -Naur strongswan-2.7.0/programs/starter/args.c strongswan-2.7.0-patched/programs/starter/args.c
174 --- strongswan-2.7.0/programs/starter/args.c 2006-04-17 12:32:36.000000000 +0200
175 +++ strongswan-2.7.0-patched/programs/starter/args.c 2006-04-28 08:56:38.000000000 +0200
178 static const char *LST_keyexchange[] = {
187 diff -Naur strongswan-2.7.0/programs/starter/files.h strongswan-2.7.0-patched/programs/starter/files.h
188 --- strongswan-2.7.0/programs/starter/files.h 2006-02-04 19:52:58.000000000 +0100
189 +++ strongswan-2.7.0-patched/programs/starter/files.h 2006-04-28 08:56:38.000000000 +0200
191 #define SECRETS_FILE IPSEC_CONFDIR"/ipsec.secrets"
193 #define PLUTO_CMD IPSEC_EXECDIR"/pluto"
194 -#define CTL_FILE DEFAULT_CTLBASE CTL_SUFFIX
195 -#define PID_FILE DEFAULT_CTLBASE PID_SUFFIX
196 +#define PLUTO_CTL_FILE DEFAULT_CTLBASE CTL_SUFFIX
197 +#define PLUTO_PID_FILE DEFAULT_CTLBASE PID_SUFFIX
200 +#define CHARON_CMD IPSEC_EXECDIR"/charon"
201 +#define CHARON_BASE "/var/run/charon"
202 +#define CHARON_CTL_FILE CHARON_BASE CTL_SUFFIX
203 +#define CHARON_PID_FILE CHARON_BASE PID_SUFFIX
206 #define DYNIP_DIR "/var/run/dynip"
207 #define INFO_FILE "/var/run/ipsec.info"
208 diff -Naur strongswan-2.7.0/programs/starter/invokecharon.c strongswan-2.7.0-patched/programs/starter/invokecharon.c
209 --- strongswan-2.7.0/programs/starter/invokecharon.c 1970-01-01 01:00:00.000000000 +0100
210 +++ strongswan-2.7.0-patched/programs/starter/invokecharon.c 2006-04-28 08:56:38.000000000 +0200
212 +/* strongSwan charon launcher
213 + * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security
214 + * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
216 + * Ported from invokepluto.c to fit charons needs.
218 + * This program is free software; you can redistribute it and/or modify it
219 + * under the terms of the GNU General Public License as published by the
220 + * Free Software Foundation; either version 2 of the License, or (at your
221 + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
223 + * This program is distributed in the hope that it will be useful, but
224 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
225 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
226 + * for more details.
228 + * RCSID $Id: invokecharon.c $
231 +#include <sys/types.h>
232 +#include <sys/stat.h>
239 +#include <freeswan.h>
241 +#include "../pluto/constants.h"
242 +#include "../pluto/defs.h"
243 +#include "../pluto/log.h"
245 +#include "confread.h"
246 +#include "invokecharon.h"
249 +static int _charon_pid = 0;
250 +static int _stop_requested;
253 +starter_charon_pid(void)
255 + return _charon_pid;
259 +starter_charon_sigchild(pid_t pid)
261 + if (pid == _charon_pid)
264 + if (!_stop_requested)
266 + plog("charon has died -- restart scheduled (%dsec)"
267 + , CHARON_RESTART_DELAY);
268 + alarm(CHARON_RESTART_DELAY); // restart in 5 sec
270 + unlink(CHARON_PID_FILE);
275 +starter_stop_charon (void)
283 + _stop_requested = 1;
285 + /* be more and more aggressive */
286 + for (i = 0; i < 20 && (pid = _charon_pid) != 0; i++)
291 + kill(pid, SIGTERM);
293 + kill(pid, SIGKILL);
296 + if (_charon_pid == 0)
298 + plog("starter_stop_charon(): can't stop charon !!!");
303 + plog("stater_stop_charon(): charon is not started...");
310 +starter_start_charon (starter_config_t *cfg, bool debug)
316 + CHARON_CMD, NULL, NULL,
321 + arg[argc++] = "--use-syslog";
326 + plog("starter_start_charon(): charon already started...");
331 + unlink(CHARON_CTL_FILE);
332 + _stop_requested = 0;
338 + plog("can't fork(): %s", strerror(errno));
343 + sigprocmask(SIG_SETMASK, 0, NULL);
344 + execv(arg[0], arg);
345 + plog("can't execv(%s,...): %s", arg[0], strerror(errno));
350 + for (i = 0; i < 50 && _charon_pid; i++)
352 + /* wait for charon */
354 + if (stat(CHARON_PID_FILE, &stb) == 0)
357 + DBG_log("charon (%d) started", _charon_pid)
364 + /* If charon is started but with no ctl file, stop it */
365 + plog("charon too long to start... - kill kill");
366 + for (i = 0; i < 20 && (pid = _charon_pid) != 0; i++)
371 + kill(pid, SIGTERM);
373 + kill(pid, SIGKILL);
379 + plog("charon refused to be started");
386 diff -Naur strongswan-2.7.0/programs/starter/invokecharon.h strongswan-2.7.0-patched/programs/starter/invokecharon.h
387 --- strongswan-2.7.0/programs/starter/invokecharon.h 1970-01-01 01:00:00.000000000 +0100
388 +++ strongswan-2.7.0-patched/programs/starter/invokecharon.h 2006-04-28 08:56:38.000000000 +0200
390 +/* strongSwan charon launcher
391 + * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security
392 + * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
394 + * Ported from invokepluto.h to fit charons needs.
396 + * This program is free software; you can redistribute it and/or modify it
397 + * under the terms of the GNU General Public License as published by the
398 + * Free Software Foundation; either version 2 of the License, or (at your
399 + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
401 + * This program is distributed in the hope that it will be useful, but
402 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
403 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
404 + * for more details.
406 + * RCSID $Id: invokecharon.h $
409 +#ifndef _STARTER_CHARON_H_
410 +#define _STARTER_CHARON_H_
412 +#define CHARON_RESTART_DELAY 5
414 +extern void starter_charon_sigchild (pid_t pid);
415 +extern pid_t starter_charon_pid (void);
416 +extern int starter_stop_charon (void);
417 +extern int starter_start_charon(struct starter_config *cfg, bool debug);
419 +#endif /* _STARTER_CHARON_H_ */
421 diff -Naur strongswan-2.7.0/programs/starter/invokepluto.c strongswan-2.7.0-patched/programs/starter/invokepluto.c
422 --- strongswan-2.7.0/programs/starter/invokepluto.c 2006-02-17 22:41:50.000000000 +0100
423 +++ strongswan-2.7.0-patched/programs/starter/invokepluto.c 2006-04-28 08:56:38.000000000 +0200
425 , PLUTO_RESTART_DELAY);
426 alarm(PLUTO_RESTART_DELAY); // restart in 5 sec
429 + unlink(PLUTO_PID_FILE);
438 + unlink(PLUTO_CTL_FILE);
441 if (cfg->setup.prepluto)
446 - if (stat(CTL_FILE, &stb) == 0)
447 + if (stat(PLUTO_CTL_FILE, &stb) == 0)
450 DBG_log("pluto (%d) started", _pluto_pid)
451 diff -Naur strongswan-2.7.0/programs/starter/starter.c strongswan-2.7.0-patched/programs/starter/starter.c
452 --- strongswan-2.7.0/programs/starter/starter.c 2006-02-15 19:37:46.000000000 +0100
453 +++ strongswan-2.7.0-patched/programs/starter/starter.c 2006-04-28 08:56:38.000000000 +0200
456 #include "starterwhack.h"
457 #include "invokepluto.h"
458 +#include "invokecharon.h"
463 #define FLAG_ACTION_RELOAD 0x04
464 #define FLAG_ACTION_QUIT 0x08
465 #define FLAG_ACTION_LISTEN 0x10
467 +#define FLAG_ACTION_START_CHARON 0x20
470 static unsigned int _action_ = 0;
474 if (pid == starter_pluto_pid())
477 + if (pid == starter_charon_pid())
478 + name = " (Charon)";
480 if (WIFSIGNALED(status))
482 DBG_log("child %d%s has been killed by sig %d\n",
485 if (pid == starter_pluto_pid())
486 starter_pluto_sigchild(pid);
488 + if (pid == starter_charon_pid())
489 + starter_charon_sigchild(pid);
497 _action_ |= FLAG_ACTION_START_PLUTO;
499 + _action_ |= FLAG_ACTION_START_CHARON;
505 signal(SIGQUIT, fsig);
506 signal(SIGALRM, fsig);
507 signal(SIGUSR1, fsig);
510 + plog("Starting strongSwan IPsec %s [starter]...", ipsec_version_code());
512 /* verify that we can start */
514 @@ -201,12 +219,24 @@
518 - if (stat(PID_FILE, &stb) == 0)
519 + if (stat(PLUTO_PID_FILE, &stb) == 0)
521 - plog("pluto is already running (%s exists) -- aborting", PID_FILE);
523 + plog("pluto is already running (%s exists) -- skipping pluto start", PLUTO_PID_FILE);
528 + _action_ |= FLAG_ACTION_START_PLUTO;
531 + if (stat(CHARON_PID_FILE, &stb) == 0)
533 + plog("charon is already running (%s exists) -- skipping charon start", CHARON_PID_FILE);
537 + _action_ |= FLAG_ACTION_START_CHARON;
540 if (stat(DEV_RANDOM, &stb) != 0)
542 plog("unable to start strongSwan IPsec -- no %s!", DEV_RANDOM);
545 last_reload = time(NULL);
547 - plog("Starting strongSwan IPsec %s [starter]...", ipsec_version_code());
548 + if (stat(MY_PID_FILE, &stb) == 0)
550 + plog("starter is already running (%s exists) -- no fork done", MY_PID_FILE);
554 /* fork if we're not debugging stuff */
556 @@ -296,17 +330,19 @@
557 , &cfg->defaultroute);
560 - _action_ = FLAG_ACTION_START_PLUTO;
565 - * Stop pluto (if started) and exit
567 + * Stop pluto/charon (if started) and exit
569 if (_action_ & FLAG_ACTION_QUIT)
571 if (starter_pluto_pid())
572 starter_stop_pluto();
574 + if (starter_charon_pid())
575 + starter_stop_charon();
578 starter_netkey_cleanup();
581 if (conn->state == STATE_ADDED)
583 starter_whack_del_conn(conn);
585 + starter_stroke_del_conn(conn);
587 conn->state = STATE_TO_ADD;
592 if (conn->state == STATE_ADDED)
593 starter_whack_del_conn(conn);
595 + starter_stroke_del_conn(conn);
599 /* Look for new ca sections that are already loaded */
601 conn->state = STATE_TO_ADD;
609 + if (_action_ & FLAG_ACTION_START_CHARON)
611 + if (starter_charon_pid() == 0)
614 + DBG_log("Attempting to start charon...")
616 + if (starter_start_charon(cfg, no_fork) != 0)
618 + /* schedule next try */
619 + alarm(PLUTO_RESTART_DELAY);
622 + _action_ &= ~FLAG_ACTION_START_CHARON;
627 * Tell pluto to reread its interfaces
628 @@ -536,11 +599,36 @@
631 starter_whack_add_conn(conn);
633 + starter_stroke_add_conn(conn);
635 conn->state = STATE_ADDED;
636 if (conn->startup == STARTUP_START)
637 - starter_whack_initiate_conn(conn);
640 + if (conn->keyexchange == 2)
642 + starter_stroke_initiate_conn(conn);
647 + starter_whack_initiate_conn(conn);
650 else if (conn->startup == STARTUP_ROUTE)
651 - starter_whack_route_conn(conn);
654 + if (conn->keyexchange == 2)
656 + starter_stroke_route_conn(conn);
661 + starter_whack_route_conn(conn);
667 diff -Naur strongswan-2.7.0/programs/starter/starterstroke.c strongswan-2.7.0-patched/programs/starter/starterstroke.c
668 --- strongswan-2.7.0/programs/starter/starterstroke.c 1970-01-01 01:00:00.000000000 +0100
669 +++ strongswan-2.7.0-patched/programs/starter/starterstroke.c 2006-04-28 08:56:38.000000000 +0200
671 +/* Stroke for charon is the counterpart to whack from pluto
672 + * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
674 + * This program is free software; you can redistribute it and/or modify it
675 + * under the terms of the GNU General Public License as published by the
676 + * Free Software Foundation; either version 2 of the License, or (at your
677 + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
679 + * This program is distributed in the hope that it will be useful, but
680 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
681 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
682 + * for more details.
684 + * RCSID $Id: starterstroke.c $
687 +#include <sys/types.h>
688 +#include <sys/socket.h>
690 +#include <linux/stddef.h>
694 +#include <netinet/in.h>
695 +#include <arpa/inet.h>
697 +#include <freeswan.h>
699 +#include "../pluto/constants.h"
700 +#include "../pluto/defs.h"
701 +#include "../pluto/log.h"
703 +#include "../charon/stroke/stroke.h"
705 +#include "starterstroke.h"
706 +#include "confread.h"
709 +static char* push_string(stroke_msg_t **strm, char *string)
711 + stroke_msg_t *stroke_msg;
712 + size_t string_length;
714 + if (string == NULL)
718 + stroke_msg = *strm;
719 + string_length = strlen(string) + 1;
720 + stroke_msg->length += string_length;
722 + stroke_msg = realloc(stroke_msg, stroke_msg->length);
723 + strcpy((char*)stroke_msg + stroke_msg->length - string_length, string);
725 + *strm = stroke_msg;
726 + return (char*)(u_int)stroke_msg->length - string_length;
730 +send_stroke_msg (stroke_msg_t *msg)
732 + struct sockaddr_un ctl_addr = { AF_UNIX, CHARON_CTL_FILE };
735 + sock = socket(AF_UNIX, SOCK_STREAM, 0);
738 + plog("socket() failed: %s", strerror(errno));
741 + if (connect(sock, (struct sockaddr *)&ctl_addr,
742 + offsetof(struct sockaddr_un, sun_path) + strlen(ctl_addr.sun_path)) < 0)
744 + plog("connect(charon_ctl) failed: %s", strerror(errno));
750 + if (write(sock, msg, msg->length) != msg->length)
752 + plog("write(charon_ctl) failed: %s", strerror(errno));
762 +connection_name(starter_conn_t *conn)
764 + /* if connection name is '%auto', create a new name like conn_xxxxx */
765 + static char buf[32];
767 + if (streq(conn->name, "%auto"))
769 + sprintf(buf, "conn_%ld", conn->id);
776 +int starter_stroke_add_conn(starter_conn_t *conn)
778 + stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
781 + msg->length = sizeof(stroke_msg_t);
782 + msg->type = STR_ADD_CONN;
784 + msg->add_conn.name = push_string(&msg, connection_name(conn));
786 + msg->add_conn.me.id = push_string(&msg, conn->left.id);
787 + msg->add_conn.me.cert = push_string(&msg, conn->left.cert);
788 + msg->add_conn.me.address = push_string(&msg, inet_ntoa(conn->left.addr.u.v4.sin_addr));
789 + msg->add_conn.me.subnet = push_string(&msg, inet_ntoa(conn->left.subnet.addr.u.v4.sin_addr));
790 + msg->add_conn.me.subnet_mask = conn->left.subnet.maskbits;
792 + msg->add_conn.other.id = push_string(&msg, conn->right.id);
793 + msg->add_conn.other.cert = push_string(&msg, conn->right.cert);
794 + msg->add_conn.other.address = push_string(&msg, inet_ntoa(conn->right.addr.u.v4.sin_addr));
795 + msg->add_conn.other.subnet = push_string(&msg, inet_ntoa(conn->right.subnet.addr.u.v4.sin_addr));
796 + msg->add_conn.other.subnet_mask = conn->right.subnet.maskbits;
798 + res = send_stroke_msg(msg);
803 +int starter_stroke_del_conn(starter_conn_t *conn)
807 +int starter_stroke_route_conn(starter_conn_t *conn)
809 + stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
812 + msg->length = sizeof(stroke_msg_t);
813 + msg->type = STR_INSTALL;
814 + msg->install.name = push_string(&msg, connection_name(conn));
815 + res = send_stroke_msg(msg);
820 +int starter_stroke_initiate_conn(starter_conn_t *conn)
822 + stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
825 + msg->length = sizeof(stroke_msg_t);
826 + msg->type = STR_INITIATE;
827 + msg->initiate.name = push_string(&msg, connection_name(conn));
828 + res = send_stroke_msg(msg);
832 diff -Naur strongswan-2.7.0/programs/starter/starterstroke.h strongswan-2.7.0-patched/programs/starter/starterstroke.h
833 --- strongswan-2.7.0/programs/starter/starterstroke.h 1970-01-01 01:00:00.000000000 +0100
834 +++ strongswan-2.7.0-patched/programs/starter/starterstroke.h 2006-04-28 08:56:38.000000000 +0200
836 +/* Stroke for charon is the counterpart to whack from pluto
837 + * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
839 + * This program is free software; you can redistribute it and/or modify it
840 + * under the terms of the GNU General Public License as published by the
841 + * Free Software Foundation; either version 2 of the License, or (at your
842 + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
844 + * This program is distributed in the hope that it will be useful, but
845 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
846 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
847 + * for more details.
849 + * RCSID $Id: starterstroke.h $
852 +#ifndef _STARTER_STROKE_H_
853 +#define _STARTER_STROKE_H_
855 +#include "confread.h"
857 +extern int starter_stroke_add_conn(starter_conn_t *conn);
858 +extern int starter_stroke_del_conn(starter_conn_t *conn);
859 +extern int starter_stroke_route_conn(starter_conn_t *conn);
860 +extern int starter_stroke_initiate_conn(starter_conn_t *conn);
862 +#endif /* _STARTER_STROKE_H_ */
863 diff -Naur strongswan-2.7.0/programs/starter/starterwhack.c strongswan-2.7.0-patched/programs/starter/starterwhack.c
864 --- strongswan-2.7.0/programs/starter/starterwhack.c 2006-04-17 12:32:36.000000000 +0200
865 +++ strongswan-2.7.0-patched/programs/starter/starterwhack.c 2006-04-28 08:56:38.000000000 +0200
868 send_whack_msg (whack_message_t *msg)
870 - struct sockaddr_un ctl_addr = { AF_UNIX, CTL_FILE };
871 + struct sockaddr_un ctl_addr = { AF_UNIX, PLUTO_CTL_FILE };
874 char *str_next, *str_roof;