Crate netinfo[−][src]
This crate will group network usage per process. It uses a method similar to nethogs
:
All packets will be captured and their source/destination address are then used to
match them to a process.
This matching process relies on the /proc
file system, so it only works on Linux.
Because capturing the network traffic is not permittet for normal programs, you either have to run your binary as root or allow capturing with:
sudo setcap cap_net_raw,cap_net_admin=eip /path/to/your/bin
Modules
error |
Contains netinfo-crate errors generated with "error-chain". |
Structs
MacAddr |
A MAC address (6-bytes) |
NetStatistics |
Contains detailed information on network usage on per attribute (pid, in/out, tcp/udp). |
Netinfo |
This structure allows you to group network traffic by pid. |
NetworkInterface |
This is used to identify the network interface you want to count the traffic on. |
Enums
InoutType |
InoutType can be Incoming or Outgoing (direction of the traffic). |
TransportType |
Udp, Tcp or other packet type on transport layer? |
Type Definitions
Pid |
Represents an Unix-Pid. |