SNTP
[User Protocols]

Collaboration diagram for SNTP:

Detailed Description

Simple network time protocol.

Todo:
Enhance documentation.


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)


Define Documentation

#define NUT_THREAD_SNTPSTACK   256

Definition at line 93 of file sntp.c.

Referenced by NutSNTPStartThread().

#define NTP_PORT   123

Definition at line 116 of file sntp.c.

#define SNTP_PORT   NTP_PORT

Definition at line 117 of file sntp.c.

Referenced by NutSNTPGetTime().


Typedef Documentation

typedef struct _sntpframe sntpframe

Definition at line 96 of file sntp.c.


Function Documentation

void SNTP_resync ( void *  arg  ) 

Definition at line 124 of file sntp.c.

References NutHeapFree(), NutSleep(), NutSNTPGetTime(), NutThreadSetPriority(), and stime().

Referenced by NutSNTPStartThread().

int NutSNTPGetTime ( uint32_t server_adr,
time_t t 
)

Definition at line 155 of file sntp.c.

References _DAY_SEC, _LEAP_YEAR_ADJUST, ntohl, NutHeapAllocClear(), NutHeapFree(), NutUdpCreateSocket(), NutUdpDestroySocket(), NutUdpReceiveFrom(), NutUdpSendTo(), NutUdpSetSockOpt(), SNTP_PORT, and SO_RCVBUF.

int NutSNTPStartThread ( uint32_t  server_addr,
uint32_t  interval 
)

Definition at line 211 of file sntp.c.

References NUT_THREAD_SNTPSTACK, NutHeapAlloc(), NutHeapFree(), NutThreadCreate(), and SNTP_resync().


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/