#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#ifdef _WIN32
#include <string.h>
#include<WS2tcpip.h>
#include <windows.h>
#pragma comment(lib,"ws2_32.lib")
#else
#include "logLib.h"
#include "socket.h"
#endif
#define DIFF 4294.967296
#define GAP 2208988800
#define NTP_VERSION 3
#define NTP_MODE_CLIENT 0x3
#define NTP_HEADER_VERSION_SET(_header, _x) (_header |= ((_x & 0x7) << 0))
#define NTP_HEADER_MODE_SET(_header, _x) (_header |= ((_x & 0x7) << 3))
typedef struct
{
unsigned int seconds;
unsigned int fraction;
} ntp_timestamp;
typedef struct
{
int header;
int root_delay;
int root_dispersion;
int reference_identifier;
ntp_timestamp