PatchworkOS  10941b4
A non-POSIX operating system.
Loading...
Searching...
No Matches
local.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/sync/lock.h>
4
5#include <stdint.h>
6#include <sys/io.h>
7#include <sys/list.h>
8
9typedef struct local_listen local_listen_t;
10typedef struct local_conn local_conn_t;
11
12/**
13 * @brief Local Protocol.
14 * @defgroup module_net_local Local Protocol
15 * @ingroup module_net
16 *
17 * @{
18 */
19
20/**
21 * @brief The size of local sockets buffer.
22 */
23#define LOCAL_BUFFER_SIZE (4 * PAGE_SIZE)
24
25/**
26 * @brief The maximum size of a packet allowed to be sent/received via local sockets.
27 */
28#define LOCAL_MAX_PACKET_SIZE (LOCAL_BUFFER_SIZE - sizeof(local_packet_header_t))
29
30/**
31 * @brief The maximum backlog of connections for a local listener.
32 */
33#define LOCAL_MAX_BACKLOG 128
34
35/**
36 * @brief Magic number for local socket packets, used for validation.
37 */
38#define LOCAL_PACKET_MAGIC 0xC0D74B56
39
40/**
41 * @brief Local packet header structure.
42 * struct local_packet_header_t
43 */
49
50/**
51 * @brief Local socket data structure.
52 * struct local_socket_t
53 *
54 * Stored in the `private` field of a `socket_t` for local sockets.
55 */
62
63/** @} */
__UINT32_TYPE__ uint32_t
Definition stdint.h:15
Local Connection structure.
Definition local_conn.h:29
Local Listener structure.
Local packet header structure. struct local_packet_header_t.
Definition local.h:45
Local socket data structure. struct local_socket_t.
Definition local.h:57
bool isServer
Definition local.h:60
local_conn_t * conn
Definition local.h:59
local_listen_t * listen
Definition local.h:58