]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Add a left/rightdns keyword to configure connection specific DNS attributes
authorMartin Willi <martin@revosec.ch>
Tue, 31 Jul 2012 08:00:57 +0000 (10:00 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 21 Aug 2012 07:38:00 +0000 (09:38 +0200)
src/libcharon/plugins/stroke/stroke_socket.c
src/starter/args.c
src/starter/confread.h
src/starter/keywords.h
src/starter/keywords.txt
src/starter/starterstroke.c
src/stroke/stroke_msg.h

index 6bf65cc7e69e02c7f26e205400adae88342dc186..427a5e83fb7e009fa4027c968b7cb08a10977ecb 100644 (file)
@@ -171,6 +171,7 @@ static void pop_end(stroke_msg_t *msg, const char* label, stroke_end_t *end)
        pop_string(msg, &end->address);
        pop_string(msg, &end->subnets);
        pop_string(msg, &end->sourceip);
+       pop_string(msg, &end->dns);
        pop_string(msg, &end->auth);
        pop_string(msg, &end->auth2);
        pop_string(msg, &end->id);
@@ -188,6 +189,7 @@ static void pop_end(stroke_msg_t *msg, const char* label, stroke_end_t *end)
        DBG2(DBG_CFG, "  %s=%s", label, end->address);
        DBG2(DBG_CFG, "  %ssubnet=%s", label, end->subnets);
        DBG2(DBG_CFG, "  %ssourceip=%s", label, end->sourceip);
+       DBG2(DBG_CFG, "  %sdns=%s", label, end->dns);
        DBG2(DBG_CFG, "  %sauth=%s", label, end->auth);
        DBG2(DBG_CFG, "  %sauth2=%s", label, end->auth2);
        DBG2(DBG_CFG, "  %sid=%s", label, end->id);
index 640cc43d6cb242de1c5efd58114534fc8db61b70..13ffec61dbf9c8486eb8e3f1807e2b8d7b4f620a 100644 (file)
@@ -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                      },
index 0c284229bad8c0a61619a1ae46ff2e560e0c3871..55022ff65c2240fe85c38f6b92ad592153879c4a 100644 (file)
@@ -113,6 +113,7 @@ struct starter_end {
                u_int8_t        protocol;
                char            *sourceip;
                int                             sourceip_mask;
+               char            *dns;
 };
 
 typedef struct also also_t;
index bd9affe6c3cdf689b8b91681b058636ed9974952..96609e1662be158cbf82275943436eb9d59320c5 100644 (file)
@@ -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,
index 30d89f9247b2f4284137f5e7f46008ea58e3b631..f4d1f477a6915a9657ac40048457761a04088925 100644 (file)
@@ -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
index 0fbc5d24560c1efb72bc430e8615b0e455ffcbd4..79bb0ba31db98ed83847fe1f66a2ebcdc33be25e 100644 (file)
@@ -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;
index 95de7d69b90921395ca520e60f4c45f8fc0ee8fa..c941aaf4c526a5438ed807a56bdd77b0fc90f71d 100644 (file)
@@ -159,6 +159,7 @@ struct stroke_end_t {
        u_int16_t ikeport;
        char *sourceip;
        int sourceip_mask;
+       char *dns;
        char *subnets;
        int sendcert;
        int hostaccess;