|
PatchworkOS
|
#include <kernel/net/local/local.h>#include <kernel/fs/path.h>#include <kernel/log/log.h>#include <kernel/log/panic.h>#include <kernel/net/local/local_conn.h>#include <kernel/net/local/local_listen.h>#include <kernel/net/socket.h>#include <kernel/net/socket_family.h>#include <kernel/net/socket_type.h>#include <kernel/sched/wait.h>#include <kernel/sync/lock.h>#include <kernel/utils/ref.h>#include <kernel/utils/ring.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/io.h>#include <sys/list.h>Go to the source code of this file.
Functions | |
| static local_listen_t * | local_socket_data_get_listen (local_socket_data_t *data) |
| static local_conn_t * | local_socket_data_get_conn (local_socket_data_t *data) |
| static uint64_t | local_socket_init (socket_t *sock) |
| static void | local_socket_deinit (socket_t *sock) |
| static uint64_t | local_socket_bind (socket_t *sock, const char *address) |
| static uint64_t | local_socket_listen (socket_t *sock, uint32_t backlog) |
| static uint64_t | local_socket_connect (socket_t *sock, const char *address) |
| static uint64_t | local_socket_accept (socket_t *sock, socket_t *newSock) |
| static uint64_t | local_socket_send (socket_t *sock, const void *buffer, uint64_t count, uint64_t *offset) |
| static uint64_t | local_socket_recv (socket_t *sock, void *buffer, uint64_t count, uint64_t *offset) |
| static wait_queue_t * | local_socket_poll (socket_t *sock, poll_events_t *revents) |
| void | net_local_init (void) |
| Initialize the local networking subsystem. | |
Variables | |
| static socket_family_ops_t | ops |
Definition at line 219 of file local.c.
References assert, local_listen_t::backlog, local_socket_data_t::conn, CONTAINER_OF, data, DEREF_DEFER, ECONNABORTED, EINVAL, ERR, errno, EWOULDBLOCK, socket_t::flags, local_listen_t::isClosed, list_is_empty(), list_pop(), local_socket_data_get_listen(), local_socket_data_t::lock, local_listen_t::lock, lock_acquire(), lock_release(), LOCK_SCOPE, NULL, PATH_NONBLOCK, local_listen_t::pendingAmount, socket_t::private, REF, WAIT_BLOCK_LOCK, and local_listen_t::waitQueue.
Definition at line 104 of file local.c.
References address, data, DEREF_DEFER, EINVAL, ERR, errno, local_listen_new(), LOCK_SCOPE, NULL, socket_t::private, and REF.
Definition at line 164 of file local.c.
References address, local_listen_t::backlog, data, DEREF_DEFER, ECONNREFUSED, EINVAL, local_conn_t::entry, EOK, ERR, errno, local_listen_t::isClosed, list_push(), local_conn_new(), local_listen_find(), local_listen_t::lock, LOCK_SCOPE, local_listen_t::maxBacklog, NULL, local_listen_t::pendingAmount, socket_t::private, REF, WAIT_ALL, wait_unblock(), and local_listen_t::waitQueue.
|
static |
Definition at line 34 of file local.c.
References data, LOCK_SCOPE, NULL, and REF.
Referenced by local_socket_recv(), and local_socket_send().
|
static |
Definition at line 22 of file local.c.
References data, LOCK_SCOPE, NULL, and REF.
Referenced by local_socket_accept().
|
static |
Definition at line 58 of file local.c.
References socket_t::currentState, data, DEREF, EOK, free(), lock_acquire(), lock_release(), NULL, socket_t::private, SOCKET_CONNECTED, SOCKET_LISTENING, WAIT_ALL, and wait_unblock().
Definition at line 46 of file local.c.
References calloc(), data, ERR, lock_init(), NULL, and socket_t::private.
Definition at line 131 of file local.c.
References data, EINVAL, ERR, errno, local_listen_t::isClosed, LOCAL_MAX_BACKLOG, local_listen_t::lock, LOCK_SCOPE, local_listen_t::maxBacklog, NULL, and socket_t::private.
|
static |
Definition at line 434 of file local.c.
References local_conn_t::clientToServer, socket_t::currentState, data, EINVAL, errno, local_conn_t::isClosed, local_listen_t::isClosed, local_conn_t::lock, local_listen_t::lock, LOCK_SCOPE, NULL, local_listen_t::pendingAmount, POLLERR, POLLHUP, POLLIN, POLLOUT, socket_t::private, ring_data_length(), ring_free_length(), local_conn_t::serverToClient, SOCKET_CONNECTED, SOCKET_LISTENING, local_conn_t::waitQueue, and local_listen_t::waitQueue.
|
static |
Definition at line 355 of file local.c.
References buffer, local_conn_t::clientToServer, count, data, DEREF_DEFER, EBADMSG, ECONNRESET, EINTR, EINVAL, EIO, EMSGSIZE, EOK, ERR, errno, EWOULDBLOCK, socket_t::flags, local_conn_t::isClosed, LOCAL_MAX_PACKET_SIZE, LOCAL_PACKET_MAGIC, local_socket_data_get_conn(), local_conn_t::lock, LOCK_SCOPE, local_packet_header_t::magic, NULL, PATH_NONBLOCK, socket_t::private, ring, ring_data_length(), ring_move_read_forward(), ring_read(), ring_read_at(), local_conn_t::serverToClient, local_packet_header_t::size, WAIT_ALL, WAIT_BLOCK_LOCK, wait_unblock(), and local_conn_t::waitQueue.
|
static |
Definition at line 286 of file local.c.
References buffer, local_conn_t::clientToServer, count, data, DEREF_DEFER, EAGAIN, ECONNRESET, EINVAL, EIO, EMSGSIZE, EOK, ERR, errno, socket_t::flags, local_conn_t::isClosed, LOCAL_MAX_PACKET_SIZE, LOCAL_PACKET_MAGIC, local_socket_data_get_conn(), local_conn_t::lock, LOCK_SCOPE, local_packet_header_t::magic, NULL, PATH_NONBLOCK, socket_t::private, ring, ring_free_length(), ring_write(), local_conn_t::serverToClient, WAIT_ALL, WAIT_BLOCK_LOCK, wait_unblock(), and local_conn_t::waitQueue.
|
static |
Definition at line 505 of file local.c.
Referenced by inode_new(), net_local_init(), socket_family_register(), superblock_new(), and vfs_open2().