int sm_udp_collector_create(struct sm_udp_collector_create_parms *dp)
typedef struct sm_udp_collector_create_parms { tSMCollectorId collector; /* out */ tSMModuleId module; /* in */ enum kSMCollectorType { kSMCollectorTypeIPv4, kSMCollectorTypeIPv6, } type; /* in */ struct in_addr address; /* in */ struct in6_addr ipv6_address; /* in */ } SM_UDP_COLLECTOR_CREATE_PARMS;
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.
0 if call completed successfully, otherwise a standard error such as:
This function is part of the Prosody generic API.