* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: whack.c,v 1.21 2006/04/20 04:42:12 as Exp $
+ * RCSID $Id$
*/
#include <stdio.h>
msg.ike = NULL;
msg.pfsgroup = NULL;
+ /* if a connection is added via whack then we assume IKEv1 */
+ msg.ikev1 = TRUE;
+
msg.sa_ike_life_seconds = OAKLEY_ISAKMP_SA_LIFETIME_DEFAULT;
msg.sa_ipsec_life_seconds = PLUTO_SA_LIFE_DURATION_DEFAULT;
msg.sa_rekey_margin = SA_REPLACEMENT_MARGIN_DEFAULT;
if (end_seen & LELEM(END_CLIENTWITHIN - END_FIRST))
diag("--client conflicts with --clientwithin");
tunnel_af_used_by = long_opts[long_index].name;
-#ifdef VIRTUAL_IP
if ((strlen(optarg) >= 6 && strncmp(optarg,"vhost:",6) == 0)
|| (strlen(optarg) >= 5 && strncmp(optarg,"vnet:",5) == 0))
{
diagq(ttosubnet(optarg, 0, msg.tunnel_addr_family, &msg.right.client), optarg);
msg.right.has_client = TRUE;
}
-#else
- diagq(ttosubnet(optarg, 0, msg.tunnel_addr_family, &msg.right.client), optarg);
- msg.right.has_client = TRUE;
-#endif
msg.policy |= POLICY_TUNNEL; /* client => tunnel */
continue;
|| !pack_str(&msg.left.ca) /* string 4 */
|| !pack_str(&msg.left.groups) /* string 5 */
|| !pack_str(&msg.left.updown) /* string 6 */
-#ifdef VIRTUAL_IP
- || !pack_str(&msg.left.virt)
-#endif
- || !pack_str(&msg.right.id) /* string 7 */
- || !pack_str(&msg.right.cert) /* string 8 */
- || !pack_str(&msg.right.ca) /* string 9 */
- || !pack_str(&msg.right.groups) /* string 10 */
- || !pack_str(&msg.right.updown) /* string 11 */
-#ifdef VIRTUAL_IP
- || !pack_str(&msg.right.virt)
-#endif
- || !pack_str(&msg.keyid) /* string 12 */
- || !pack_str(&msg.myid) /* string 13 */
- || !pack_str(&msg.cacert) /* string 14 */
- || !pack_str(&msg.ldaphost) /* string 15 */
- || !pack_str(&msg.ldapbase) /* string 16 */
- || !pack_str(&msg.crluri) /* string 17 */
- || !pack_str(&msg.crluri2) /* string 18 */
- || !pack_str(&msg.ocspuri) /* string 19 */
- || !pack_str(&msg.ike) /* string 20 */
- || !pack_str(&msg.esp) /* string 21 */
- || !pack_str(&msg.sc_data) /* string 22 */
+ || !pack_str(&msg.left.virt) /* string 7 */
+ || !pack_str(&msg.right.id) /* string 8 */
+ || !pack_str(&msg.right.cert) /* string 9 */
+ || !pack_str(&msg.right.ca) /* string 10 */
+ || !pack_str(&msg.right.groups) /* string 11 */
+ || !pack_str(&msg.right.updown) /* string 12 */
+ || !pack_str(&msg.right.virt) /* string 13 */
+ || !pack_str(&msg.keyid) /* string 14 */
+ || !pack_str(&msg.myid) /* string 15 */
+ || !pack_str(&msg.cacert) /* string 16 */
+ || !pack_str(&msg.ldaphost) /* string 17 */
+ || !pack_str(&msg.ldapbase) /* string 18 */
+ || !pack_str(&msg.crluri) /* string 19 */
+ || !pack_str(&msg.crluri2) /* string 20 */
+ || !pack_str(&msg.ocspuri) /* string 21 */
+ || !pack_str(&msg.ike) /* string 22 */
+ || !pack_str(&msg.esp) /* string 23 */
+ || !pack_str(&msg.sc_data) /* string 24 */
|| str_roof - next_str < (ptrdiff_t)msg.keyval.len) /* chunk (sort of string 5) */
diag("too many bytes of strings to fit in message to pluto");