53 #include "rnr/rnrconfig.h" 172 LOG_SET_THRESHOLD(msgReq.
m_level);
442 "VConn=%d", (
int)msgReq.
m_vconn);
498 msgRsp.
m_vconn.
u.m_buf[i++] = (byte_t)n;
623 return ReqLoopback(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
627 return ReqSetLogging(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
631 return ReqMsgTrace(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
635 return ReqGetVersion(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
639 return ReqDevOpen(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
643 return ReqDevClose(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
647 return ReqGetVConnList(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
651 return ReqGetVConnInfo(hndClient, hndVConn, uTid, uMsgId, bufReq, uReqLen,
char m_cdata[(NMFVAL_LEN_MAX_STRING)+1]
cdata
uint_t BsMsgId_T
client message id type [0-64k].
#define BSPROXY_RSPGETVCONNINFO_MODURI_LEN
#define BS_ECODE_UNKNOWN_REQ
unknown request
<b><i>BotSense</i></b> bsProxy IP server declarations.
INLINE_IN_H int BsProxyUnpackReqSetLogging(byte_t buf[], size_t uMsgLen, BsProxyReqSetLogging_T *pStruct, bool_t bTrace)
Unpack a BsProxyReqSetLogging ITV message in big-endian byte order from the input buffer...
BsProxyClientCtl_T * ClientAcquire(BsProxyClientHnd_T hndClient)
Acquire client, locking it from other threads.
int VConnOpenDev(BsProxyClientHnd_T hndClient, const char *sDevName, const char *sModName, byte_t argbuf[], size_t uArgLen, bool_t bTrace)
Open a virtual device connection.
static int ReqMsgTrace(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to set server or client terminated message tracing.
int m_rd
module resource descriptor
BotSense client application - bsProxy server-terminated core messages.
static int ReqGetVersion(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to get the server's version.
INLINE_IN_H int BsProxyUnpackReqMsgTrace(byte_t buf[], size_t uMsgLen, BsProxyReqMsgTrace_T *pStruct, bool_t bTrace)
Unpack a BsProxyReqMsgTrace ITV message in big-endian byte order from the input buffer.
void VConnRelease(BsVConnHnd_T hndVConn)
Release the locked virtual client.
#define BSPROXY_RSPGETVCONNINFO_CLIENT_LEN
char m_modname[(NMFVAL_LEN_MAX_STRING)+1]
modname
static int ReqGetVConnInfo(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to get a virtual connection's information.
union BsProxyRspGetVConnList_T::@12::@13 u
aligned vector items
static int ReqGetVConnList(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to get the list of all of the client's opened virtual connection handles...
uint_t BsTid_T
client transaction id type [0-255].
#define BSPROXY_SEND_NMERROR_RSP(hndClient, hndVConn, uTid, nmecode, efmt,...)
Log NetMsgs (Un)Packing Error and Send Error Response.
char m_cdata[(NMFVAL_LEN_MAX_STRING)+1]
cdata
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
BsProxyThCtl_T * m_pThCtl
service thread
#define BSPROXY_RSPGETVERSION_VERSION_LEN
void ClientRelease(BsProxyClientHnd_T hndClient)
Release the locked client.
INLINE_IN_H int BsProxyUnpackReqLoopback(byte_t buf[], size_t uMsgLen, BsProxyReqLoopback_T *pStruct, bool_t bTrace)
Unpack a BsProxyReqLoopback ITV message in big-endian byte order from the input buffer.
static int ReqSetLogging(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to set the server's logging level.
#define BS_OK
not an error, success
#define BSPROXY_VCONN_MOD_MIN
minimum module-specific handle value
struct BsProxyRspGetVConnList_T::@12 m_vconn
vector
#define BSPROXY_VCONN_MOD_MAX
maximum module-specific handle value
static int ReqDevClose(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to close a device virtual connection.
int BsProxyClientHnd_T
bsProxy server client handle
static int ReqDevOpen(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to open a proxied device virtual connection.
int VConnClose(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn)
Close the virtual connection.
size_t m_count
vector item count
INLINE_IN_H int BsProxyUnpackReqGetVConnInfo(byte_t buf[], size_t uMsgLen, BsProxyReqGetVConnInfo_T *pStruct, bool_t bTrace)
Unpack a BsProxyReqGetVConnInfo ITV message in big-endian byte order from the input buffer...
BsModInfoFunc_P m_fnModInfo
static info
int ClientSendOkRsp(BsProxyClientHnd_T hndClient, BsTid_T uTid)
Send an ok response to the client.
static int ReqLoopback(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen, bool_t bTrace)
Service client's request to perform a loopback.
#define BSPROXY_RSPGETVCONNINFO_DEVURI_LEN
#define BS_ECODE_BAD_MSG
bad message
INLINE_IN_H int BsProxyUnpackReqDevOpen(byte_t buf[], size_t uMsgLen, BsProxyReqDevOpen_T *pStruct, bool_t bTrace)
Unpack a BsProxyReqDevOpen ITV message in big-endian byte order from the input buffer.
INLINE_IN_H bool_t ClientGetTraceState(BsProxyClientHnd_T hndClient)
Get the <b><i>BotSense</i></b> client's server-terminated message trace state.
BsProxyVConn_T * VConnAcquire(BsVConnHnd_T hndVConn)
Acquire virtual connection, locking it from other threads.
char m_devuri[(NMFVAL_LEN_MAX_STRING)+1]
devuri
#define BSPROXY_SEND_ERROR_RSP(hndClient, hndVConn, uTid, ecode, efmt,...)
Log <b><i>BotSense</i></b> Error and Send Error Response.
BsProxyClientHnd_T m_hndClient
proxied client handle
char m_version[(NMFVAL_LEN_MAX_STRING)+1]
version
BsModTraceFunc_P m_fnModTrace
tracing
int ServerRequest(BsProxyClientHnd_T hndClient, BsVConnHnd_T hndVConn, BsTid_T uTid, BsMsgId_T uMsgId, byte_t bufReq[], size_t uReqLen)
Server service thread request handler.
uint_t m_uRefCnt
vconn ref count for this client
union BsProxyReqDevOpen_T::@10::@11 u
aligned vector items
struct BsProxyReqDevOpen_T::@10 m_argbuf
vector
const char * date
version date
Standard bsProxy static interface module information structure type.
Package version information.
size_t m_count
vector item count
const char * m_sModUri
module Uniform Resource Id
BsVConnHnd_T m_hndVConn
self reference
char m_client[(NMFVAL_LEN_MAX_STRING)+1]
client
#define BSPROXY_RSPGETVCONNINFO_MODDATE_LEN
<b><i>BotSense</i></b> bsProxy Dynamically Linked Library module interface.
#define BS_ECODE_SERVER_BAD_CLIENT
server detected bad client
#define BSPROXY_RSPLOOPBACK_CDATA_LEN
#define BS_ECODE_NO_VCONN
virtual connection not found
const char * version
dotted version x.y.z[-app[-a.b.c]]
INLINE_IN_H void ClientSetTraceState(BsProxyClientHnd_T hndClient, bool_t bTrace)
Set the <b><i>BotSense</i></b> client's server-terminated message trace state.
char m_devname[(NMFVAL_LEN_MAX_STRING)+1]
devname
#define BSPROXY_REQLOOPBACK_CDATA_LEN
#define BSPROXY_RSPGETVCONNINFO_MODVER_LEN
char m_modver[(NMFVAL_LEN_MAX_STRING)+1]
modver
INLINE_IN_H int BsProxyUnpackReqDevClose(byte_t buf[], size_t uMsgLen, BsProxyReqDevClose_T *pStruct, bool_t bTrace)
Unpack a BsProxyReqDevClose ITV message in big-endian byte order from the input buffer.
INLINE_IN_H const char * ClientHasName(BsProxyClientHnd_T hndClient)
Get the <b><i>BotSense</i></b> client official name.
const char * m_sDevUri
proxied device URI or server
BsProxyModIF_T * m_pModIF
interface module I/F
<b><i>BotSense</i></b> package top-level, unifying header declarations.
char m_moduri[(NMFVAL_LEN_MAX_STRING)+1]
moduri
int BsVConnHnd_T
virtual connection handle type
int ClientSendServerRsp(BsProxyClientHnd_T hndClient, BsTid_T uTid, BsProxyMsgId_T uMsgId, void *pMsgRsp)
Send a server-terminated response message to client.
char m_moddate[(NMFVAL_LEN_MAX_STRING)+1]
moddate