2 subnet.h -- header for subnet.c
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.h,v 1.1.2.3 2000/10/11 22:01:02 guus Exp $
23 #ifndef __TINC_SUBNET_H__
24 #define __TINC_SUBNET_H__
35 typedef struct subnet_mac_t
40 typedef struct subnet_ipv4_t
46 typedef struct subnet_ipv6_t
52 typedef struct subnet_t {
53 struct conn_list_t *owner; /* the owner of this subnet */
54 struct conn_list_t *uplink; /* the uplink which we should send packets to for this subnet */
56 struct subnet_t *prev; /* previous subnet_t for this owner */
57 struct subnet_t *next; /* next subnet_t for this owner */
59 int type; /* subnet type (IPv4? IPv6? MAC? something even weirder?) */
61 /* And now for the actual subnet: */
74 extern subnet_t *new_subnet(void);
75 extern void free_subnet(subnet_t *);
76 extern void subnet_add(struct conn_list_t *, subnet_t *);
77 extern void subnet_del(subnet_t *);
78 extern char *net2str(subnet_t *);
79 extern subnet_t *str2net(char *);
80 extern subnet_t *lookup_subnet_mac(subnet_t *, mac_t);
81 extern subnet_t *lookup_subnet_ipv4(subnet_t *, ipv4_t);
82 extern subnet_t *lookup_subnet_ipv6(subnet_t *, ipv6_t);
85 #endif /* __TINC_SUBNET_H__ */