mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
ProcFS: Expose UDP sockets in /proc/net/udp
This commit is contained in:
parent
d06f4291a8
commit
be485946b8
3 changed files with 29 additions and 0 deletions
|
@ -5,6 +5,13 @@
|
|||
#include <Kernel/Net/UDPSocket.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
void UDPSocket::for_each(Function<void(UDPSocket&)> callback)
|
||||
{
|
||||
LOCKER(sockets_by_port().lock());
|
||||
for (auto it : sockets_by_port().resource())
|
||||
callback(*it.value);
|
||||
}
|
||||
|
||||
Lockable<HashMap<u16, UDPSocket*>>& UDPSocket::sockets_by_port()
|
||||
{
|
||||
static Lockable<HashMap<u16, UDPSocket*>>* s_map;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue