From ea415ccc1690d6e5864a7500977b181e5c8faafe Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 20 Feb 2012 17:12:48 +0100 Subject: [PATCH] Rename connection_t *broadcast to everyone. --- src/connection.c | 10 +++++----- src/connection.h | 2 +- src/net.c | 12 ++++++------ src/protocol.c | 2 +- src/protocol_auth.c | 2 +- src/protocol_edge.c | 2 +- src/protocol_key.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/connection.c b/src/connection.c index e7ea9b2a..0211845b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -29,7 +29,7 @@ #include "xalloc.h" avl_tree_t *connection_tree; /* Meta connections */ -connection_t *broadcast; +connection_t *everyone; static int connection_compare(const connection_t *a, const connection_t *b) { return a < b ? -1 : a == b ? 0 : 1; @@ -37,14 +37,14 @@ static int connection_compare(const connection_t *a, const connection_t *b) { void init_connections(void) { connection_tree = avl_alloc_tree((avl_compare_t) connection_compare, (avl_action_t) free_connection); - broadcast = new_connection(); - broadcast->name = xstrdup("everyone"); - broadcast->hostname = xstrdup("BROADCAST"); + everyone = new_connection(); + everyone->name = xstrdup("everyone"); + everyone->hostname = xstrdup("BROADCAST"); } void exit_connections(void) { avl_delete_tree(connection_tree); - free_connection(broadcast); + free_connection(everyone); } connection_t *new_connection(void) { diff --git a/src/connection.h b/src/connection.h index 7916a710..ff2c9ccd 100644 --- a/src/connection.h +++ b/src/connection.h @@ -101,7 +101,7 @@ typedef struct connection_t { } connection_t; extern avl_tree_t *connection_tree; -extern connection_t *broadcast; +extern connection_t *everyone; extern void init_connections(void); extern void exit_connections(void); diff --git a/src/net.c b/src/net.c index ea4bbcfc..fc9ec574 100644 --- a/src/net.c +++ b/src/net.c @@ -75,7 +75,7 @@ static void purge(void) { for(snode = n->subnet_tree->head; snode; snode = snext) { snext = snode->next; s = snode->data; - send_del_subnet(broadcast, s); + send_del_subnet(everyone, s); if(!strictsubnets) subnet_del(n, s); } @@ -84,7 +84,7 @@ static void purge(void) { enext = enode->next; e = enode->data; if(!tunnelserver) - send_del_edge(broadcast, e); + send_del_edge(everyone, e); edge_del(e); } } @@ -183,7 +183,7 @@ void terminate_connection(connection_t *c, bool report) { if(c->edge) { if(report && !tunnelserver) - send_del_edge(broadcast, c->edge); + send_del_edge(everyone, c->edge); edge_del(c->edge); @@ -198,7 +198,7 @@ void terminate_connection(connection_t *c, bool report) { e = lookup_edge(c->node, myself); if(e) { if(!tunnelserver) - send_del_edge(broadcast, e); + send_del_edge(everyone, e); edge_del(e); } } @@ -576,14 +576,14 @@ int main_loop(void) { next = node->next; subnet = node->data; if(subnet->expires == 1) { - send_del_subnet(broadcast, subnet); + send_del_subnet(everyone, subnet); if(subnet->owner->status.reachable) subnet_update(subnet->owner, subnet, false); subnet_del(subnet->owner, subnet); } else if(subnet->expires == -1) { subnet->expires = 0; } else { - send_add_subnet(broadcast, subnet); + send_add_subnet(everyone, subnet); if(subnet->owner->status.reachable) subnet_update(subnet->owner, subnet, true); } diff --git a/src/protocol.c b/src/protocol.c index aec00eee..7dbee717 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -96,7 +96,7 @@ bool send_request(connection_t *c, const char *format, ...) { buffer[len++] = '\n'; - if(c == broadcast) { + if(c == everyone) { broadcast_meta(NULL, buffer, len); return true; } else diff --git a/src/protocol_auth.c b/src/protocol_auth.c index cde7ead9..b6018ca7 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -575,7 +575,7 @@ bool ack_h(connection_t *c) { if(tunnelserver) send_add_edge(c, c->edge); else - send_add_edge(broadcast, c->edge); + send_add_edge(everyone, c->edge); /* Run MST and SSSP algorithms */ diff --git a/src/protocol_edge.c b/src/protocol_edge.c index 32102d27..5d81462b 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -254,7 +254,7 @@ bool del_edge_h(connection_t *c) { e = lookup_edge(to, myself); if(e) { if(!tunnelserver) - send_del_edge(broadcast, e); + send_del_edge(everyone, e); edge_del(e); } } diff --git a/src/protocol_key.c b/src/protocol_key.c index a7d4447a..1d471c80 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -40,7 +40,7 @@ void send_key_changed(void) { avl_node_t *node; connection_t *c; - send_request(broadcast, "%d %x %s", KEY_CHANGED, rand(), myself->name); + send_request(everyone, "%d %x %s", KEY_CHANGED, rand(), myself->name); /* Immediately send new keys to directly connected nodes to keep UDP mappings alive */ -- 2.39.5