-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add network syscalls #512
Add network syscalls #512
Conversation
Syscalls used for a TCP Client:
|
We could introduce an equivalent of Unix |
We need a For example: let list = vec![(stdin, Event::Read), (socket, Event::Read)];
loop {
if let Some((h, e)) = syscall::poll(&list) {
// Read from stdin or socket, whichever is ready first
}
} |
The updated The command What's missing is knowing when a socket connection is closed. We could add another |
Poll is not blocking for now, so we could poll only one file handle at a time instead of a list. The list is only useful to reduce the number of userspace/kernelspace boundary crossing. But if poll was blocking the we would cross it only once at the beginning. And in that case we need the list because we can't poll the file handles one by one. |
With a blocking |
Sometime the TCP state after a |
There was some confusion with the syntax for the port number between
We can't change
We don't support IPv6 yet but we might want to use |
Finally we also introduced a special case in |
There's two options for DHCPv4, either using the The HTTP server will also have to be rewritten but this can be done in a separate PR too. |
The socket file size will now show the recommended buffer size:
Size: MTU - Ethernet header - IP header - TCP/UDP header |
We can now delete a device file. This was needed to easily recreate the socket files and change their sizes without recreating the file system. |
/dev/net/tcp
device file to open a TCP socket handle/dev/net/udp
device file to open a UDP socket handlepoll
syscallconnect
syscalllisten
syscallaccept
syscalltcp
command to use the network using syscalls onlyhttp
command to use the network using syscalls onlyhttpd
command to use the network using syscalls onlysocket
command to use the network using syscalls onlyhost
command to use the network using syscalls onlydhcp
command to use the network using syscalls only