Prosody SNTP Client: API: sm_sntp_config

Prototype Definition

int sm_sntp_config(struct sm_sntp_config_parms *configp)

Parameters

*configp
a structure of the following type:
typedef struct sm_sntp_config_parms {
	tSMSNTPId sntp;						/* in */
	SOCKADDR_IN server;					/* in */
	int TOS;						/* in */
	tSM_UT32 no_reply_delay;				/* in */
	tSM_UT32 had_reply_delay;				/* in */
} SM_SNTP_CONFIG_PARMS;

Description

This function configures the NTP server used by the SNTP client. If the reply to a NTP request is not received within no_reply_delay then the next request is sent. Otherwise the next NTP request is sent had_reply_delay after the previous request.

Fields

sntp
The SNTP client to configure.
server
The SOCKADDR_IN structure specifying the destination IP address and port of the NTP server to use. A struct SOCKADDR_IN must be configured with an address family, an IP address and a port. Note that most operating systems define this structure such that fields are in network byte order. The structure must be correctly cast such that an IP V4 address is specified.
TOS
The Type Of Service (TOS) indicator to be sent in the NTP packets.
no_reply_delay
The delay, in ms, between requests when no reply has been received.
had_reply_delay
The delay, in ms, between requests when a reply has been received.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody SNTP Client API.