aboutsummaryrefslogtreecommitdiffstats
path: root/src/starter
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-07-31 10:00:57 +0200
committerMartin Willi <martin@revosec.ch>2012-08-21 09:38:00 +0200
commit17319aa28d0aa63847dccd76c7c6acb00037e9f9 (patch)
treea04b9938ca6ded0ff23e2e704122fbaa3402a3df /src/starter
parentf26796deb5614a2a1a5e67fe1f5bac3f77a07cb1 (diff)
downloadstrongswan-17319aa28d0aa63847dccd76c7c6acb00037e9f9.tar.bz2
strongswan-17319aa28d0aa63847dccd76c7c6acb00037e9f9.tar.xz
Add a left/rightdns keyword to configure connection specific DNS attributes
Diffstat (limited to 'src/starter')
-rw-r--r--src/starter/args.c1
-rw-r--r--src/starter/confread.h1
-rw-r--r--src/starter/keywords.h3
-rw-r--r--src/starter/keywords.txt2
-rw-r--r--src/starter/starterstroke.c1
5 files changed, 8 insertions, 0 deletions
diff --git a/src/starter/args.c b/src/starter/args.c
index 640cc43d6..13ffec61d 100644
--- a/src/starter/args.c
+++ b/src/starter/args.c
@@ -186,6 +186,7 @@ static const token_info_t token_info[] =
{ ARG_STR, offsetof(starter_end_t, subnet), NULL },
{ ARG_MISC, 0, NULL /* KW_PROTOPORT */ },
{ ARG_STR, offsetof(starter_end_t, sourceip), NULL },
+ { ARG_STR, offsetof(starter_end_t, dns), NULL },
{ ARG_MISC, 0, NULL /* KW_NATIP */ },
{ ARG_ENUM, offsetof(starter_end_t, firewall), LST_bool },
{ ARG_ENUM, offsetof(starter_end_t, hostaccess), LST_bool },
diff --git a/src/starter/confread.h b/src/starter/confread.h
index 0c284229b..55022ff65 100644
--- a/src/starter/confread.h
+++ b/src/starter/confread.h
@@ -113,6 +113,7 @@ struct starter_end {
u_int8_t protocol;
char *sourceip;
int sourceip_mask;
+ char *dns;
};
typedef struct also also_t;
diff --git a/src/starter/keywords.h b/src/starter/keywords.h
index bd9affe6c..96609e166 100644
--- a/src/starter/keywords.h
+++ b/src/starter/keywords.h
@@ -97,6 +97,7 @@ typedef enum {
KW_SUBNET,
KW_PROTOPORT,
KW_SOURCEIP,
+ KW_DNS,
KW_NATIP,
KW_FIREWALL,
KW_HOSTACCESS,
@@ -126,6 +127,7 @@ typedef enum {
KW_LEFTSUBNET,
KW_LEFTPROTOPORT,
KW_LEFTSOURCEIP,
+ KW_LEFTDNS,
KW_LEFTNATIP,
KW_LEFTFIREWALL,
KW_LEFTHOSTACCESS,
@@ -155,6 +157,7 @@ typedef enum {
KW_RIGHTSUBNET,
KW_RIGHTPROTOPORT,
KW_RIGHTSOURCEIP,
+ KW_RIGHTDNS,
KW_RIGHTNATIP,
KW_RIGHTFIREWALL,
KW_RIGHTHOSTACCESS,
diff --git a/src/starter/keywords.txt b/src/starter/keywords.txt
index 30d89f924..f4d1f477a 100644
--- a/src/starter/keywords.txt
+++ b/src/starter/keywords.txt
@@ -85,6 +85,7 @@ leftsubnet, KW_LEFTSUBNET
leftsubnetwithin, KW_LEFTSUBNET
leftprotoport, KW_LEFTPROTOPORT
leftsourceip, KW_LEFTSOURCEIP
+leftdns, KW_LEFTDNS
leftnatip, KW_LEFTNATIP
leftfirewall, KW_LEFTFIREWALL
lefthostaccess, KW_LEFTHOSTACCESS
@@ -109,6 +110,7 @@ rightsubnet, KW_RIGHTSUBNET
rightsubnetwithin, KW_RIGHTSUBNET
rightprotoport, KW_RIGHTPROTOPORT
rightsourceip, KW_RIGHTSOURCEIP
+rightdns, KW_RIGHTDNS
rightnatip, KW_RIGHTNATIP
rightfirewall, KW_RIGHTFIREWALL
righthostaccess, KW_RIGHTHOSTACCESS
diff --git a/src/starter/starterstroke.c b/src/starter/starterstroke.c
index 0fbc5d245..79bb0ba31 100644
--- a/src/starter/starterstroke.c
+++ b/src/starter/starterstroke.c
@@ -141,6 +141,7 @@ static void starter_stroke_add_end(stroke_msg_t *msg, stroke_end_t *msg_end, sta
msg_end->subnets = push_string(msg, conn_end->subnet);
msg_end->sourceip = push_string(msg, conn_end->sourceip);
msg_end->sourceip_mask = conn_end->sourceip_mask;
+ msg_end->dns = push_string(msg, conn_end->dns);
msg_end->sendcert = conn_end->sendcert;
msg_end->hostaccess = conn_end->hostaccess;
msg_end->tohost = !conn_end->subnet;