summaryrefslogtreecommitdiff
path: root/programs/starter/cmp.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2007-04-12 20:41:31 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2007-04-12 20:41:31 +0000
commit774a362e87feab25f1be16fbca08269ddc7121a4 (patch)
treecf71f4e7466468ac3edc2127125f333224a9acfb /programs/starter/cmp.c
parentc54a140a445bfe7aa66721f68bb0781f26add91c (diff)
downloadvyos-strongswan-774a362e87feab25f1be16fbca08269ddc7121a4.tar.gz
vyos-strongswan-774a362e87feab25f1be16fbca08269ddc7121a4.zip
Major new upstream release, just ran svn-upgrade for now (and wrote some
debian/changelong entries).
Diffstat (limited to 'programs/starter/cmp.c')
-rw-r--r--programs/starter/cmp.c105
1 files changed, 0 insertions, 105 deletions
diff --git a/programs/starter/cmp.c b/programs/starter/cmp.c
deleted file mode 100644
index 9222bf58f..000000000
--- a/programs/starter/cmp.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* strongSwan IPsec starter comparison functions
- * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * RCSID $Id: cmp.c,v 1.12 2006/01/13 18:03:25 as Exp $
- */
-
-#include <string.h>
-
-#include <freeswan.h>
-
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-
-#include "confread.h"
-#include "args.h"
-#include "interfaces.h"
-#include "cmp.h"
-
-#define VARCMP(obj) if (c1->obj != c2->obj) return FALSE
-#define ADDCMP(obj) if (!sameaddr(&c1->obj,&c2->obj)) return FALSE
-#define SUBCMP(obj) if (!samesubnet(&c1->obj,&c2->obj)) return FALSE
-
-static bool
-starter_cmp_end(starter_end_t *c1, starter_end_t *c2)
-{
- if ((c1 == NULL) || (c2 == NULL))
- return FALSE;
-
- ADDCMP(addr);
- ADDCMP(nexthop);
- ADDCMP(srcip);
- SUBCMP(subnet);
- VARCMP(has_client);
- VARCMP(has_client_wildcard);
- VARCMP(has_port_wildcard);
- VARCMP(has_srcip);
- VARCMP(modecfg);
- VARCMP(port);
- VARCMP(protocol);
-
- return cmp_args(KW_END_FIRST, KW_END_LAST, (char *)c1, (char *)c2);
- }
-
-bool
-starter_cmp_conn(starter_conn_t *c1, starter_conn_t *c2)
-{
- if ((c1 == NULL) || (c2 == NULL))
- return FALSE;
-
- VARCMP(policy);
- VARCMP(addr_family);
- VARCMP(tunnel_addr_family);
-
- if (!starter_cmp_end(&c1->left, &c2->left))
- return FALSE;
- if (!starter_cmp_end(&c1->right, &c2->right))
- return FALSE;
-
- return cmp_args(KW_CONN_NAME, KW_CONN_LAST, (char *)c1, (char *)c2);
-}
-
-bool
-starter_cmp_ca(starter_ca_t *c1, starter_ca_t *c2)
-{
- if (c1 == NULL || c2 == NULL)
- return FALSE;
-
- return cmp_args(KW_CA_NAME, KW_CA_LAST, (char *)c1, (char *)c2);
-}
-
-bool
-starter_cmp_klips(starter_config_t *c1, starter_config_t *c2)
-{
- if ((c1 == NULL) || (c2 == NULL))
- return FALSE;
-
- return cmp_args(KW_KLIPS_FIRST, KW_KLIPS_LAST, (char *)c1, (char *)c2);
-}
-
-bool
-starter_cmp_pluto(starter_config_t *c1, starter_config_t *c2)
-{
- if ((c1 == NULL) || (c2 == NULL))
- return FALSE;
-
- return cmp_args(KW_PLUTO_FIRST, KW_PLUTO_LAST, (char *)c1, (char *)c2);
-}
-
-bool
-starter_cmp_defaultroute(defaultroute_t *d1, defaultroute_t *d2)
-{
- if ((d1 == NULL) || (d2 == NULL))
- return FALSE;
- return memcmp(d1, d2, sizeof(defaultroute_t)) == 0;
-}