FACT++  1.0
bool checkCommand ( char *  payload,
int  size,
unsigned int  checksum 
)

Definition at line 2352 of file feeserver.c.

References calculateChecksum().

Referenced by command_handler().

2352  {
2353  unsigned int payloadChecksum = 0;
2354 
2355  // payload has to contain data, if size is greater than 0,
2356  // and size must not be negative
2357  if (((payload == 0) && (size > 0)) || (size < 0)) {
2358  return false;
2359  }
2360 
2361  payloadChecksum = calculateChecksum((unsigned char*) payload, size);
2362 # ifdef __DEBUG
2363  printf("\nReceived Checksum: \t%x , \nCalculated Checksum: \t%x .\n\n",
2364  checksum, payloadChecksum);
2365  fflush(stdout);
2366 # endif
2367  return (payloadChecksum == checksum) ? true : false;
2368 }
unsigned int calculateChecksum(unsigned char *buffer, int size)
Definition: feeserver.c:2372
int size
Definition: db_dim_server.c:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function: