getting ready for IP6tables support
[svn/Prometheus-QoS/.git] / parsehosts.c
index 2740c1c8c08d29936dcef4301abaa0572f85788b..d17c61917c32ad0235da1f3b036b768e3b56e27b 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 const int highest_priority;\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(char *ipaddr)\r
+{\r
+ create(ip,IP);\r
+ ip->name        = "";\r
+ ip->addr        = ipaddr;\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
@@ -57,9 +80,8 @@ void parse_ip(char *str)
  if_exists(ip, ips, eq(ip->addr,ipaddr));\r
  else\r
  {\r
-  TheIP();\r
+  TheIP(ipaddr);\r
  }\r
- ip->addr = ipaddr;\r
  ip->name = ipname;\r
  if(lmsid)\r
  {\r
This page took 0.143294 seconds and 4 git commands to generate.