mirror of
https://github.com/RGBCube/serenity
synced 2025-07-05 11:07:34 +00:00
Kernel: Record network statistics and expose as JSON
This is comprised of five small changes: * Keep a counter for tx/rx packets/bytes per TCP socket * Keep a counter for tx/rx packets/bytes per network adapter * Expose that data in /proc/net_tcp and /proc/netadapters * Convert /proc/netadapters to JSON * Fix up ifconfig to read the JSON from netadapters
This commit is contained in:
parent
061c092fae
commit
7ed54d86d5
7 changed files with 88 additions and 20 deletions
|
@ -334,6 +334,8 @@ void handle_tcp(const EthernetFrameHeader& eth, int frame_size)
|
|||
return;
|
||||
}
|
||||
|
||||
socket->record_incoming_data(ipv4_packet.payload_size());
|
||||
|
||||
#ifdef TCP_DEBUG
|
||||
kprintf("handle_tcp: state=%s\n", TCPSocket::to_string(socket->state()));
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue