Prosody SNTP Client: API: sm_sntp_create

Prototype Definition

int sm_sntp_create(struct sm_sntp_create_parms *createp)

Parameters

*createp
a structure of the following type:
typedef struct sm_sntp_create_parms {
	tSMSNTPId sntp;						/* out */
	tSMModuleId module;					/* in */
	enum kSMSNTPType {
		kSMSNTPTypeIPv4,
		kSMSNTPTypeIPv6,
	} type;							/* in */
	struct in_addr address;					/* in */
	struct in6_addr ipv6_address;				/* in */
} SM_SNTP_CREATE_PARMS;

Description

Creates an SNTP Client.

Fields

sntp
The created SNTP client.
module
A value obtained from sm_open_module() Indicates the module on which the SNTP client is to be created.
type
One of these values:
kSMSNTPTypeIPv4
The SNTP client is to receive IPv4 packets
kSMSNTPTypeIPv6
The SNTP client is to receive IPv6 packets
address
The address on which the SNTP client listens for replies if type is kSMSNTPTypeIPv4.
ipv6_address
The address on which the SNTP client listens for replies if type is kSMSNTPTypeIPv6.

Returns

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


This function is part of the Prosody SNTP Client API.