diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-04-30 11:37:54 +0000 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-04-30 11:37:54 +0000 |
commit | d24a74c5b4fb62b720a79b632021746b69de7c45 (patch) | |
tree | fd8854673b9d72059d7f9459a82663d5a70617ce /src/starter/starterstroke.c | |
parent | 466f11bfaf56c389947b2cbee6dd4f1fb56a821e (diff) | |
download | strongswan-d24a74c5b4fb62b720a79b632021746b69de7c45.tar.bz2 strongswan-d24a74c5b4fb62b720a79b632021746b69de7c45.tar.xz |
merging changes from portability branch back to trunk
important change for developers: %Y replaces %D to print identities!
Diffstat (limited to 'src/starter/starterstroke.c')
-rw-r--r-- | src/starter/starterstroke.c | 24 |
1 files changed, 18 insertions, 6 deletions
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)) |