PatchworkOS
Loading...
Searching...
No Matches
socket.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/fs/path.h>
4#include <kernel/fs/sysfs.h>
7#include <kernel/utils/ref.h>
8
9#include <sys/io.h>
10
11typedef struct socket_family socket_family_t;
12
75
96
108
117
125
132void socket_end_transition(socket_t* sock, uint64_t result);
133
#define MAX_NAME
Maximum length of names.
Definition MAX_NAME.h:11
path_flags_t
Path flags.
Definition path.h:83
socket_type_t
Socket type enumeration.
Definition socket_type.h:18
socket_state_t
Socket states.
Definition socket.h:65
socket_t * socket_new(socket_family_t *family, socket_type_t type, path_flags_t flags)
Create a new socket.
Definition socket.c:359
void socket_continue_transition(socket_t *sock, socket_state_t state)
Without releasing the socket mutex, start a transition to a new target state.
Definition socket.c:519
uint64_t socket_start_transition(socket_t *sock, socket_state_t state)
Starts a socket state transition.
Definition socket.c:491
void socket_end_transition(socket_t *sock, uint64_t result)
Ends a socket state transition.
Definition socket.c:528
@ SOCKET_CLOSED
Definition socket.h:72
@ SOCKET_LISTENING
Definition socket.h:68
@ SOCKET_STATE_AMOUNT
Definition socket.h:73
@ SOCKET_CONNECTED
Definition socket.h:70
@ SOCKET_NEW
Definition socket.h:66
@ SOCKET_CLOSING
Definition socket.h:71
@ SOCKET_BOUND
Definition socket.h:67
@ SOCKET_CONNECTING
Definition socket.h:69
static uintptr_t address
Definition hpet.c:12
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
Directory entry structure.
Definition dentry.h:83
Reference counting structure.
Definition ref.h:30
Read-Write Mutex structure.
Definition rwmutex.h:42
Socket Family structure.
Socket structure.
Definition socket.h:81
dentry_t * dataFile
Definition socket.h:93
socket_state_t nextState
Definition socket.h:90
dentry_t * ctlFile
Definition socket.h:92
ref_t ref
Definition socket.h:82
path_flags_t flags
Definition socket.h:87
socket_type_t type
Definition socket.h:86
socket_state_t currentState
Definition socket.h:89
socket_family_t * family
Definition socket.h:85
dentry_t * acceptFile
Definition socket.h:94
rwmutex_t mutex
Definition socket.h:91