summaryrefslogtreecommitdiff
path: root/network.h
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-05-03 22:57:53 -0400
committerTest_User <hax@andrewyu.org>2023-05-03 22:57:53 -0400
commite4b5445b3ca844e568a84abbf931a026a6ca6226 (patch)
tree9d9d615406c5a91036ebcd5b23bd8af30d3e8f3d /network.h
parentec8b1682e86535333c34966f6aafee349e609641 (diff)
downloadcoupserv-e4b5445b3ca844e568a84abbf931a026a6ca6226.tar.gz
coupserv-e4b5445b3ca844e568a84abbf931a026a6ca6226.zip
C HaxServ
Diffstat (limited to 'network.h')
-rw-r--r--network.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/network.h b/network.h
new file mode 100644
index 0000000..7cc4a28
--- /dev/null
+++ b/network.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <netinet/in.h>
+
+#include "types.h"
+#include "table.h"
+
+// ID is the index you got this from
+struct remote_server {
+ uint64_t distance; // gl if you exceed this
+
+ struct string address;
+ struct string name;
+ struct string via; // netsplit purposes
+ // TODO: metadata
+};
+
+struct user_info {
+ uint64_t nick_ts;
+ uint64_t user_ts;
+
+ struct string server;
+ struct string nick;
+ struct string hostname;
+ struct string vhost;
+ struct string ident;
+ struct string ip;
+ struct string realname;
+ struct string opertype;
+
+ struct table metadata;
+};
+
+extern struct table network_commands;
+extern struct table server_list;
+extern struct table user_list;
+
+int resolve(char* address, char* port, struct sockaddr *server);
+int initservernetwork(void);