diff options
Diffstat (limited to 'src/starter/cmp.c')
-rw-r--r-- | src/starter/cmp.c | 90 |
1 files changed, 44 insertions, 46 deletions
diff --git a/src/starter/cmp.c b/src/starter/cmp.c index 5abb8399b..8462a4819 100644 --- a/src/starter/cmp.c +++ b/src/starter/cmp.c @@ -10,8 +10,6 @@ * 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 3881 2008-04-27 11:04:13Z andreas $ */ #include <string.h> @@ -34,79 +32,79 @@ static bool starter_cmp_end(starter_end_t *c1, starter_end_t *c2) { - if ((c1 == NULL) || (c2 == NULL)) - return FALSE; - - if (c2->dns_failed) - { - c2->addr = c1->addr; - } - else - { - ADDCMP(addr); - } - ADDCMP(nexthop); - VARCMP(has_client); - VARCMP(has_client_wildcard); - VARCMP(has_port_wildcard); - VARCMP(has_natip); - VARCMP(has_virt); - VARCMP(modecfg); - VARCMP(port); - VARCMP(protocol); - - return cmp_args(KW_END_FIRST, KW_END_LAST, (char *)c1, (char *)c2); + if ((c1 == NULL) || (c2 == NULL)) + return FALSE; + + if (c2->dns_failed) + { + c2->addr = c1->addr; + } + else + { + ADDCMP(addr); + } + ADDCMP(nexthop); + VARCMP(has_client); + VARCMP(has_client_wildcard); + VARCMP(has_port_wildcard); + VARCMP(has_natip); + VARCMP(has_virt); + 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; + if ((c1 == NULL) || (c2 == NULL)) + return FALSE; - VARCMP(policy); - VARCMP(addr_family); - VARCMP(tunnel_addr_family); + 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; + 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); + 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; + if (c1 == NULL || c2 == NULL) + return FALSE; - return cmp_args(KW_CA_NAME, KW_CA_LAST, (char *)c1, (char *)c2); + 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; + if ((c1 == NULL) || (c2 == NULL)) + return FALSE; - return cmp_args(KW_KLIPS_FIRST, KW_KLIPS_LAST, (char *)c1, (char *)c2); + 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; + if ((c1 == NULL) || (c2 == NULL)) + return FALSE; - return cmp_args(KW_PLUTO_FIRST, KW_PLUTO_LAST, (char *)c1, (char *)c2); + 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; + if ((d1 == NULL) || (d2 == NULL)) + return FALSE; + return memcmp(d1, d2, sizeof(defaultroute_t)) == 0; } |