From 0bbace18e96cd6fc32dfa23ffd55f73ff96e8c6f Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 10 Oct 2001 20:35:10 +0000 Subject: [PATCH] More updates to new node/vertex/connection combo. --- src/connection.c | 14 +++++++------- src/connection.h | 3 ++- src/node.h | 4 +--- src/vertex.h | 18 +++++++++--------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/connection.c b/src/connection.c index f01b2e7a..d606e9c3 100644 --- a/src/connection.c +++ b/src/connection.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: connection.c,v 1.1.2.18 2001/10/10 09:42:29 guus Exp $ + $Id: connection.c,v 1.1.2.19 2001/10/10 20:35:10 guus Exp $ */ #include "config.h" @@ -63,7 +63,7 @@ cp connection_t *new_connection(void) { cp - return (connection_t *)xmalloc_and_zero(sizeof(*c)); + return (connection_t *)xmalloc_and_zero(sizeof(connection_t)); } void free_connection(connection_t *c) @@ -73,10 +73,10 @@ cp free(c->hostname); if(c->rsa_key) RSA_free(c->rsa_key); - if(c->inpktkey) - free(c->inpktkey); - if(c->outpktkey) - free(c->outpktkey); + if(c->inkey) + free(c->inkey); + if(c->outkey) + free(c->outkey); if(c->mychallenge) free(c->mychallenge); if(c->hischallenge) @@ -121,7 +121,7 @@ cp c = (connection_t *)node->data; syslog(LOG_DEBUG, _(" %s at %s port %hd options %ld socket %d status %04x"), c->node->name, c->hostname, c->port, c->options, - cl->socket, c->status); + c->socket, c->status); } syslog(LOG_DEBUG, _("End of connections.")); diff --git a/src/connection.h b/src/connection.h index 9d38263a..9a35461f 100644 --- a/src/connection.h +++ b/src/connection.h @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: connection.h,v 1.1.2.15 2001/10/10 09:42:29 guus Exp $ + $Id: connection.h,v 1.1.2.16 2001/10/10 20:35:10 guus Exp $ */ #ifndef __TINC_CONNECTION_H__ @@ -72,6 +72,7 @@ typedef struct connection_t { int protocol_version; /* used protocol */ int socket; /* socket used for this connection */ + long int options; /* options for this connection */ status_bits_t status; /* status info */ struct node_t *node; /* node associated with the other end */ diff --git a/src/node.h b/src/node.h index e6b28d29..16bdb7c0 100644 --- a/src/node.h +++ b/src/node.h @@ -17,7 +17,7 @@ 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.3 2001/10/10 08:49:47 guus Exp $ + $Id: node.h,v 1.1.2.4 2001/10/10 20:35:10 guus Exp $ */ #ifndef __TINC_NODE_H__ @@ -34,8 +34,6 @@ typedef struct node_t { short unsigned int port; /* port number of UDP connection */ char *hostname; /* the hostname of its real ip */ - status_bits_t status; /* status info */ - EVP_CIPHER *cipher; /* Cipher type for UDP packets */ char *key; /* Cipher key and iv */ int keylength; /* Cipher key and iv length*/ diff --git a/src/vertex.h b/src/vertex.h index 9490f481..9b1ef2b9 100644 --- a/src/vertex.h +++ b/src/vertex.h @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: vertex.h,v 1.1.2.3 2001/10/10 08:49:47 guus Exp $ + $Id: vertex.h,v 1.1.2.4 2001/10/10 20:35:10 guus Exp $ */ #ifndef __TINC_VERTEX_H__ @@ -28,6 +28,14 @@ #include "node.h" #include "connection.h" +typedef struct halfconnection_t { + struct node_t *node; /* node associated with this end of the connection */ + + ipv4_t address; /* real (internet) ip on this end of the meta connection */ + short unsigned int port; /* port number of this end of the meta connection */ + char *hostname; /* the hostname of real ip */ +} halfconnection_t; + typedef struct vertex_t { struct halfconnection_t from; struct halfconnection_t to; @@ -38,14 +46,6 @@ typedef struct vertex_t { struct connection_t *connection; /* connection associated with this vertex, if available */ } vertex_t; -typedef struct halfconnection_t { - struct node_t *node; /* node associated with this end of the connection */ - - ipv4_t address; /* real (internet) ip on this end of the meta connection */ - short unsigned int port; /* port number of this end of the meta connection */ - char *hostname; /* the hostname of real ip */ -} halfconnection_t; - extern avl_tree_t *vertex_tree; /* Tree with all known vertices (replaces active_tree) */ #endif /* __TINC_VERTEX_H__ */ -- 2.20.1