1 #ifndef TOOLS_HEADER_GUARD
2 #define TOOLS_HEADER_GUARD
42 #include <sys/socket.h>
43 #include <netinet/in.h>
44 #include <arpa/inet.h>
56 static const int64_t NANOSEC_PER_SEC = 1000000000;
60 long int getMsDiff(timeval tv1, timeval tv2);
64 long int timevalToMs(
struct timeval time);
66 bool slotOk(SlotNumber n_slot);
68 void normalize_timespec(
struct timespec *ts, time_t sec, int64_t nanosec);
70 static char oneval[4] = {1,0,0,0};
71 static uint32_t* isLittleEndian = (uint32_t*)(oneval);
73 inline uint32_t deserialize_uint32_big_endian(
unsigned char *buffer) {
75 if (*isLittleEndian==1) {
76 value |= buffer[0] << 24;
77 value |= buffer[1] << 16;
78 value |= buffer[2] << 8;
82 value |= buffer[3] << 24;
83 value |= buffer[2] << 16;
84 value |= buffer[1] << 8;
List of common header files.
Constant/default values, version numbers.