aboutsummaryrefslogtreecommitdiff
path: root/server_network.h
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-10 04:45:33 -0400
committerTest_User <hax@andrewyu.org>2024-06-10 04:45:33 -0400
commit0bc78fc2d38c2ed79eb0e990c08aee9474f7ae60 (patch)
treec29bec6561aba396c7769d6f7e236dc2877bd338 /server_network.h
parent525b2239812c815bf414d948e09c70f6b6ea2d31 (diff)
downloadhaxircd-0bc78fc2d38c2ed79eb0e990c08aee9474f7ae60.tar.gz
haxircd-0bc78fc2d38c2ed79eb0e990c08aee9474f7ae60.zip
Basic server tracking added
Diffstat (limited to 'server_network.h')
-rw-r--r--server_network.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/server_network.h b/server_network.h
index fea62bc..7c28cb2 100644
--- a/server_network.h
+++ b/server_network.h
@@ -28,6 +28,9 @@
#include <stddef.h>
+#include "haxstring.h"
+#include "table.h"
+
struct server_network_info {
size_t net_type;
size_t protocol;
@@ -42,6 +45,21 @@ struct server_connection_info {
void *handle;
};
+struct server_info {
+ struct string sid;
+
+ struct string next; // Self for self, else which server we should send a message to to get to this server
+
+ struct table connected_to; // List of servers that this server is connected to
+
+ struct table user_list;
+
+ size_t protocol;
+ size_t net;
+
+ size_t distance;
+};
+
int init_server_network(void);
int start_server_network(void);
int start_server_network_threads(size_t net);
@@ -50,4 +68,12 @@ void * server_accept_thread(void *type);
void * handle_server_thread(void *type);
+int add_server(struct string attached_to, struct string sid, struct string name, struct string fullname, size_t protocol, size_t net);
+void free_server(struct server_info *server);
+
+void update_all_propagations(void);
+void unlink_server(struct server_info *a, struct server_info *b, size_t protocol);
+
extern struct table server_config;
+
+extern struct table server_list;