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"
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)
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)
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."));
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__
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 */
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__
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*/
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__
#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;
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__ */