- changed config load strategy:
[strongswan.git] / src / starter / starterstroke.c
index 15e6462..e480227 100644 (file)
 
 #include <freeswan.h>
 
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-#include "../pluto/log.h"
+#include <constants.h>
+#include <defs.h>
+#include <log.h>
 
-#include "../charon/stroke/stroke.h"
+#include <stroke.h>
 
 #include "starterstroke.h"
 #include "confread.h"
 #include "files.h"
 
-static char* push_string(stroke_msg_t **strm, char *string)
+static char* 
+push_string(stroke_msg_t **strm, char *string)
 {
     stroke_msg_t *stroke_msg;
     size_t string_length;
@@ -92,14 +93,14 @@ send_stroke_msg (stroke_msg_t *msg)
     }
     if (byte_count < 0)
     {
-       plog(stderr, "read() failed: %s", strerror(errno));
+       plog("read() failed: %s", strerror(errno));
     }
 
     close(sock);
     return 0;
 }
 
-static char *
+static char*
 connection_name(starter_conn_t *conn)
 {
     /* if connection name is '%auto', create a new name like conn_xxxxx */
@@ -114,7 +115,8 @@ connection_name(starter_conn_t *conn)
 }
 
 
-int starter_stroke_add_conn(starter_conn_t *conn)
+int 
+starter_stroke_add_conn(starter_conn_t *conn)
 {
     stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
     int res;
@@ -123,6 +125,7 @@ int starter_stroke_add_conn(starter_conn_t *conn)
     msg->type = STR_ADD_CONN;
 
     msg->add_conn.name = push_string(&msg, connection_name(conn));
+       msg->add_conn.ikev2 = conn->keyexchange == KEY_EXCHANGE_IKEV2 ? 1 : 0;
 
     msg->add_conn.me.id = push_string(&msg, conn->left.id);
     msg->add_conn.me.cert = push_string(&msg, conn->left.cert);
@@ -141,11 +144,14 @@ int starter_stroke_add_conn(starter_conn_t *conn)
     return res;
 }
 
-int starter_stroke_del_conn(starter_conn_t *conn)
+int 
+starter_stroke_del_conn(starter_conn_t *conn)
 {
     return 0;
 }
-int starter_stroke_route_conn(starter_conn_t *conn)
+
+int 
+starter_stroke_route_conn(starter_conn_t *conn)
 {
     stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
     int res;
@@ -158,7 +164,8 @@ int starter_stroke_route_conn(starter_conn_t *conn)
     return res;
 }
 
-int starter_stroke_initiate_conn(starter_conn_t *conn)
+int 
+starter_stroke_initiate_conn(starter_conn_t *conn)
 {
     stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
     int res;