PatchworkOS
Loading...
Searching...
No Matches
local.c File Reference
#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_tlocal_socket_data_get_listen (local_socket_data_t *data)
 
static local_conn_tlocal_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_tlocal_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
 

Function Documentation

◆ local_socket_accept()

◆ local_socket_bind()

static uint64_t local_socket_bind ( socket_t sock,
const char *  address 
)
static

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.

◆ local_socket_connect()

◆ local_socket_data_get_conn()

static local_conn_t * local_socket_data_get_conn ( local_socket_data_t data)
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().

◆ local_socket_data_get_listen()

static local_listen_t * local_socket_data_get_listen ( local_socket_data_t data)
static

Definition at line 22 of file local.c.

References data, LOCK_SCOPE, NULL, and REF.

Referenced by local_socket_accept().

◆ local_socket_deinit()

static void local_socket_deinit ( socket_t sock)
static

◆ local_socket_init()

static uint64_t local_socket_init ( socket_t sock)
static

Definition at line 46 of file local.c.

References calloc(), data, ERR, lock_init(), NULL, and socket_t::private.

◆ local_socket_listen()

static uint64_t local_socket_listen ( socket_t sock,
uint32_t  backlog 
)
static

◆ local_socket_poll()

◆ local_socket_recv()

◆ local_socket_send()

Variable Documentation

◆ ops

socket_family_ops_t ops
static
Initial value:
= {
}
static uint64_t local_socket_send(socket_t *sock, const void *buffer, uint64_t count, uint64_t *offset)
Definition local.c:286
static uint64_t local_socket_bind(socket_t *sock, const char *address)
Definition local.c:104
static uint64_t local_socket_accept(socket_t *sock, socket_t *newSock)
Definition local.c:219
static uint64_t local_socket_connect(socket_t *sock, const char *address)
Definition local.c:164
static uint64_t local_socket_recv(socket_t *sock, void *buffer, uint64_t count, uint64_t *offset)
Definition local.c:355
static void local_socket_deinit(socket_t *sock)
Definition local.c:58
static uint64_t local_socket_init(socket_t *sock)
Definition local.c:46
static wait_queue_t * local_socket_poll(socket_t *sock, poll_events_t *revents)
Definition local.c:434
static uint64_t local_socket_listen(socket_t *sock, uint32_t backlog)
Definition local.c:131

Definition at line 505 of file local.c.

Referenced by inode_new(), net_local_init(), socket_family_register(), superblock_new(), and vfs_open2().