more refucktoring (into multiple modules)
authorxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 11 Oct 2012 20:41:29 +0000 (20:41 +0000)
committerxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Thu, 11 Oct 2012 20:41:29 +0000 (20:41 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@198 251d49ef-1d17-4917-a970-b30cf55b089b

parsehosts.c
prometheus.c

index 2740c1c8c08d29936dcef4301abaa0572f85788b..db3bf2eb52f2003c647518487023cceb98d9d118 100644 (file)
@@ -14,9 +14,32 @@ extern int class_count;
 extern int ip_count;\r
 extern int found_lmsid;\r
 extern int free_min;\r
 extern int ip_count;\r
 extern int found_lmsid;\r
 extern int free_min;\r
+extern const int highest_priority;\r
 \r
 \r
-/* function implemented in prometheus.c */\r
-void TheIP(void);\r
+/* This must be object oriented! This looks almost like constructor ;-) */\r
+void TheIP(void)\r
+{\r
+ create(ip,IP);\r
+ ip->name        = "";\r
+ ip->addr        = "";\r
+ ip->sharing     = NULL;\r
+ ip->prio        = highest_priority+1;\r
+ ip->lmsid       = -1;\r
+ ip->fixedprio   = \\r
+ ip->mark        = \\r
+ ip->min         = \\r
+ ip->max         = \\r
+ ip->desired     = \\r
+ ip->credit      = \\r
+ ip->upload      = \\r
+ ip->proxy       = \\r
+ ip->direct      = \\r
+ ip->traffic     = \\r
+ ip->pktsup      = \\r
+ ip->pktsdown    = 0;\r
+ ip->keyword     = keywords;\r
+ push(ip,ips);\r
+}\r
 \r
 /* == This function strips extra characters after IPv4 address and stores it = */\r
 void parse_ip(char *str)\r
 \r
 /* == This function strips extra characters after IPv4 address and stores it = */\r
 void parse_ip(char *str)\r
index 2aec7ffa0a75f720eaae440144edbe72f8f23cbc..717971410549b1ce35de9bc6eadc77ce1ae55fe3 100644 (file)
@@ -181,31 +181,9 @@ struct Index
 } *idxs=NULL, *idx, *metaindex;\r
 \r
 \r
 } *idxs=NULL, *idx, *metaindex;\r
 \r
 \r
-/* Damned, this must be object oriented! This looks almost like constructor ;-) */\r
 \r
 \r
-void TheIP(void)\r
-{\r
- create(ip,IP);\r
- ip->name        = "";\r
- ip->addr        = "";\r
- ip->sharing     = NULL;\r
- ip->prio        = highest_priority+1;\r
- ip->lmsid       = -1;\r
- ip->fixedprio   = \\r
- ip->mark        = \\r
- ip->min         = \\r
- ip->max         = \\r
- ip->desired     = \\r
- ip->credit      = \\r
- ip->upload      = \\r
- ip->proxy       = \\r
- ip->direct      = \\r
- ip->traffic     = \\r
- ip->pktsup      = \\r
- ip->pktsdown    = 0;\r
- ip->keyword     = keywords;\r
- push(ip,ips);\r
-}\r
+void TheIP(void);\r
+/* function implemented in parsehosts.c */\r
 \r
 /* ====== iptables indexes are used to reduce complexity to log8(N) ===== */\r
 \r
 \r
 /* ====== iptables indexes are used to reduce complexity to log8(N) ===== */\r
 \r
This page took 0.146638 seconds and 4 git commands to generate.