adapted to latest changes in gwen, more work on data and nodes servers.
This commit is contained in:
@@ -26,61 +26,35 @@
|
||||
#define AQH_MSGDATA_QWORDS_OFFS_VALUES 8 /* 8 byte */
|
||||
|
||||
|
||||
#define AQH_MSGDATA_QWORDS_MINSIZE (GWEN_MSGIPC_OFFS_PAYLOAD+AQH_MSGDATA_QWORDS_OFFS_VALUES)
|
||||
|
||||
|
||||
static void _writeQword(uint64_t i64, uint8_t *ptr);
|
||||
#define AQH_MSGDATA_QWORDS_PAYLOADSIZE (AQH_MSGDATA_QWORDS_OFFS_VALUES)
|
||||
#define AQH_MSGDATA_QWORDS_MINSIZE (GWEN_MSGIPC_OFFS_PAYLOAD+AQH_MSGDATA_QWORDS_PAYLOADSIZE)
|
||||
|
||||
|
||||
|
||||
|
||||
GWEN_MSG *AQH_QwordsIpcMsg_new(uint8_t protoId, uint8_t protoVer, uint16_t code, uint32_t flags, const uint64_t *i64Ptr, int count)
|
||||
GWEN_MSG *AQH_QwordsIpcMsg_new(uint8_t protoId, uint8_t protoVer, uint16_t code,
|
||||
uint32_t msgId, uint32_t refMsgId,
|
||||
uint32_t flags, const uint64_t *i64Ptr, int count)
|
||||
{
|
||||
GWEN_MSG *msg;
|
||||
uint8_t *ptr;
|
||||
int payloadSize;
|
||||
int i;
|
||||
|
||||
payloadSize=AQH_MSGDATA_QWORDS_OFFS_VALUES+(count*8);
|
||||
payloadSize=AQH_MSGDATA_QWORDS_PAYLOADSIZE+(count*8);
|
||||
|
||||
msg=GWEN_IpcMsg_new(protoId, protoVer, code, payloadSize, NULL);
|
||||
ptr=GWEN_Msg_GetBuffer(msg)+GWEN_MSGIPC_OFFS_PAYLOAD+AQH_MSGDATA_QWORDS_OFFS_VALUES;
|
||||
msg=GWEN_IpcMsg_new(protoId, protoVer, code, msgId, refMsgId, payloadSize, NULL);
|
||||
GWEN_Msg_AddUint32(msg, flags);
|
||||
GWEN_Msg_AddUint32(msg, count);
|
||||
|
||||
*(ptr++)=flags & 0xff;
|
||||
*(ptr++)=(flags>>8) & 0xff;
|
||||
*(ptr++)=(flags>>16) & 0xff;
|
||||
*(ptr++)=(flags>>24) & 0xff;
|
||||
|
||||
*(ptr++)=count & 0xff;
|
||||
*(ptr++)=(count>>8) & 0xff;
|
||||
*(ptr++)=(count>>16) & 0xff;
|
||||
*(ptr++)=(count>>24) & 0xff;
|
||||
|
||||
for(i=0; i<count; i++) {
|
||||
_writeQword(*i64Ptr, ptr);
|
||||
ptr+=8;
|
||||
i64Ptr++;
|
||||
}
|
||||
for(i=0; i<count; i++)
|
||||
GWEN_Msg_AddUint64(msg, *(i64Ptr++));
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _writeQword(uint64_t i64, uint8_t *ptr)
|
||||
{
|
||||
*(ptr++)=i64 & 0xff;
|
||||
*(ptr++)=(i64>>8) & 0xff;
|
||||
*(ptr++)=(i64>>16) & 0xff;
|
||||
*(ptr++)=(i64>>24) & 0xff;
|
||||
*(ptr++)=(i64>>32) & 0xff;
|
||||
*(ptr++)=(i64>>40) & 0xff;
|
||||
*(ptr++)=(i64>>48) & 0xff;
|
||||
*(ptr++)=(i64>>56) & 0xff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint32_t AQH_QwordsIpcMsg_GetFlags(const GWEN_MSG *msg)
|
||||
{
|
||||
return GWEN_Msg_GetUint32At(msg, GWEN_MSGIPC_OFFS_PAYLOAD+AQH_MSGDATA_QWORDS_OFFS_FLAGS, 0);
|
||||
|
||||
Reference in New Issue
Block a user