include(FindPkgConfig)
include(CheckFunctionExists)
include(CheckLibraryExists)
+include(CheckSymbolExists)
pkg_check_modules(BASELIBS libconfig)
-check_function_exists(clock_gettime GAVE_CLOCK_GETTIME)
-check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT)
+
+check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
+
+if(NOT HAVE_CLOCK_GETTIME)
+ check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT)
+ if(NOT HAVE_CLOCK_GETTIME_RT)
+ check_library_exists(c clock_get_time "mach/time.h" HAVE_CLOCK_GET_TIME)
+ if(NOT HAVE_CLOCK_GET_TIME)
+ message(FATAL_ERROR "Didn't find clock_gettime() or clock_get_time!")
+ endif()
+ else()
+ set(LIBRARIES ${LIBRARIES} rt)
+ endif()
+endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
#ifndef CLIENT_H_45786678
#define CLIENT_H_45786678
-#include <config.h>
+//#include <config.h>
#include <stdint.h>
#include <unistd.h> /* close() */
#include <sys/types.h>
bool_t shutdown_wait;
cryptState_t cryptState;
bool_t readBlockedOnWrite, writeBlockedOnRead;
-
+
struct sockaddr_in remote_tcp;
- struct sockaddr_in remote_udp;
+ struct sockaddr_in remote_udp;
uint8_t rxbuf[BUFSIZE], txbuf[BUFSIZE];
uint32_t rxcount, msgsize, drainleft, txcount, txsize;
int sessionId;
#define CRYPTSTATE_H_34564356
#ifdef HAVE_CONFIG_H
-#include <config.h>
+//#include <config.h>
#endif
#ifdef USE_POLARSSL
uint8_t encrypt_iv[AES_BLOCK_SIZE];
uint8_t decrypt_iv[AES_BLOCK_SIZE];
uint8_t decrypt_history[0x100];
-
+
unsigned int uiGood;
unsigned int uiLate;
unsigned int uiLost;
unsigned int uiResync;
-
+
unsigned int uiRemoteGood;
unsigned int uiRemoteLate;
unsigned int uiRemoteLost;
#endif
etimer_t tLastGood;
etimer_t tLastRequest;
- bool_t bInit;
+ bool_t bInit;
} cryptState_t;
void CryptState_init(cryptState_t *cs);
#define SSL_H_987698
#ifdef HAVE_CONFIG_H
-#include <config.h>
+//#include <config.h>
#endif
#ifdef USE_POLARSSL
int i, offset = 0;
char byte[3];
int scanned;
-
+
byte[2] = '\0';
for (i = 0; i < 20; i++) {
memcpy(byte, &in[i * 2], 2);