1
Fork 0
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:
Andreas Kling 2019-03-12 15:51:42 +01:00
parent 8e667747f0
commit a017a77442
23 changed files with 374 additions and 3 deletions

View file

@ -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);
}