Crinit -- Configurable Rootfs Init
sockcom.h File Reference

(2023-08-02, commit: 9434b31)

Header defining Crinit socket communication functions used internally by the crinit-client library. More...

#include "rtimcmd.h"
Include dependency graph for sockcom.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int crinitXfer (const char *sockFile, crinitRtimCmd_t *res, const crinitRtimCmd_t *cmd)
 

Detailed Description

Header defining Crinit socket communication functions used internally by the crinit-client library.

Function Documentation

◆ crinitXfer()

int crinitXfer ( const char *  sockFile,
crinitRtimCmd_t res,
const crinitRtimCmd_t cmd 
)

Perform a request/response transfer with Crinit

Will connect to Crinit and send a request/command, then receive the result/response. The server side equivalent is crinitConnThread() in notiserv.c.

The following image shows the high level communication sequence. For the lower level, refer to the internal functions crinitSend() and crinitRecv().

Parameters
sockFilePath to the AF_UNIX socket file to connect to.
resReturn pointer for response/result.
cmdThe command/request to send.
Returns
0 on success, -1 otherwise