network: add support for configuring extra peers via a separate json file
[project/unetd.git] / pex.h
diff --git a/pex.h b/pex.h
index aaf828f3caf35ebf9d6af0bae107c5790e8e117c..123b4a97537945a75a0bd2b850205a42469b47bc 100644 (file)
--- a/pex.h
+++ b/pex.h
@@ -9,8 +9,16 @@
 
 struct network;
 
+struct network_pex_host {
+       struct list_head list;
+       uint64_t timeout;
+       union network_endpoint endpoint;
+};
+
 struct network_pex {
        struct uloop_fd fd;
+       struct list_head hosts;
+       struct uloop_timeout request_update_timer;
 };
 
 enum pex_event {
@@ -23,13 +31,18 @@ enum pex_event {
 void network_pex_init(struct network *net);
 int network_pex_open(struct network *net);
 void network_pex_close(struct network *net);
+void network_pex_free(struct network *net);
 
 void network_pex_event(struct network *net, struct network_peer *peer,
                       enum pex_event ev);
+void network_pex_create_host(struct network *net, union network_endpoint *ep,
+                            unsigned int timeout);
 
 static inline bool network_pex_active(struct network_pex *pex)
 {
        return pex->fd.fd >= 0;
 }
 
+int global_pex_open(void);
+
 #endif