mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 15:45:08 +00:00
Kernel+LibC+Userland: Start working on an IPv4 socket backend.
The first userland networking program will be "ping" :^)
This commit is contained in:
parent
8e667747f0
commit
a017a77442
23 changed files with 374 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <Kernel/Socket.h>
|
||||
#include <Kernel/LocalSocket.h>
|
||||
#include <Kernel/IPv4Socket.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <LibC/errno_numbers.h>
|
||||
|
@ -10,6 +11,8 @@ KResultOr<Retained<Socket>> Socket::create(int domain, int type, int protocol)
|
|||
switch (domain) {
|
||||
case AF_LOCAL:
|
||||
return LocalSocket::create(type & SOCK_TYPE_MASK);
|
||||
case AF_INET:
|
||||
return IPv4Socket::create(type & SOCK_TYPE_MASK, protocol);
|
||||
default:
|
||||
return KResult(-EAFNOSUPPORT);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue