PatchworkOS
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
26#define LOCAL_BUFFER_SIZE (4 * PAGE_SIZE)
27
31#define LOCAL_MAX_PACKET_SIZE (LOCAL_BUFFER_SIZE - sizeof(local_packet_header_t))
32
36#define LOCAL_MAX_BACKLOG 128
37
41#define LOCAL_PACKET_MAGIC 0xC0D74B56
42
52
59typedef struct
60{
61 union {
62 struct
63 {
65 } listen;
66 struct
67 {
70 } conn;
71 };
74
78void net_local_init(void);
79
void net_local_init(void)
Initialize the local networking subsystem.
Definition local.c:517
__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:48
Local socket data structure. struct local_socket_data_t.
Definition local.h:60
local_listen_t * listen
Definition local.h:64
local_conn_t * conn
Definition local.h:68
A simple ticket lock implementation.
Definition lock.h:43