Prosody generic: API: sm_collector_status

Prototype Definition

int sm_collector_status(struct sm_collector_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_collector_status_parms {
	tSMCollectorId collector;				/* in */
	enum kSMCollectorStatus {
		kSMCollectorStatusRunning,
		kSMCollectorStatusGotPorts,
		kSMCollectorStatusNewPeer,
		kSMCollectorStatusGotPortsIPv6,
		kSMCollectorStatusNewPeerIPv6,
	} status;						/* out */
	union {
		struct {
			struct in_addr address;			/* out */
			int port;				/* out */
		} ports;					/* out */
		struct {
			struct in_addr address;			/* out */
			int port;				/* out */
		} peer;						/* out */
		struct {
			struct in6_addr address;		/* out */
			int port;				/* out */
		} ports_ipv6;					/* out */
		struct {
			struct in6_addr address;		/* out */
			int port;				/* out */
		} peer_ipv6;					/* out */
	} u;							/* out */
} SM_COLLECTOR_STATUS_PARMS;

Description

Returns the current status of the collector or an error to indicate that an error has occurred.

When the collector event, obtained from sm_collector_get_event(), is signalled the user must call this function to determine the nature of the status change. The change in status may indicate that an error occurred whilst processing a user request or it may be notifiying the user of a change to the previous state of the collector.

Fields

collector
The collector to interrogate
status
One of these values:
kSMCollectorStatusRunning
The collector is running normally.
kSMCollectorStatusGotPorts
Indicates that IPv4 port information is available.
kSMCollectorStatusNewPeer
Indicates that UDP packets are being received from a new IPv4 source.
kSMCollectorStatusGotPortsIPv6
Indicates that IPv6 port information is available.
kSMCollectorStatusNewPeerIPv6
Indicates that UDP packets are being received from a new IPv6 source.
u
Additional information relating to the current status of the collector
ports
This field is only valid if the status is kSMCollectorStatusGotPorts.
address
The address on which this collector is listening.
port
The UDP port number on which this collector is listening
peer
This field is only valid if the status is kSMCollectorStatusNewPeer.
address
The address from which the data was received.
port
The UDP port number from which the data was received.
ports_ipv6
This field is only valid if the status is kSMCollectorStatusGotPortsIPv6.
address
The address on which this collector is listening.
port
The UDP port number on which this collector is listening
peer_ipv6
This field is only valid if the status is kSMCollectorStatusNewPeerIPv6.
address
The address from which the data was received.
port
The UDP port number from which the data was received.

Returns

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


This function is part of the Prosody generic API.