pfsense/pfsense — pull request #906 by phil-davis (2014-02-08 15:54:32+00:00)
Title: Return and filter appropriately when all or remote is selected on Traffic Graph

Back in early 2013, I added a "Filter" option to the Traffic Graph. It allowed to display just traffic stats for devices on the selected interface (Local) or for All traffic end-points or for Remote (=All-Local). At that time, during 2.1 development, the "rate" utility was returning stats for all traffic and so bandwidth_by_ip.php could simply filter the output of "rate" before returning it to the caller.
At a later time, "rate" got "fixed" so it did actually return only the network it was asked for by the "-A -c" parameter - https://github.com/pfsense/pfsense-tools/commit/c7f2244b99a294150ca61cc3ef231a4c5575629b
From that time, the "All" and "Remote" filter settings could not do what they claim to do.
I was looking at this forum topic - https://forum.pfsense.org/index.php/topic,69443.0.html - and realised that actually this could be fixed from bandwidth_by_ip.php by telling "rate" to consider the whole internet "0.0.0.0/0" as the network to consider, and telling it to include traffic "local" to this network (which is all traffic!)
This pull request implements that - now the "All" and "Remote" actually do something sensible.
Can this be back-applied to 2.1 branch also? since the features are in the GUI on 2.1.n but currently do not work.