Simple network time protocol. More...
Data Structures | |
struct | _sntpframe |
struct | SNTP_resync_args |
Defines | |
#define | NUT_THREAD_SNTPSTACK 256 |
#define | NTP_PORT 123 |
#define | SNTP_PORT NTP_PORT |
Typedefs | |
typedef struct _sntpframe | sntpframe |
Functions | |
void | SNTP_resync (void *arg) |
int | NutSNTPGetTime (uint32_t *server_adr, time_t *t) |
int | NutSNTPStartThread (uint32_t server_addr, uint32_t interval) |
Simple network time protocol.
#define NUT_THREAD_SNTPSTACK 256 |
Definition at line 103 of file sntp.c.
Referenced by NutSNTPStartThread().
#define SNTP_PORT NTP_PORT |
Definition at line 127 of file sntp.c.
Referenced by NutSNTPGetTime().
typedef struct _sntpframe sntpframe |
void SNTP_resync | ( | void * | arg | ) |
Definition at line 134 of file sntp.c.
References free(), SNTP_resync_args::interval, NutSleep(), NutSNTPGetTime(), NutThreadSetPriority(), SNTP_resync_args::server_addr, and stime().
Referenced by NutSNTPStartThread().
Definition at line 165 of file sntp.c.
References _DAY_SEC, _LEAP_YEAR_ADJUST, calloc, free(), _sntpframe::mode, ntohl, NutUdpCreateSocket(), NutUdpDestroySocket(), NutUdpReceiveFrom(), NutUdpSendTo(), NutUdpSetSockOpt(), SNTP_PORT, SO_RCVBUF, and _sntpframe::transmit_ts_sec.
Referenced by main(), and SNTP_resync().
Definition at line 221 of file sntp.c.
References free(), SNTP_resync_args::interval, malloc(), NUT_THREAD_SNTPSTACK, NUT_THREAD_STACK_ADD, NUT_THREAD_STACK_MULT, NutThreadCreate(), SNTP_resync_args::server_addr, and SNTP_resync().