2 subnet.c -- handle subnet lookups and lists
3 Copyright (C) 2000 Guus Sliepen <guus@sliepen.warande.net>,
4 2000 Ivo Timmermans <itimmermans@bigfoot.com>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 $Id: subnet.c,v 1.1.2.1 2000/10/01 03:21:49 guus Exp $
27 /* Allocating and freeing space for subnets */
29 subnet_t *new_subnet(void)
35 void free_subnet(subnet_t *subnet)
41 /* Linked list management */
43 int subnet_add(conn_list_t *cl, subnet_t *subnet)
46 subnet->next = cl->subnets->next;
48 subnet->next->prev = subnet
54 int subnet_del(conn_list_t *cl, subnet_t *subnet)
59 subnet->prev->next = subnet->next;
63 subnet->owner->subnets = subnet->next;
66 subnet->next->prev = subnet->prev;
72 /* Ascii representation of subnets */
74 subnet_t *str2net(char *subnetstr)
80 char *net2str(subnet_t *subnet)
86 /* Subnet lookup routines */