X-Git-Url: http://git.harvie.cz/?p=svn%2FPrometheus-QoS%2F.git;a=blobdiff_plain;f=prometheus.c;h=279da9b75d28b4fd245b28ed4e6165eaae86fc91;hp=c88857b6268e57d9767d419573c0afb15f8c501b;hb=06733b885c35e5bf83505d064c55ccdda848ac01;hpb=c38473c17cd984140f177ccb2000089e10444299 diff --git a/prometheus.c b/prometheus.c index c88857b..279da9b 100644 --- a/prometheus.c +++ b/prometheus.c @@ -1127,16 +1127,24 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); chain_postrouting="POSTROUTING"; } + /* packet limits - this will be optional in future, hardcoded for now */ + if(ip->pps_limit) + { + sprintf(limit_pkts, "-m limit --limit %d/s ", ip->pps_limit); + } + else + { + *limit_pkts = 0; + } + #ifdef DEBUG - printf("%-22s %-16s %04d ", ip->name, ip->addr, ip->mark); + printf("%-22s %-16s %04d %d/s\n", ip->name, ip->addr, ip->mark, ip->pps_limit); #endif - /* -------------------------------------------------------- mark download */ - + /* -------------------------------------------------------- mark download */ sprintf(str, "-A %s -d %s/%d -o %s -j %s%d", chain_postrouting, ip->addr, 32*(1+ip->v6), lan, mark_iptables, ip->mark); - /* -m limit --limit 1/s */ iptables_save_line(str, ip->v6); if(qos_proxy) @@ -1147,9 +1155,6 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); iptables_save_line(str, ip->v6); } - /* this will be optional in future - hardcoded for now*/ - sprintf(limit_pkts,"-m limit --limit %d/s ", ip->pps_limit); - sprintf(str, "-A %s -d %s/%d -o %s %s-j ACCEPT", chain_postrouting, ip->addr, 32*(1+ip->v6), lan, limit_pkts); iptables_save_line(str, ip->v6);