aboutsummaryrefslogtreecommitdiff
path: root/network.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);