]> git.meshlink.io Git - meshlink/commitdiff
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 e7ea9b2aec91d93d55a673b359f545a1ef49e85d..0211845b89521aa6a077a20a4a9b3bd83559f7a4 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 7916a710da413b679560840f5ea8f6aca24ed823..ff2c9ccdcb34bf965033ca012bce9fcaab3d5aea 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 ea4bbcfce218c5e9d1b2fd3908eb4d0ccb2a6e67..fc9ec574987a97f81d42f757e19648bd800299b0 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 aec00eeeffeb3bd7f1080068383a93df8bdfba58..7dbee7171d99f985b3a8acf7505fb48ab5053d4f 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 cde7ead9e95f81c9a0fc619eec91eb3d3d4965fd..b6018ca743e555107d326b39b875fa442ec285e1 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 32102d27af27a04cb6381a7129a97a45fef057df..5d81462b6c9bb019914860b82885f8ae35bc8286 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 a7d4447a9a08d40b70c48b53e5bb8c71a24314ab..1d471c80084181817ab3529821f9fac5675676f9 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 */