X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnode.h;h=7a2ed1eeb723408aadcdb615ac2b0977f1181cad;hb=158cbe99f972a1613b7d4d95abfe5fe48e019e67;hp=662ad68311b7ad0e53b8ac138fd9c038a4339f35;hpb=eef25266cb862b5e2c24450d158d99e3cb43e511;p=meshlink diff --git a/src/node.h b/src/node.h index 662ad683..7a2ed1ee 100644 --- a/src/node.h +++ b/src/node.h @@ -1,7 +1,6 @@ /* node.h -- header for node.c - Copyright (C) 2001-2012 Guus Sliepen , - 2001-2005 Ivo Timmermans + Copyright (C) 2014 Guus Sliepen 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 @@ -26,7 +25,6 @@ #include "connection.h" #include "digest.h" #include "event.h" -#include "subnet.h" typedef struct node_status_t { unsigned int unused_active:1; /* 1 if active (not used for nodes) */ @@ -37,7 +35,8 @@ typedef struct node_status_t { unsigned int indirect:1; /* 1 if this node is not directly reachable by us */ unsigned int sptps:1; /* 1 if this node supports SPTPS */ unsigned int udp_confirmed:1; /* 1 if the address is one that we received UDP traffic on */ - unsigned int unused:24; + unsigned int broadcast:1; /* 1 if the next UDP packet should be broadcast to the local network */ + unsigned int unused:23; } node_status_t; typedef struct node_t { @@ -52,14 +51,14 @@ typedef struct node_t { time_t last_state_change; time_t last_req_key; - ecdsa_t ecdsa; /* His public ECDSA key */ + ecdsa_t *ecdsa; /* His public ECDSA key */ sptps_t sptps; - cipher_t incipher; /* Cipher for UDP packets */ - digest_t indigest; /* Digest for UDP packets */ + cipher_t *incipher; /* Cipher for UDP packets */ + digest_t *indigest; /* Digest for UDP packets */ - cipher_t outcipher; /* Cipher for UDP packets */ - digest_t outdigest; /* Digest for UDP packets */ + cipher_t *outcipher; /* Cipher for UDP packets */ + digest_t *outdigest; /* Digest for UDP packets */ int incompression; /* Compressionlevel, 0 = no compression */ int outcompression; /* Compressionlevel, 0 = no compression */ @@ -69,8 +68,6 @@ typedef struct node_t { struct edge_t *prevedge; /* nearest node from him to us */ struct node_t *via; /* next hop for UDP packets */ - splay_tree_t *subnet_tree; /* Pointer to a tree of subnets belonging to this node */ - splay_tree_t *edge_tree; /* Edges with this node as one of the endpoints */ struct connection_t *connection; /* Connection associated with this node (if a direct connection exists) */ @@ -78,7 +75,8 @@ typedef struct node_t { uint32_t sent_seqno; /* Sequence number last sent to this node */ uint32_t received_seqno; /* Sequence number last received from this node */ uint32_t received; /* Total valid packets received from this node */ - uint32_t farfuture; /* Packets in a row that have arrived from the far future */ + uint32_t prev_received_seqno; + uint32_t prev_received; unsigned char* late; /* Bitfield marking late packets */ length_t mtu; /* Maximum size of packets to send to this node */ @@ -86,6 +84,11 @@ typedef struct node_t { length_t maxmtu; /* Probed maximum MTU */ int mtuprobes; /* Number of probes */ timeout_t mtutimeout; /* Probe event */ + struct timeval probe_time; /* Time the last probe was sent or received */ + int probe_counter; /* Number of probes received since last burst was sent */ + float rtt; /* Last measured round trip time */ + float bandwidth; /* Last measured bandwidth */ + float packetloss; /* Last measured packet loss rate */ uint64_t in_packets; uint64_t in_bytes; @@ -104,8 +107,6 @@ extern void node_add(node_t *); extern void node_del(node_t *); extern node_t *lookup_node(char *); extern node_t *lookup_node_udp(const sockaddr_t *); -extern bool dump_nodes(struct connection_t *); -extern bool dump_traffic(struct connection_t *); extern void update_node_udp(node_t *, const sockaddr_t *); #endif /* __TINC_NODE_H__ */