summaryrefslogtreecommitdiff
path: root/client_db.h
diff options
context:
space:
mode:
authordaniel <daniel@planethacker.net>2025-05-07 09:45:50 -0700
committerdaniel <daniel@planethacker.net>2025-05-07 09:45:50 -0700
commiteeac69b2168c5a65f9608771006ccc43033cbd23 (patch)
tree1dc44a6016b607085a691768810d551045df9901 /client_db.h
initial commitHEADmain
Diffstat (limited to 'client_db.h')
-rw-r--r--client_db.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/client_db.h b/client_db.h
new file mode 100644
index 0000000..936f95e
--- /dev/null
+++ b/client_db.h
@@ -0,0 +1,37 @@
+/*
+ * LOKI
+ *
+ * client_db header file
+ *
+ * 1996/7 Guild Corporation Productions [daemon9]
+ */
+
+
+/*
+ * Client info list.
+ * MAX_CLIENT of these will be kept in a server-side array
+ */
+struct client_list {
+ uint16_t client_id; /* client loki_id */
+ uint32_t client_ip; /* client IP address */
+ time_t touchtime; /* last time entry was hit */
+ uint32_t packets_sent; /* Packets sent to this client */
+ uint32_t bytes_sent; /* Bytes sent to this client */
+ unsigned int hits; /* Number of queries from client */
+};
+
+#define IS_GOOD_CLIENT(ldg)\
+\
+(c_id == client[i].client_id && \
+ ldg.iph.ip_src == client[i].client_ip) > \
+ (0) ? (1) : (0) \
+
+void update_client(int, int, uint32_t); /* Update a client entry */
+ /* client info into supplied buffer */
+int stat_client(int, uint8_t *, int, time_t);
+int add_client(uint8_t *); /* add a client entry */
+int locate_client(int); /* find a client entry */
+void age_client(void); /* age a client from the list */
+uint16_t update_client_salt(int); /* update and return salt */
+uint32_t check_client_ip(int, uint16_t *); /* return ip and id of target */
+