|
libnx
|
Inter-process communication handling. More...
Go to the source code of this file.
Data Structures | |
| struct | IpcCommand |
| struct | IpcBufferDescriptor |
| IPC buffer descriptor. More... | |
| struct | IpcStaticSendDescriptor |
| IPC static send-buffer descriptor. More... | |
| struct | IpcStaticRecvDescriptor |
| IPC static receive-buffer descriptor. More... | |
| struct | IpcParsedCommand |
| IPC parsed command (response) structure. More... | |
| struct | DomainMessageHeader |
| IPC domain message header. More... | |
Macros | |
| #define | SFCI_MAGIC 0x49434653 |
| IPC input header magic. | |
| #define | SFCO_MAGIC 0x4f434653 |
| IPC output header magic. | |
| #define | IPC_INVALID_OBJECT_ID UINT32_MAX |
| IPC invalid object ID. | |
Functions | |
IPC response parsing | |
| static Result | ipcParse (IpcParsedCommand *r) |
| Parse an IPC command response into an IPC parsed command structure. More... | |
| static Result | ipcQueryPointerBufferSize (Handle session, size_t *size) |
| Queries the size of an IPC pointer buffer. More... | |
| static Result | ipcCloseSession (Handle session) |
| Closes the IPC session with proper clean up. More... | |
IPC domain handling | |
| static Result | ipcConvertSessionToDomain (Handle session, u32 *object_id_out) |
| Converts an IPC session handle into a domain. More... | |
| static void | ipcSendObjectId (IpcCommand *cmd, u32 object_id) |
| Adds an object ID to be sent through an IPC domain command structure. More... | |
| static void * | ipcPrepareHeaderForDomain (IpcCommand *cmd, size_t sizeof_raw, u32 object_id) |
| Prepares the header of an IPC command structure (domain version). More... | |
| static Result | ipcParseForDomain (IpcParsedCommand *r) |
| Parse an IPC command response into an IPC parsed command structure (domain version). More... | |
| static Result | ipcCloseObjectById (Handle session, u32 object_id) |
| Closes a domain object by ID. More... | |
IPC request building | |
| #define | IPC_MAX_BUFFERS 8 |
| IPC command (request) structure. | |
| #define | IPC_MAX_OBJECTS 8 |
| enum | BufferType { BufferType_Normal =0, BufferType_Type1 =1, BufferType_Invalid =2, BufferType_Type3 =3 } |
| enum | BufferDirection { BufferDirection_Send =0, BufferDirection_Recv =1, BufferDirection_Exch =2 } |
| enum | IpcCommandType { IpcCommandType_Invalid = 0, IpcCommandType_LegacyRequest = 1, IpcCommandType_Close = 2, IpcCommandType_LegacyControl = 3, IpcCommandType_Request = 4, IpcCommandType_Control = 5, IpcCommandType_RequestWithContext = 6, IpcCommandType_ControlWithContext = 7 } |
| static void | ipcInitialize (IpcCommand *cmd) |
| Initializes an IPC command structure. More... | |
| static void | ipcAddSendBuffer (IpcCommand *cmd, const void *buffer, size_t size, BufferType type) |
| Adds a buffer to an IPC command structure. More... | |
| static void | ipcAddRecvBuffer (IpcCommand *cmd, void *buffer, size_t size, BufferType type) |
| Adds a receive-buffer to an IPC command structure. More... | |
| static void | ipcAddExchBuffer (IpcCommand *cmd, void *buffer, size_t size, BufferType type) |
| Adds an exchange-buffer to an IPC command structure. More... | |
| static void | ipcAddSendStatic (IpcCommand *cmd, const void *buffer, size_t size, u8 index) |
| Adds a static-buffer to an IPC command structure. More... | |
| static void | ipcAddRecvStatic (IpcCommand *cmd, void *buffer, size_t size, u8 index) |
| Adds a static-receive-buffer to an IPC command structure. More... | |
| static void | ipcAddSendSmart (IpcCommand *cmd, size_t ipc_buffer_size, const void *buffer, size_t size, u8 index) |
| Adds a smart-buffer (buffer + static-buffer pair) to an IPC command structure. More... | |
| static void | ipcAddRecvSmart (IpcCommand *cmd, size_t ipc_buffer_size, void *buffer, size_t size, u8 index) |
| Adds a smart-receive-buffer (buffer + static-receive-buffer pair) to an IPC command structure. More... | |
| static void | ipcSendPid (IpcCommand *cmd) |
| Tags an IPC command structure to send the PID. More... | |
| static void | ipcSendHandleCopy (IpcCommand *cmd, Handle h) |
| Adds a copy-handle to be sent through an IPC command structure. More... | |
| static void | ipcSendHandleMove (IpcCommand *cmd, Handle h) |
| Adds a move-handle to be sent through an IPC command structure. More... | |
| static void * | ipcPrepareHeader (IpcCommand *cmd, size_t sizeof_raw) |
| Prepares the header of an IPC command structure. More... | |
| static Result | ipcDispatch (Handle session) |
| Dispatches an IPC request. More... | |
Inter-process communication handling.
| enum BufferType |
| Enumerator | |
|---|---|
| BufferType_Normal |
Regular buffer. |
| BufferType_Type1 |
Allows ProcessMemory and shared TransferMemory. |
| BufferType_Type3 |
Same as Type1 except remote process is not allowed to use device-mapping. |
|
inlinestatic |
Adds an exchange-buffer to an IPC command structure.
| cmd | IPC command structure. |
| buffer | Address of the buffer. |
| size | Size of the buffer. |
| type | Buffer type. |
|
inlinestatic |
Adds a receive-buffer to an IPC command structure.
| cmd | IPC command structure. |
| buffer | Address of the buffer. |
| size | Size of the buffer. |
| type | Buffer type. |
|
inlinestatic |
Adds a smart-receive-buffer (buffer + static-receive-buffer pair) to an IPC command structure.
| cmd | IPC command structure. |
| ipc_buffer_size | IPC buffer size. |
| buffer | Address of the buffer. |
| size | Size of the buffer. |
| index | Index of buffer. |
|
inlinestatic |
Adds a static-receive-buffer to an IPC command structure.
| cmd | IPC command structure. |
| buffer | Address of the buffer. |
| size | Size of the buffer. |
| index | Index of buffer. |
|
inlinestatic |
Adds a buffer to an IPC command structure.
| cmd | IPC command structure. |
| buffer | Address of the buffer. |
| size | Size of the buffer. |
| type | Buffer type. |
|
inlinestatic |
Adds a smart-buffer (buffer + static-buffer pair) to an IPC command structure.
| cmd | IPC command structure. |
| ipc_buffer_size | IPC buffer size. |
| buffer | Address of the buffer. |
| size | Size of the buffer. |
| index | Index of buffer. |
|
inlinestatic |
Adds a static-buffer to an IPC command structure.
| cmd | IPC command structure. |
| buffer | Address of the buffer. |
| size | Size of the buffer. |
| index | Index of buffer. |
Closes a domain object by ID.
| session | IPC session handle. |
| object_id | ID of the object to close. |
Closes the IPC session with proper clean up.
| session | IPC session handle. |
Converts an IPC session handle into a domain.
| session | IPC session handle. |
| object_id_out | Output variable in which to store the object ID. |
Dispatches an IPC request.
| session | IPC session handle. |
|
inlinestatic |
Initializes an IPC command structure.
| cmd | IPC command structure. |
|
inlinestatic |
Parse an IPC command response into an IPC parsed command structure.
| IPC | parsed command structure to fill in. |
|
inlinestatic |
Parse an IPC command response into an IPC parsed command structure (domain version).
| IPC | parsed command structure to fill in. |
|
inlinestatic |
Prepares the header of an IPC command structure.
| cmd | IPC command structure. |
| sizeof_raw | Size in bytes of the raw data structure to embed inside the IPC request |
|
inlinestatic |
Prepares the header of an IPC command structure (domain version).
| cmd | IPC command structure. |
| sizeof_raw | Size in bytes of the raw data structure to embed inside the IPC request object_id Domain object ID. |
Queries the size of an IPC pointer buffer.
| session | IPC session handle. |
| size | Output variable in which to store the size. |
|
inlinestatic |
Adds a copy-handle to be sent through an IPC command structure.
| cmd | IPC command structure. |
| h | Handle to send. |
|
inlinestatic |
Adds a move-handle to be sent through an IPC command structure.
| cmd | IPC command structure. |
| h | Handle to send. |
|
inlinestatic |
Adds an object ID to be sent through an IPC domain command structure.
| cmd | IPC domain command structure. |
| object_id | Object ID to send. |
|
inlinestatic |
Tags an IPC command structure to send the PID.
| cmd | IPC command structure. |
1.8.11