More updates to new node/vertex/connection combo.

This commit is contained in:
Guus Sliepen 2001-10-10 20:35:10 +00:00
parent ea607d2d92
commit 0bbace18e9
4 changed files with 19 additions and 20 deletions

View file

@ -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."));

View file

@ -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 */

View file

@ -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*/

View file

@ -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__ */