extern struct Macro *macro, *macros;\r
extern int class_count;\r
extern int ip_count;\r
-extern int found_lmsid;\r
+extern int found_code;\r
extern int free_min;\r
extern const int highest_priority;\r
extern char *ip6prefix;\r
ip->addr = ipaddr;\r
ip->sharing = NULL;\r
ip->prio = highest_priority+1;\r
- ip->lmsid = -1;\r
+ ip->code = "-----";\r
ip->fixedprio = \\r
ip->aggregated = \\r
ip->mark = \\r
void parse_and_append_ip(char *str, struct IP *listhead)\r
{\r
char *ptr, *ipaddr, *nextip6, *ip6buf; \r
- char *ip6uplink = NULL, *ip6range = NULL, *ipname = NULL, *lmsid = NULL;\r
+ char *ip6uplink = NULL, *ip6range = NULL, *ipname = NULL, *code = NULL;\r
\r
if(ip6prefix) /* Try this only if IPv6 subsystem is active... */\r
{\r
ptr = strchr(str, '{');\r
if(ptr)\r
{\r
- lmsid = ++ptr;\r
+ code = ++ptr;\r
while(*ptr and *ptr != '}')\r
{\r
ptr++;\r
}\r
ip->name = ip6range;\r
ip->keyword = defaultkeyword; /* settings for default keyword */\r
- if(lmsid)\r
+ if(code)\r
{\r
- ip->lmsid = atoi(lmsid);\r
+ ip->code = code;\r
}\r
lastIP6range = ip;\r
}\r
TheIP(ip6uplink, FALSE); /* always new IP - more IPs in single uplink network */\r
ip->name = ip6uplink;\r
ip->keyword = defaultkeyword; /* settings for default keyword */\r
- if(lmsid)\r
+ if(code)\r
{\r
- ip->lmsid = atoi(lmsid);\r
+ ip->code = code;\r
}\r
lastIP6uplink = ip;\r
}\r
TheIP(ipaddr, (listhead==networks));\r
}\r
ip->name = ipname;\r
- if(lmsid)\r
+ if(code)\r
{\r
- ip->lmsid = atoi(lmsid);\r
- found_lmsid = TRUE;\r
+ ip->code = code;\r
+ found_code = TRUE;\r
}\r
}\r
\r
}\r
}\r
\r
- /* avg MTU bytes * 8 >> 10 = in bits, max is in kb/s */\r
- pktratio = (ip->keyword->allowed_avgmtu*8) >> 10;\r
- if(pktratio > 0)\r
+ if(ip->keyword->allowed_avgmtu)\r
{\r
- ip->pps_limit = ip->max/pktratio;\r
- if(ip->pps_limit > 10000) /* this limit seems to be hardcoded in iptables */\r
+ /* avg MTU bytes * 8 >> 10 = in bits, max is in kb/s */\r
+ pktratio = (ip->keyword->allowed_avgmtu*8) >> 10;\r
+ if(pktratio > 0)\r
{\r
- ip->pps_limit = 0; /* do not apply packet limits */\r
+ ip->pps_limit = ip->max/pktratio;\r
+ if(ip->pps_limit > 10000) /* this limit seems to be hardcoded in iptables */\r
+ {\r
+ ip->pps_limit = 0; /* do not apply packet limits */\r
+ }\r
}\r
}\r
\r