struct node_t *to;
sockaddr_t address;
- uint32_t options; /* options turned on for this edge */
- int weight; /* weight of this edge */
+ uint32_t options; /* options turned on for this edge */
+ int weight; /* weight of this edge */
- struct connection_t *connection; /* connection associated with this edge, if available */
- struct edge_t *reverse; /* edge in the opposite direction, if available */
+ struct connection_t *connection; /* connection associated with this edge, if available */
+ struct edge_t *reverse; /* edge in the opposite direction, if available */
} edge_t;
-extern avl_tree_t *edge_weight_tree; /* Tree with all known edges sorted on weight */
+extern avl_tree_t *edge_weight_tree; /* Tree with all known edges sorted on weight */
extern void init_edges(void);
extern void exit_edges(void);
#ifndef HAVE_STRUCT_ADDRINFO
struct addrinfo {
- int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
- int ai_family; /* PF_xxx */
- int ai_socktype; /* SOCK_xxx */
- int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
- size_t ai_addrlen; /* length of ai_addr */
- char *ai_canonname; /* canonical name for hostname */
- struct sockaddr *ai_addr; /* binary address */
- struct addrinfo *ai_next; /* next structure in linked list */
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ size_t ai_addrlen; /* length of ai_addr */
+ char *ai_canonname; /* canonical name for hostname */
+ struct sockaddr *ai_addr; /* binary address */
+ struct addrinfo *ai_next; /* next structure in linked list */
};
#endif /* !HAVE_STRUCT_ADDRINFO */
*/
typedef enum debug_t {
- DEBUG_NOTHING = 0, /* Quiet mode, only show starting/stopping of the daemon */
+ DEBUG_NOTHING = 0, /* Quiet mode, only show starting/stopping of the daemon */
DEBUG_ALWAYS = 0,
- DEBUG_CONNECTIONS = 1, /* Show (dis)connects of other tinc daemons via TCP */
- DEBUG_ERROR = 2, /* Show error messages received from other hosts */
- DEBUG_STATUS = 2, /* Show status messages received from other hosts */
- DEBUG_PROTOCOL = 3, /* Show the requests that are sent/received */
- DEBUG_META = 4, /* Show contents of every request that is sent/received */
- DEBUG_TRAFFIC = 5, /* Show network traffic information */
- DEBUG_PACKET = 6, /* Show contents of each packet that is being sent/received */
- DEBUG_SCARY_THINGS = 10 /* You have been warned */
+ DEBUG_CONNECTIONS = 1, /* Show (dis)connects of other tinc daemons via TCP */
+ DEBUG_ERROR = 2, /* Show error messages received from other hosts */
+ DEBUG_STATUS = 2, /* Show status messages received from other hosts */
+ DEBUG_PROTOCOL = 3, /* Show the requests that are sent/received */
+ DEBUG_META = 4, /* Show contents of every request that is sent/received */
+ DEBUG_TRAFFIC = 5, /* Show network traffic information */
+ DEBUG_PACKET = 6, /* Show contents of each packet that is being sent/received */
+ DEBUG_SCARY_THINGS = 10, /* You have been warned */
} debug_t;
typedef enum logmode_t {
#include "ipv6.h"
#ifdef ENABLE_JUMBOGRAMS
-#define MTU 9018 /* 9000 bytes payload + 14 bytes ethernet header + 4 bytes VLAN tag */
+#define MTU 9018 /* 9000 bytes payload + 14 bytes ethernet header + 4 bytes VLAN tag */
#else
-#define MTU 1518 /* 1500 bytes payload + 14 bytes ethernet header + 4 bytes VLAN tag */
+#define MTU 1518 /* 1500 bytes payload + 14 bytes ethernet header + 4 bytes VLAN tag */
#endif
-#define MAXSIZE (MTU + 4 + EVP_MAX_BLOCK_LENGTH + EVP_MAX_MD_SIZE + MTU/64 + 20) /* MTU + seqno + padding + HMAC + compressor overhead */
-#define MAXBUFSIZE ((MAXSIZE > 2048 ? MAXSIZE : 2048) + 128) /* Enough room for a request with a MAXSIZEd packet or a 8192 bits RSA key */
+#define MAXSIZE (MTU + 4 + EVP_MAX_BLOCK_LENGTH + EVP_MAX_MD_SIZE + MTU/64 + 20) /* MTU + seqno + padding + HMAC + compressor overhead */
+#define MAXBUFSIZE ((MAXSIZE > 2048 ? MAXSIZE : 2048) + 128) /* Enough room for a request with a MAXSIZEd packet or a 8192 bits RSA key */
-#define MAXSOCKETS 128 /* Overkill... */
+#define MAXSOCKETS 128 /* Overkill... */
typedef struct mac_t {
uint8_t x[6];
#endif
typedef struct vpn_packet_t {
- length_t len; /* the actual number of bytes in the `data' field */
- int priority; /* priority or TOS */
- uint32_t seqno; /* 32 bits sequence number (network byte order of course) */
+ length_t len; /* the actual number of bytes in the `data' field */
+ int priority; /* priority or TOS */
+ uint32_t seqno; /* 32 bits sequence number (network byte order of course) */
uint8_t data[MAXSIZE];
} vpn_packet_t;
#include "subnet.h"
typedef struct node_status_t {
- unsigned int unused_active: 1; /* 1 if active (not used for nodes) */
- unsigned int validkey: 1; /* 1 if we currently have a valid key for him */
- unsigned int unused_waitingforkey: 1; /* 1 if we already sent out a request */
- unsigned int visited: 1; /* 1 if this node has been visited by one of the graph algorithms */
- unsigned int reachable: 1; /* 1 if this node is reachable in the graph */
- unsigned int indirect: 1; /* 1 if this node is not directly reachable by us */
+ unsigned int unused_active: 1; /* 1 if active (not used for nodes) */
+ unsigned int validkey: 1; /* 1 if we currently have a valid key for him */
+ unsigned int unused_waitingforkey: 1; /* 1 if we already sent out a request */
+ unsigned int visited: 1; /* 1 if this node has been visited by one of the graph algorithms */
+ unsigned int reachable: 1; /* 1 if this node is reachable in the graph */
+ unsigned int indirect: 1; /* 1 if this node is not directly reachable by us */
unsigned int unused: 26;
} node_status_t;
SUBNET_MAC = 0,
SUBNET_IPV4,
SUBNET_IPV6,
- SUBNET_TYPES /* Guardian */
+ SUBNET_TYPES, /* Guardian */
} subnet_type_t;
typedef struct subnet_mac_t {
#include "node.h"
typedef struct subnet_t {
- struct node_t *owner; /* the owner of this subnet */
+ struct node_t *owner; /* the owner of this subnet */
- subnet_type_t type; /* subnet type (IPv4? IPv6? MAC? something even weirder?) */
- time_t expires; /* expiry time */
- int weight; /* weight (higher value is higher priority) */
+ subnet_type_t type; /* subnet type (IPv4? IPv6? MAC? something even weirder?) */
+ time_t expires; /* expiry time */
+ int weight; /* weight (higher value is higher priority) */
/* And now for the actual subnet: */