20 |
|
|
21 |
|
network_stat_t *get_network_stats_diff(int *entries); |
22 |
|
|
23 |
< |
Both calls takes a pointer to a int, entries. This is filled with the number |
23 |
> |
Both calls take a pointer to an int, "entries". This is filled with the number |
24 |
|
of network interfaces the machine has. You need to know this to know how |
25 |
< |
many network_stat_t how many network_stat_t have been returned. |
25 |
> |
many network_stat_t have been returned. |
26 |
|
|
27 |
|
get_network_stats returns the network traffic stored in the kernel. E.g. |
28 |
|
since bootup as long as the way it is stored in the kernel can store a large |
40 |
|
Bugs: |
41 |
|
get_network_stats_diff on very first call will return the same as |
42 |
|
get_network_stats. After first call it will always return the difference. |
43 |
+ |
On machines that hold only 32bits of information, if the call is made 2x |
44 |
+ |
wrap around (eg sol7 9gb has been transferred, and it wraps at 4gb) it will |
45 |
+ |
return incorrect results (case above, it would say 5gb transferred). |
46 |
|
|
47 |
|
Very basic example in examples/network_traffic.c |
48 |
|
|