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:
- ERR_SM_DEVERR - device error
- ERR_SM_NO_RESOURCES - if no suitable output channel free
- ERR_SM_NO_SUCH_MODULE - if invalid module identifier specified
This function is part of the Prosody SNTP Client API.