PatchworkOS
Loading...
Searching...
No Matches
socket.h File Reference
#include <kernel/fs/path.h>
#include <kernel/fs/sysfs.h>
#include <kernel/net/socket_type.h>
#include <kernel/sync/rwmutex.h>
#include <kernel/utils/ref.h>
#include <sys/io.h>

Go to the source code of this file.

Data Structures

struct  socket_t
 Socket structure. More...
 

Typedefs

typedef struct socket_family socket_family_t
 

Enumerations

enum  socket_state_t {
  SOCKET_NEW ,
  SOCKET_BOUND ,
  SOCKET_LISTENING ,
  SOCKET_CONNECTING ,
  SOCKET_CONNECTED ,
  SOCKET_CLOSING ,
  SOCKET_CLOSED ,
  SOCKET_STATE_AMOUNT
}
 Socket states. More...
 

Functions

socket_tsocket_new (socket_family_t *family, socket_type_t type, path_flags_t flags)
 Create a new socket.
 
uint64_t socket_start_transition (socket_t *sock, socket_state_t state)
 Starts a socket state transition.
 
void socket_continue_transition (socket_t *sock, socket_state_t state)
 Without releasing the socket mutex, start a transition to a new target state.
 
void socket_end_transition (socket_t *sock, uint64_t result)
 Ends a socket state transition.
 

Typedef Documentation

◆ socket_family_t

typedef struct socket_family socket_family_t

Definition at line 11 of file socket.h.