/*
subnet.c -- handle subnet lookups and lists
- Copyright (C) 2000-2002 Guus Sliepen <guus@sliepen.eu.org>,
- 2000-2002 Ivo Timmermans <ivo@o2w.nl>
+ Copyright (C) 2000-2003 Guus Sliepen <guus@sliepen.eu.org>,
+ 2000-2003 Ivo Timmermans <ivo@o2w.nl>
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
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: subnet.c,v 1.1.2.44 2003/07/06 22:11:33 guus Exp $
+ $Id: subnet.c,v 1.1.2.47 2003/07/17 15:06:27 guus Exp $
*/
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
+#include "system.h"
-#include "conf.h"
+#include "avl_tree.h"
+#include "logger.h"
#include "net.h"
+#include "netutl.h"
#include "node.h"
#include "subnet.h"
-#include "netutl.h"
-#include "logger.h"
-
-#include "system.h"
+#include "utils.h"
+#include "xalloc.h"
/* lists type of subnet */
/* Subnet comparison */
-int subnet_compare_mac(subnet_t *a, subnet_t *b)
+static int subnet_compare_mac(subnet_t *a, subnet_t *b)
{
int result;
return strcmp(a->owner->name, b->owner->name);
}
-int subnet_compare_ipv4(subnet_t *a, subnet_t *b)
+static int subnet_compare_ipv4(subnet_t *a, subnet_t *b)
{
int result;
return strcmp(a->owner->name, b->owner->name);
}
-int subnet_compare_ipv6(subnet_t *a, subnet_t *b)
+static int subnet_compare_ipv6(subnet_t *a, subnet_t *b)
{
int result;
return strcmp(a->owner->name, b->owner->name);
}
-int subnet_compare(subnet_t *a, subnet_t *b)
+static int subnet_compare(subnet_t *a, subnet_t *b)
{
int result;
case SUBNET_IPV6:
return subnet_compare_ipv6(a, b);
default:
- logger(DEBUG_ALWAYS, LOG_ERR, _("subnet_compare() was called with unknown subnet type %d, exitting!"),
+ logger(LOG_ERR, _("subnet_compare() was called with unknown subnet type %d, exitting!"),
a->type);
cp_trace();
exit(0);
break;
default:
- logger(DEBUG_ALWAYS, LOG_ERR,
+ logger(LOG_ERR,
_("net2str() was called with unknown subnet type %d, exiting!"),
subnet->type);
cp_trace();
cp();
- logger(DEBUG_ALWAYS, LOG_DEBUG, _("Subnet list:"));
+ logger(LOG_DEBUG, _("Subnet list:"));
for(node = subnet_tree->head; node; node = node->next) {
subnet = (subnet_t *) node->data;
netstr = net2str(subnet);
- logger(DEBUG_ALWAYS, LOG_DEBUG, _(" %s owner %s"), netstr, subnet->owner->name);
+ logger(LOG_DEBUG, _(" %s owner %s"), netstr, subnet->owner->name);
free(netstr);
}
- logger(DEBUG_ALWAYS, LOG_DEBUG, _("End of subnet list."));
+ logger(LOG_DEBUG, _("End of subnet list."));
}