The following functions are provided by the Prosody SPRT end point API:
API call | W | Description |
---|---|---|
sm_sprt_config() | Configure the SPRT end point using IPv4 | |
sm_sprt_config_data_channel() | Configure which SPRT channel is used for data | |
sm_sprt_config_data_format() | Configure the SPRT end point data format | |
sm_sprt_config_ipv6() | Configure the SPRT end point using IPv6 | |
sm_sprt_config_reliable_channel() | Configure the reliable channels of the SPRT end point | |
sm_sprt_create() | Create an SPRT end point | |
sm_sprt_datafeed_connect() | Connect a datafeed to an SPRT end point | |
sm_sprt_destroy() | Destroy an SPRT end point | |
sm_sprt_get_datafeed() | Obtain a datafeed from a SPRT end point | |
sm_sprt_get_event() | Get an event for the SPRT end point | |
sm_sprt_read_message() | Read a message from a SPRT end point | |
sm_sprt_send_message() | Send a message via a SPRT end point | |
sm_sprt_status() | Fetch status info on a SPRT end point |
This document is also available as separate pages for each function.
int sm_sprt_config(struct sm_sprt_config_parms *configp)
typedef struct sm_sprt_config_parms { tSMSPRTId sprt; /* in */ SOCKADDR_IN dest; /* in */ SOCKADDR_IN src; /* in */ int payload_type; /* in */ } SM_SPRT_CONFIG_PARMS;
Configures the destination of the transmitted SPRT packets and the payload type identifier to use in those packets.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_config_data_channel(struct sm_sprt_config_data_channel_parms *configp)
typedef struct sm_sprt_config_data_channel_parms { tSMSPRTId sprt; /* in */ int data_channel; /* in */ int max_payload_length; /* in */ int max_latency; /* in */ } SM_SPRT_CONFIG_DATA_CHANNEL_PARMS;
Configures the channel used for data by the SPRT end point. The default is channel 3, but can be either 1 or 3.
A packet is filled with the data passed in via the datafeed and is sent when it has reached the max_payload_length or it has had data for max_latency milliseconds.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_config_data_format(struct sm_sprt_config_data_format_parms *configp)
typedef struct sm_sprt_config_data_format_parms { tSMSPRTId sprt; /* in */ enum kSMSPRTDataDirection { kSMSPRTDataDirectionTx, kSMSPRTDataDirectionRx, } direction; /* in */ enum kSMSPRTDataFormat { kSMSPRTDataFormatNone, kSMSPRTDataFormatIOctet, kSMSPRTDataFormatIOctetCS, kSMSPRTDataFormatIRawOctet, } format; /* in */ } SM_SPRT_CONFIG_DATA_FORMAT_PARMS;
Configures the data formats used.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_config_ipv6(struct sm_sprt_config_ipv6_parms *configp)
typedef struct sm_sprt_config_ipv6_parms { tSMSPRTId sprt; /* in */ SOCKADDR_IN6 dest; /* in */ SOCKADDR_IN6 src; /* in */ int payload_type; /* in */ } SM_SPRT_CONFIG_IPV6_PARMS;
Configures the destination of the transmitted SPRT packets and the payload type identifier to use in those packets.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_config_reliable_channel(struct sm_sprt_config_reliable_channel_parms *configp)
typedef struct sm_sprt_config_reliable_channel_parms { tSMSPRTId sprt; /* in */ int channel; /* in */ int window_size; /* in */ int timer_TA01; /* in */ int timer_TA02; /* in */ int timer_TR03; /* in */ } SM_SPRT_CONFIG_RELIABLE_CHANNEL_PARMS;
Configures the settings for one of the reliable SPRT channels. Hence channel must be either 1 or 2.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_create(struct sm_sprt_create_parms *createp)
typedef struct sm_sprt_create_parms { tSMSPRTId sprt; /* out */ tSMModuleId module; /* in */ } SM_SPRT_CREATE_PARMS;
Creates an SPRT end point.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_datafeed_connect(struct sm_sprt_datafeed_connect_parms *datafeedp)
typedef struct sm_sprt_datafeed_connect_parms { tSMDatafeedId data_source; /* in */ tSMSPRTId sprt; /* in */ } SM_SPRT_DATAFEED_CONNECT_PARMS;
Connects a datafeed to a SPRT end point.
Requires the module datafeed to have been downloaded.
0 if call completed successfully, otherwise a standard error.
int sm_sprt_destroy(tSMSPRTId sprt)
Destroys an SPRT end point.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_get_datafeed(struct sm_sprt_get_datafeed_parms *datafeedp)
typedef struct sm_sprt_get_datafeed_parms { tSMSPRTId sprt; /* in */ tSMDatafeedId datafeed; /* out */ } SM_SPRT_GET_DATAFEED_PARMS;
Request a datafeed identifier from a SPRT end point.
It is valid until the SPRT end point is destroyed.
Datafeed connections can only be made between objects allocated
on the same tSMModuleId
.
Requires the module datafeed to have been downloaded.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_get_event(struct sm_sprt_get_event_parms *eventp)
typedef struct sm_sprt_get_event_parms { tSMSPRTId sprt; /* in */ tSMEventId event; /* out */ } SM_SPRT_GET_EVENT_PARMS;
the event will be signalled when a status change occurs on the SPRT end point.
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_read_message(struct sm_sprt_read_message_parms *datafeedp)
typedef struct sm_sprt_read_message_parms { tSMSPRTId sprt; /* in */ char *message; /* inout */ int max_length; /* in */ int length; /* out */ } SM_SPRT_READ_MESSAGE_PARMS;
Reads a message from a SPRT end point
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_send_message(struct sm_sprt_send_message_parms *datafeedp)
typedef struct sm_sprt_send_message_parms { tSMSPRTId sprt; /* in */ char *message; /* in */ int length; /* in */ } SM_SPRT_SEND_MESSAGE_PARMS;
Send a SPRT packet with the message data as the payload
0 if call completed successfully, otherwise a standard error such as:
int sm_sprt_status(struct sm_sprt_status_parms *statusp)
typedef struct sm_sprt_status_parms { tSMSPRTId sprt; /* in */ enum kSMSPRTStatus { kSMSPRTStatusRunning, kSMSPRTStatusStopped, kSMSPRTStatusMessage, } status; /* out */ } SM_SPRT_STATUS_PARMS;
returns the status of the SPRT end point.
0 if call completed successfully, otherwise a standard error such as:
These functions constitute the Prosody SPRT end point API.