Prosody generic: API: sm_udp_collector_create

Prototype Definition

int sm_udp_collector_create(struct sm_udp_collector_create_parms *dp)

Parameters

*dp
a structure of the following type:
typedef struct sm_udp_collector_create_parms {
	tSMCollectorId collector;				/* out */
	tSMModuleId module;					/* in */
	struct in_addr address;					/* in */
} SM_UDP_COLLECTOR_CREATE_PARMS;

Description

Allocates, on a specific module, a new UDP collector to receive incoming UDP data. If the call completes successfully, the parameter collector will be set to the identifier for that collector.

A collector is automatically allocated a port number for incoming UDP data, this information may be obtained from sm_collector_status().

This requires the module fromudp to have been downloaded.

Fields

collector
The newly created collector.
module
A value obtained from sm_open_module() which indicates the module where the collector to be allocated.
address
The address on which this UDP collector is to listen.

Returns

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


This function is part of the Prosody generic API.