added support for leftsendcert= and left|rightca= parameters

This commit is contained in:
Andreas Steffen
2006-06-09 05:50:41 +00:00
parent ac427e3677
commit b7f9ca5837
8 changed files with 114 additions and 30 deletions
+6
View File
@@ -24,6 +24,8 @@
#include <stdio.h>
#include <linux/stddef.h>
#include <types.h>
#include "stroke.h"
#define streq(a, b) (strcmp((a), (b)) == 0) /* clearer shorthand */
@@ -106,12 +108,16 @@ static int add_connection(char *name,
msg.add_conn.me.subnet = push_string(&msg, my_net);
msg.add_conn.me.subnet_mask = my_netmask;
msg.add_conn.me.cert = NULL;
msg.add_conn.me.ca = NULL;
msg.add_conn.me.sendcert = CERT_SEND_IF_ASKED;
msg.add_conn.other.id = push_string(&msg, other_id);
msg.add_conn.other.address = push_string(&msg, other_addr);
msg.add_conn.other.subnet = push_string(&msg, other_net);
msg.add_conn.other.subnet_mask = other_netmask;
msg.add_conn.other.cert = NULL;
msg.add_conn.other.ca = NULL;
msg.add_conn.other.sendcert = CERT_SEND_IF_ASKED;
return send_stroke_msg(&msg);
}
+14 -9
View File
@@ -30,6 +30,18 @@
#define STROKE_BUF_LEN 2048
typedef struct stroke_end_t stroke_end_t;
struct stroke_end_t {
char *id;
char *cert;
char *ca;
char *address;
char *subnet;
int subnet_mask;
certpolicy_t sendcert;
};
typedef struct stroke_msg_t stroke_msg_t;
/**
@@ -73,15 +85,8 @@ struct stroke_msg_t {
/* data for STR_ADD_CONN */
struct {
char *name;
/* is this connection handled by charon? */
int ikev2;
struct {
char *id;
char *cert;
char *address;
char *subnet;
int subnet_mask;
} me, other;
bool ikev2;
stroke_end_t me, other;
} add_conn;
struct {