summaryrefslogtreecommitdiff
path: root/components/netspeeds.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove initialization to 0 for static varsAaron Marcher2018-05-201-4/+4
|
* Implement fmt_human_2() and fmt_human_10()Laslo Hunhold2018-05-191-8/+20
| | | | | | | | | These functions take the raw number and a unit and automatically print it out "scaled down" to a proper SI-prefix, for powers of 2 and 10 respectively. Apply them to the 2-power cases and keep the 10-power for a later commit.
* Increase precision in netspeeds.cLaslo Hunhold2018-05-191-8/+8
| | | | | | | | | First dividing by interval before multiplying with 1000 decreases the precision by +-(interval - 1) * 1000, as interval arithmetic always applies the Gauß-function to the result. This is not necessary and simply reordering the operations mitigates this.
* Implement esnprintf() and make formatted calls more efficientLaslo Hunhold2018-05-191-4/+10
| | | | | | | Within the components, snprintf() was unchecked and had inefficient calls in some places. We implement esnprintf() that does all the dirty laundry for us and use it exclusively now.
* Use `int` for flagsAaron Marcher2018-05-191-2/+2
|
* Set {r,t}xbytes 0 before incrementing them on OBSDAaron Marcher2018-05-191-2/+6
|
* Missing assignment for last commitAaron Marcher2018-05-191-0/+2
|
* Unify and simplify netspeed logic and typesAaron Marcher2018-05-191-30/+24
|
* netspeeds: added error condition for openbsdTobias Tschinkowitz2018-05-191-2/+12
| | | | | | implemented additional error condition for openbsd netstat in case the interface could not be found in the interface list or if_data is not readable.
* implemented openbsd netspeed functionsTobias Tschinkowitz2018-05-191-1/+59
| | | | | | implemented the netspeed functionality for openbsd. furthermore the static keyword was removed of the interval variable in config.def.h for usage as extern variable.
* Add network speed functionsAaron Marcher2018-05-191-0/+53