extern struct Group *groups, *group;\r
extern struct Keyword *keyword, *defaultkeyword, *keywords;\r
extern struct Macro *macro, *macros;\r
+extern struct Textfile *previous_classmap, *textline;\r
extern int class_count;\r
+extern int mix_new_hosts;\r
extern int ip_count;\r
extern int found_lmsid;\r
extern int free_min;\r
void TheIP(char *ipaddr, int is_network)\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->pps_limit = \\r
- ip->pktsdown = 0;\r
- ip->keyword = keywords;\r
- ip->v6 = (strchr(ip->addr,':')!=NULL);\r
- ip->mask = ((ip->v6)?64:32);\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->aggregated = \\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->traffic_down = \\r
+ ip->traffic_up = \\r
+ ip->pktsup = \\r
+ ip->pps_limit = \\r
+ ip->pktsdown = 0;\r
+ ip->keyword = keywords;\r
+ ip->v6 = (strchr(ip->addr,':')!=NULL);\r
+ ip->mask = ((ip->v6)?64:32);\r
if(is_network)\r
{\r
push(ip, networks);\r
}\r
}\r
\r
- ip->mark = FIRSTIPCLASS+1+class_count++; \r
+ if(mix_new_hosts)\r
+ for_each(textline, previous_classmap)\r
+ {\r
+ ptr = strchr(textline->str, ' ');\r
+ if(ptr)\r
+ {\r
+ if(!strncmp(ip->addr, textline->str, ptr-textline->str))\r
+ {\r
+ ip->mark = atoi(ptr+1);\r
+ printf("Match class: %s %d\n", ip->addr, ip->mark);\r
+ }\r
+ } \r
+ }\r
+ \r
+ if(!mix_new_hosts || !ip->mark)\r
+ ip->mark = FIRSTIPCLASS+1+class_count++;\r
+ \r
update_network(ip->addr, ip);\r
\r
if_exists(group,groups,(group->min == ip->min)) \r