Prosody SNTP Client: API: sm_sntp_status

Prototype Definition

int sm_sntp_status(struct sm_sntp_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_sntp_status_parms {
	tSMSNTPId sntp;						/* in */
	enum kSMSNTPStatus {
		kSMSNTPStatusRunning,
		kSMSNTPStatusStopped,
		kSMSNTPStatusSync,
	} status;						/* out */
	union {
		struct {
			int has_sync;				/* out */
		} sync;						/* out */
	} u;							/* out */
} SM_SNTP_STATUS_PARMS;

Description

returns the status of the SNTP client.

Fields

sntp
The SNTP client.
status
The status. One of these values:
kSMSNTPStatusRunning
The SNTP client is running
kSMSNTPStatusStopped
The SNTP client is not running
kSMSNTPStatusSync
The SNTP client synchronisation state has changed
u
Additional information relating to the current status of the SNTP client
sync
This field is only valid if the status is kSMSNTPStatusSync.
has_sync
An indicator of whether the SNTP client is synchronised with the NTP server

Returns

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


This function is part of the Prosody SNTP Client API.