mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-17 07:41:54 +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
Notes:
sideshowbarker
2024-07-19 12:49:37 +09:00
Author: https://github.com/deoxxa
Commit: 7ed54d86d5
Pull-request: https://github.com/SerenityOS/serenity/pull/418
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