added IPNode for storing real IP's of users
[NeonServV5.git] / src / IPNode.h
diff --git a/src/IPNode.h b/src/IPNode.h
new file mode 100644 (file)
index 0000000..0b2fd29
--- /dev/null
@@ -0,0 +1,33 @@
+/* IPNode.h - NeonServ v5.3
+ * Copyright (C) 2011-2012  Philipp Kreil (pk910)
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License 
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. 
+ */
+#ifndef _IPNode_h
+#define _IPNode_h
+#include "main.h"
+
+#define IPNODE_IS_IPV6  0x01
+#define IPNODE_IS_LOCAL 0x02
+
+struct IPNode {
+    unsigned char flags;
+    unsigned char ipdata[16]; // 16 * 8bit = 128bit
+};
+
+struct IPNode *createIPNode(const char *ipstr);
+int ipmatch(struct IPNode *ip1, struct IPNode *ip2, int bits);
+void freeIPNode(struct IPNode *ip);
+
+#endif
\ No newline at end of file