|
ginnOS
The reference: libc, the libraries and the kernel
|
TCP sockets (SOCK_STREAM): the socket calls over tcp.c. More...
#include "byteorder.h"#include "common/memory.h"#include "inet_internal.h"#include "kernel/errno.h"#include "kernel/memory/heap.h"#include "kernel/process/process.h"#include "kernel/signal/signal.h"#include "kernel/usermode/uaccess.h"#include "kernel/vfs/file.h"#include "kernel/vfs/poll.h"#include "netif.h"Macros | |
| #define | CHUNK (32 * 1024) |
Functions | |
| int32_t | tcp_socket_connect (file_t *file, inet_socket_t *s, const ksockaddr_in_t *addr) |
| the TCP side of the socket calls (tcp_socket.c). | |
| int32_t | tcp_socket_listen (inet_socket_t *s, uint32_t backlog) |
| int32_t | tcp_socket_accept (file_t *file, uint32_t flags, file_t **out, ksockaddr_in_t *peer) |
| int32_t | tcp_socket_send (file_t *file, inet_socket_t *s, const kiovec_t *iov, uint32_t iov_count, bool dontwait) |
| int32_t | tcp_socket_receive (file_t *file, inet_socket_t *s, const kiovec_t *iov, uint32_t iov_count, uint32_t flags, bool dontwait) |
| uint32_t | tcp_socket_poll (inet_socket_t *s) |
| int32_t | tcp_socket_shutdown (inet_socket_t *s, int32_t how) |
TCP sockets (SOCK_STREAM): the socket calls over tcp.c.
user data goes through a kernel buffer of CHUNK bytes: it is copied from user memory before net_lock is taken, and to user memory after the lock is let go, as a copy can fault and sleep.
| #define CHUNK (32 * 1024) |
| int32_t tcp_socket_connect | ( | struct file * | file, |
| inet_socket_t * | s, | ||
| const ksockaddr_in_t * | addr ) |
the TCP side of the socket calls (tcp_socket.c).
those marked "lock held" are called with net_lock held; the others take it.
| int32_t tcp_socket_listen | ( | inet_socket_t * | s, |
| uint32_t | backlog ) |
| int32_t tcp_socket_accept | ( | file_t * | file, |
| uint32_t | flags, | ||
| file_t ** | out, | ||
| ksockaddr_in_t * | peer ) |
| int32_t tcp_socket_send | ( | file_t * | file, |
| inet_socket_t * | s, | ||
| const kiovec_t * | iov, | ||
| uint32_t | iov_count, | ||
| bool | dontwait ) |
| int32_t tcp_socket_receive | ( | file_t * | file, |
| inet_socket_t * | s, | ||
| const kiovec_t * | iov, | ||
| uint32_t | iov_count, | ||
| uint32_t | flags, | ||
| bool | dontwait ) |
| uint32_t tcp_socket_poll | ( | inet_socket_t * | s | ) |
| int32_t tcp_socket_shutdown | ( | inet_socket_t * | s, |
| int32_t | how ) |