Updated RPC handling

This commit is contained in:
Joseph Henry
2015-11-12 08:21:05 -08:00
parent 82a60b1e28
commit e5fad005a9
22 changed files with 345 additions and 41 deletions

View File

@ -37,6 +37,8 @@
#include "lwip/ip_addr.h"
#include "lwip/ip_frag.h"
#include "Intercept.h"
#ifndef _NETCON_UTILITIES_CPP
#define _NETCON_UTILITIES_CPP
@ -64,8 +66,27 @@ namespace ZeroTier
va_end(ap);
}
void clearscreen()
void unload_rpc(void *data, pid_t &pid, pid_t &tid, int &rpc_count, char (timestamp[20]), char &cmd, void* &payload)
{
unsigned char *buf = (unsigned char*)data;
/*
dwr(" - IDX_PID = %d\n", IDX_PID);
dwr(" - IDX_TID = %d\n", IDX_TID);
dwr(" - IDX_COUNT = %d\n", IDX_COUNT);
dwr(" - IDX_TIME = %d\n", IDX_TIME);
dwr(" - IDX_PAYLOAD = %d\n", IDX_PAYLOAD);
*/
memcpy(&pid, &buf[IDX_PID], sizeof(pid_t));
memcpy(&tid, &buf[IDX_TID], sizeof(pid_t));
memcpy(&rpc_count, &buf[IDX_COUNT], sizeof(int));
memcpy(timestamp, &buf[IDX_TIME], 20);
memcpy(&cmd, &buf[IDX_PAYLOAD], sizeof(char));
payload = buf+IDX_PAYLOAD+1;
//dwr("RX: (pid=%d, tid=%d, rpc_count=%d, timestamp=%s, cmd=%d\n", pid, tid, rpc_count, timestamp, cmd);
}
void clearscreen(){
fprintf(stderr, "\033[2J");
}