55 #include "rnr/rnrconfig.h" 57 #include "rnr/netmsgs.h" 81 struct timeval tvEnd, tvDelta;
85 if( !timerisset(pTvMark) || !timerisset(&tvEnd) )
90 tvDelta.tv_sec = tvEnd.tv_sec - pTvMark->tv_sec;
91 if( tvEnd.tv_usec < pTvMark->tv_usec )
94 tvEnd.tv_usec += 1000000;
96 tvDelta.tv_usec = tvEnd.tv_usec - pTvMark->tv_usec;
98 return (uint_t)(tvDelta.tv_sec * 1000000 + tvDelta.tv_usec);
111 const NMMsgDef_T *pMsgDef;
112 const char *sMsgName;
114 fp = LOG_GET_LOGFP();
116 if( pMsgHdr != NULL )
121 sMsgName = pMsgDef!=NULL? pMsgDef->m_sMsgName:
"";
127 fprintf(fp,
"%s MsgHdr = {\n", sPreface);
128 fprintf(fp,
" Magic: 0x%04x\n", pMsgHdr->
m_hdrMagic);
129 fprintf(fp,
" Tid: %u\n", (uint_t)(pMsgHdr->
m_hdrTid));
130 fprintf(fp,
" VConn: %u\n", (uint_t)(pMsgHdr->
m_hdrVConn));
131 fprintf(fp,
" MsgId: %u %s\n", pMsgHdr->
m_hdrMsgId, sMsgName);
137 fprintf(fp,
"%s MsgHdr: (null)\n", sPreface);
<b><i>BotSense</i></b> bsProxy IP server declarations.
const NMMsgDef_T * BsProxyLookupMsgDef(BsProxyMsgId_T eMsgId)
Look up the message definition associated with the message id.
BotSense client application - bsProxy server-terminated core messages.
#define BSPROXY_VCONN_SERVER
handle for server-terminated msgs
uint_t timer_elapsed(struct timeval *pTvMark)
Calculate the elapsed time between the given time mark and this call.
ushort_t m_hdrBodyLen
message body length
ushort_t m_hdrMsgId
message id (vConnection unique)
ushort_t m_hdrMagic
"unique" magic pattern
void BsProxyLogMsgHdr(const char *sPreface, BsProxyMsgHdr_T *pMsgHdr)
Log message header.
BotSense Proxy Message Header Structure.
byte_t m_hdrTid
transaction id
static void timer_mark(struct timeval *pTvMark)
Mark the current time. Resolution is microseconds.
byte_t m_hdrVConn
virtual connection handle (server unique)
<b><i>BotSense</i></b> package top-level, unifying header declarations.