HIPC  0.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
usocutils.h File Reference
#include <hipc/msgd.h>
#include <hipc/scfg.h>
Include dependency graph for usocutils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

enum HIPC_errno hipcUsocWriteMsgd (struct HIPC_usoc *const so_p, hipc_msgd const *const md_p)
 Writes md_p to so_p. More...
 
enum HIPC_errno hipcUsocAccept (struct HIPC_usoc *const so_p, const struct HIPC_scfg **const cfg_pp, const struct HIPC_scfg *const *const cfg_ary, const unsigned int n_cfg, unsigned char *const buf, size_t buf_size)
 Accepts a HIPC session if cfg_ary includes a configuration of coming HELLO message. More...
 
enum HIPC_errno hipcUsocAcceptSimple (struct HIPC_usoc *const so_p, const struct HIPC_scfg *const cfg_p)
 Accepts a HIPC session of cfg_p. More...
 

Function Documentation

enum HIPC_errno hipcUsocWriteMsgd ( struct HIPC_usoc *const  so_p,
hipc_msgd const *const  md_p 
)

Writes md_p to so_p.

Parameters
so_pPointer to a universal socket
md_pPointer to HIPC message data
Returns
HIPC_SUCCESS on success, or an error on failure.

Definition at line 14 of file usocutils.c.

References HIPC_MSGHDR_SIZE, HIPC_SUCCESS, hipcMsgdBdyPtr, hipcMsgdBdySize(), hipcMsgdHdrPtr, and hipcUsocWrite().

Here is the call graph for this function:

enum HIPC_errno hipcUsocAccept ( struct HIPC_usoc *const  so_p,
const struct HIPC_scfg **const  cfg_pp,
const struct HIPC_scfg *const *const  cfg_ary,
const unsigned int  n_cfg,
unsigned char *const  buf,
const size_t  buf_size 
)

Accepts a HIPC session if cfg_ary includes a configuration of coming HELLO message.

Accepted configuration is set to cfg_pp.

Parameters
so_pPointer to a universal socket
cfg_ppConfiguration accepted
cfg_aryAcceptable configurations
n_cfgNumber of acceptable configurations
bufbuffer for HELLO message
buf_sizesize of the buffer
Returns
HIPC_SUCCESS on success, or an error on failure.

Definition at line 71 of file usocutils.c.

References HIPC_ERR_S_BUF_SHTG, HIPC_ERR_S_INV_CFG, HIPC_ERR_S_INV_NULL, HIPC_MSGHDR_SIZE, HIPC_SUCCESS, hipcMsghdrBdysize(), hipcScfgCheckStrusize(), hipcScfgInit(), and hipcUsocRead().

Here is the call graph for this function:

enum HIPC_errno hipcUsocAcceptSimple ( struct HIPC_usoc *const  so_p,
const struct HIPC_scfg *const  cfg_p 
)

Accepts a HIPC session of cfg_p.

This function use the stack for a buffer, so the stack size must be large enough.

Parameters
so_pPointer to a universal socket
cfg_pAcceptable configuration
Returns
HIPC_SUCCESS on success, or an error on failure.

Definition at line 141 of file usocutils.c.

References HIPC_scfg::cfgid, HIPC_scfg::cfgid_header, HIPC_ERR_S_INV_CFG, HIPC_ERR_S_INV_NULL, HIPC_MSGHDR_SIZE, HIPC_SUCCESS, hipcMsghdrBdysize(), hipcScfgCheckStrusize(), hipcScfgInit(), and hipcUsocRead().

Here is the call graph for this function: