network: add support for configuring extra peers via a separate json file
[project/unetd.git] / host.h
diff --git a/host.h b/host.h
index b802d776c7088c63c0f99b92cacada22b620b13f..75fc9490ed534a75c9b1e3b170637254d1f9ee47 100644 (file)
--- a/host.h
+++ b/host.h
@@ -13,6 +13,8 @@ struct network_peer {
        struct blob_attr *ipaddr;
        struct blob_attr *subnet;
        int port;
+       int pex_port;
+       bool dynamic;
 
        struct {
                int connect_attempt;
@@ -33,6 +35,12 @@ struct network_peer {
        } state;
 };
 
+struct network_dynamic_peer {
+       struct list_head list;
+
+       struct network_peer peer;
+};
+
 struct network_host {
        struct avl_node node;
 
@@ -65,7 +73,7 @@ static inline const char *network_peer_name(struct network_peer *peer)
 {
        struct network_host *host;
 
-       if (!peer)
+       if (!peer || peer->dynamic)
                return "(none)";
 
        host = container_of(peer, struct network_host, peer);