/*
node.h -- header for node.c
- Copyright (C) 2001-2002 Guus Sliepen <guus@sliepen.eu.org>,
- 2001-2002 Ivo Timmermans <ivo@o2w.nl>
+ Copyright (C) 2001-2003 Guus Sliepen <guus@sliepen.eu.org>,
+ 2001-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: node.h,v 1.1.2.22 2003/05/06 21:13:18 guus Exp $
+ $Id: node.h,v 1.1.2.27 2003/07/24 12:08:15 guus Exp $
*/
#ifndef __TINC_NODE_H__
#define __TINC_NODE_H__
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include <avl_tree.h>
-
-#include "subnet.h"
+#include "avl_tree.h"
#include "connection.h"
+#include "list.h"
+#include "subnet.h"
typedef struct node_status_t {
int active:1; /* 1 if active.. */
sockaddr_t address; /* his real (internet) ip to send UDP packets to */
char *hostname; /* the hostname of its real ip */
- struct node_status_t status;
+ node_status_t status;
const EVP_CIPHER *cipher; /* Cipher type for UDP packets */
char *key; /* Cipher key and iv */
extern void init_nodes(void);
extern void exit_nodes(void);
-extern node_t *new_node(void);
+extern node_t *new_node(void) __attribute__ ((malloc));
extern void free_node(node_t *);
extern void node_add(node_t *);
extern void node_del(node_t *);
-extern node_t *lookup_node(char *);
-extern node_t *lookup_node_udp(sockaddr_t *);
+extern node_t *lookup_node(const char *);
+extern node_t *lookup_node_udp(const sockaddr_t *);
extern void dump_nodes(void);
#endif /* __TINC_NODE_H__ */