Rename connection_t *broadcast to everyone.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 20 Feb 2012 16:12:48 +0000 (17:12 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 20 Feb 2012 16:12:48 +0000 (17:12 +0100)
src/connection.c
src/connection.h
src/net.c
src/protocol.c
src/protocol_auth.c
src/protocol_edge.c
src/protocol_key.c

index e7ea9b2..0211845 100644 (file)
@@ -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) {
index 7916a71..ff2c9cc 100644 (file)
@@ -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);
index ea4bbcf..fc9ec57 100644 (file)
--- 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);
                                        }
index aec00ee..7dbee71 100644 (file)
@@ -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
index cde7ead..b6018ca 100644 (file)
@@ -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 */
 
index 32102d2..5d81462 100644 (file)
@@ -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);
                }
        }
index a7d4447..1d471c8 100644 (file)
@@ -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 */