MOS Source Code
Loading...
Searching...
No Matches
ipc_io.cpp File Reference
#include "mos/ipc/ipc_io.hpp"
#include "mos/io/io.hpp"
#include "mos/ipc/ipc.hpp"
#include "mos/misc/panic.hpp"
#include <mos/allocator.hpp>
#include <mos_stdlib.hpp>
+ Include dependency graph for ipc_io.cpp:

Go to the source code of this file.

Classes

struct  ipc_server_io_t
 

Functions

static void ipc_control_io_close (io_t *io)
 
static size_t ipc_client_io_write (io_t *io, const void *buf, size_t size)
 
static size_t ipc_client_io_read (io_t *io, void *buf, size_t size)
 
static void ipc_client_io_close (io_t *io)
 
static size_t ipc_server_io_write (io_t *io, const void *buf, size_t size)
 
static size_t ipc_server_io_read (io_t *io, void *buf, size_t size)
 
static void ipc_server_io_close (io_t *io)
 
PtrResult< ipc_conn_io_tipc_conn_io_create (IPCDescriptor *ipc, bool is_server_side)
 Create a new IPC connection io descriptor.
 
PtrResult< io_tipc_create (const char *name, size_t max_pending_connections)
 Create a new IPC server.
 
PtrResult< io_tipc_accept (io_t *server)
 Accept a new connection on an IPC server.
 
PtrResult< io_tipc_connect (const char *name, size_t buffer_size)
 Connect to an IPC servers.
 

Variables

static const io_op_t ipc_control_io_op
 
static const io_op_t ipc_client_io_op
 
static const io_op_t ipc_server_io_op
 

Function Documentation

◆ ipc_control_io_close()

static void ipc_control_io_close ( io_t * io)
static

Definition at line 19 of file ipc_io.cpp.

+ Here is the call graph for this function:

◆ ipc_client_io_write()

static size_t ipc_client_io_write ( io_t * io,
const void * buf,
size_t size )
static

Definition at line 34 of file ipc_io.cpp.

+ Here is the call graph for this function:

◆ ipc_client_io_read()

static size_t ipc_client_io_read ( io_t * io,
void * buf,
size_t size )
static

Definition at line 40 of file ipc_io.cpp.

+ Here is the call graph for this function:

◆ ipc_client_io_close()

static void ipc_client_io_close ( io_t * io)
static

Definition at line 46 of file ipc_io.cpp.

+ Here is the call graph for this function:

◆ ipc_server_io_write()

static size_t ipc_server_io_write ( io_t * io,
const void * buf,
size_t size )
static

Definition at line 56 of file ipc_io.cpp.

+ Here is the call graph for this function:

◆ ipc_server_io_read()

static size_t ipc_server_io_read ( io_t * io,
void * buf,
size_t size )
static

Definition at line 62 of file ipc_io.cpp.

+ Here is the call graph for this function:

◆ ipc_server_io_close()

static void ipc_server_io_close ( io_t * io)
static

Definition at line 68 of file ipc_io.cpp.

+ Here is the call graph for this function:

◆ ipc_conn_io_create()

PtrResult< ipc_conn_io_t > ipc_conn_io_create ( IPCDescriptor * ipc,
bool is_server_side )

Create a new IPC connection io descriptor.

Parameters
ipcThe IPC object to create the connection for
is_server_sideWhether this is the server side of the connection
Returns
ipc_conn_io_t* A new IPC connection io descriptor

Definition at line 90 of file ipc_io.cpp.

Referenced by ipc_accept(), ipc_connect(), and vfs_ipc_file_read().

+ Here is the call graph for this function:

◆ ipc_create()

PtrResult< io_t > ipc_create ( const char * name,
size_t max_pending_connections )

Create a new IPC server.

Parameters
nameThe name of the server
max_pending_connectionsThe maximum number of pending connections to allow
Returns
A new io_t object that represents the server, or an error code on failure
Note
The io_t returned by this function is only to accept new connections or close the server, reading or writing to it will fail.

Definition at line 101 of file ipc_io.cpp.

◆ ipc_accept()

PtrResult< io_t > ipc_accept ( io_t * server)

Accept a new connection on an IPC server.

Parameters
serverThe server to accept a connection on
Returns
An io_t for the server side of the connection, or an error code on failure

Definition at line 119 of file ipc_io.cpp.

Referenced by ipc_accept().

+ Here is the call graph for this function:

◆ ipc_connect()

PtrResult< io_t > ipc_connect ( const char * name,
size_t buffer_size )

Connect to an IPC servers.

Parameters
nameThe name of the server to connect to
buffer_sizeThe size of a shared-memory buffer to use for the connection
Returns
A new io_t object that represents the connection, or an error code on failure

Definition at line 136 of file ipc_io.cpp.

Variable Documentation

◆ ipc_control_io_op

const io_op_t ipc_control_io_op
static
Initial value:
= {
}
static void ipc_control_io_close(io_t *io)
Definition ipc_io.cpp:19

Definition at line 30 of file ipc_io.cpp.

Referenced by ipc_create().

◆ ipc_client_io_op

const io_op_t ipc_client_io_op
static
Initial value:
= {
}
static size_t ipc_client_io_write(io_t *io, const void *buf, size_t size)
Definition ipc_io.cpp:34
static void ipc_client_io_close(io_t *io)
Definition ipc_io.cpp:46
static size_t ipc_client_io_read(io_t *io, void *buf, size_t size)
Definition ipc_io.cpp:40

Definition at line 78 of file ipc_io.cpp.

Referenced by ipc_conn_io_create().

◆ ipc_server_io_op

const io_op_t ipc_server_io_op
static
Initial value:
= {
}
static size_t ipc_server_io_write(io_t *io, const void *buf, size_t size)
Definition ipc_io.cpp:56
static size_t ipc_server_io_read(io_t *io, void *buf, size_t size)
Definition ipc_io.cpp:62
static void ipc_server_io_close(io_t *io)
Definition ipc_io.cpp:68

Definition at line 84 of file ipc_io.cpp.

Referenced by ipc_conn_io_create().