UM C API  6.16
lbmmon.h File Reference

Ultra Messaging (UM) Monitoring API. The "lbmmon.h" header file defines APIs for UM application monitoring, both the send side (application being monitored) and the receive side (application doing the monitoring). The binary code is contained in the "lbm" library (dynamic on Unix: "liblbm.so", static on Unix: "liblbm.a", dynamic only on Windows: "lbm.dll"). See Monitoring UM with the lbmmon API for general information on UM monitoring. See UM C API for general information on the C API. See Fundamental Concepts for an introduction to Ultra Messaging. More...

#include <stdlib.h>
#include <lbm/lbm.h>
#include <gen/um_mon_attributes.pb-c.h>
#include <gen/ump_mon.pb-c.h>
#include <gen/um_mon_control.pb-c.h>
#include <gen/ums_mon.pb-c.h>
#include <gen/dro_mon.pb-c.h>
#include <gen/srs_mon.pb-c.h>
#include <lbm/lbmmonfmtcsv.h>
#include <lbm/lbmmonfmtpb.h>
#include <lbm/lbmmontrlbm.h>
#include <lbm/lbmmontrudp.h>
#include <lbm/lbmmontrlbmsnmp.h>

Go to the source code of this file.

Data Structures

struct  lbmmon_packet_hdr_t_stct
 Statistics packet header layout. More...
 
struct  lbmmon_packet_attributes_t_stct
 
struct  lbmmon_attr_block_t_stct
 Statistics attribute block layout. Associated with each statistics message is a set of optional attributes. Any attributes present will immediately follow the packet header. More...
 
struct  lbmmon_attr_entry_t_stct
 Statistics attribute entry layout. Each attribute entry within the attributes block consists of an entry header, followed immediately by the attribute data. More...
 
struct  lbmmon_format_func_t_stct
 Format module function pointer container. More...
 
struct  lbmmon_rcv_statistics_func_t_stct
 A structure that holds the callback information for receiver statistics. More...
 
struct  lbmmon_src_statistics_func_t_stct
 A structure that holds the callback information for source statistics. More...
 
struct  lbmmon_evq_statistics_func_t_stct
 A structure that holds the callback information for event queue statistics. More...
 
struct  lbmmon_ctx_statistics_func_t_stct
 A structure that holds the callback information for context statistics. More...
 
struct  lbmmon_rcv_topic_statistics_func_t_stct
 For internal use only. A structure that holds the callback information for receiver topic statistics. More...
 
struct  lbmmon_wildcard_rcv_statistics_func_t_stct
 A structure that holds the callback information for wildcard receiver statistics. More...
 
struct  lbmmon_umestore_statistics_func_t_stct
 A structure that holds the callback information for store statistics. More...
 
struct  lbmmon_gateway_statistics_func_t_stct
 A structure that holds the callback information for gateway statistics. More...
 
struct  lbmmon_passthrough_statistics_func_t_stct
 A structure that holds the callback information for the passthrough format option. More...
 
struct  lbmmon_transport_func_t_stct
 Transport module function pointer container. More...
 

Macros

#define LBM_GNU_PRAGMA(w)
 
#define LBM_GNU_PRAGMA_RESET()
 
#define LBMMON_ERROR_BASE   4096
 
#define LBMMON_EINVAL   (LBMMON_ERROR_BASE + 1)
 
#define LBMMON_ENOMEM   (LBMMON_ERROR_BASE + 2)
 
#define LBMMON_EMODFAIL   (LBMMON_ERROR_BASE + 3)
 
#define LBMMON_ELBMFAIL   (LBMMON_ERROR_BASE + 4)
 
#define LBMMON_EAGAIN   (LBMMON_ERROR_BASE + 5)
 
#define LBMMON_EALREADY   (LBMMON_ERROR_BASE + 6)
 
#define LBMMON_EOP   (LBMMON_ERROR_BASE + 7)
 
#define LBMMON_PACKET_SIGNATURE   0x1b33041b
 
#define LBMMON_PACKET_TYPE_SOURCE   0
 
#define LBMMON_PACKET_TYPE_RECEIVER   1
 
#define LBMMON_PACKET_TYPE_EVENT_QUEUE   2
 
#define LBMMON_PACKET_TYPE_CONTEXT   3
 
#define LBMMON_PACKET_TYPE_RECEIVER_TOPIC   4
 
#define LBMMON_PACKET_TYPE_WILDCARD_RECEIVER   5
 
#define LBMMON_PACKET_TYPE_UMESTORE   6
 
#define LBMMON_PACKET_TYPE_GATEWAY   7
 
#define LBMMON_PACKET_TYPE_UMDS   8
 
#define LBMMON_PACKET_TYPE_CONTROL_MESSAGE   9
 
#define LBMMON_PACKET_TYPE_SRS   10
 
#define LBMMON_SERIALIZE_PACK_MESSAGE   0
 
#define LBMMON_SERIALIZE_CALC_SIZE_ONLY   1
 
#define LBMMON_ATTR_BLOCK_MAGIC   0xABCD
 
#define LBMMON_ATTR_BLOCK_FORMAT_TABLE   0
 
#define LBMMON_ATTR_BLOCK_FORMAT_PB   1
 
#define LBMMON_ATTR_SENDER_IPV4   0
 
#define LBMMON_ATTR_TIMESTAMP   1
 
#define LBMMON_ATTR_APPSOURCEID   2
 
#define LBMMON_ATTR_FORMAT_MODULEID   3
 
#define LBMMON_ATTR_OBJECTID   4
 
#define LBMMON_ATTR_CONTEXTID   LBMMON_ATTR_OBJECTID
 
#define LBMMON_ATTR_PROCESSID   5
 
#define LBMMON_ATTR_SOURCE   6
 
#define LBMMON_ATTR_CTXINST   7
 
#define LBMMON_ATTR_DOMAINID   8
 
#define LBMMON_ATTR_SOURCE_NORMAL   0
 
#define LBMMON_ATTR_SOURCE_IM   1
 
#define LBMMON_FORMAT_CSV_MODULE_ID   1
 
#define LBMMON_FORMAT_PB_MODULE_ID   2
 
#define LBMMON_FORMAT_ATTRIBUTES_PB   1
 
#define LBMMON_FORMAT_ATTRIBUTES_TABLE   2
 
#define MAKE_MODULE_VERSION(format, version)   ((unsigned short) ((((unsigned char) format) << 8) | ((unsigned char) version)))
 
#define MODULE_ID(id)   ((unsigned char) ((id & 0xff00) >> 8))
 
#define MODULE_VERSION(id)   ((unsigned char) (id & 0xff))
 
#define LBMMON_FORMAT_PASSTHROUGH_OFF   0
 
#define LBMMON_FORMAT_PASSTHROUGH_ON   1
 
#define LBMMON_FORMAT_PASSTHROUGH_CONVERT   2
 
#define LBMMON_FORMAT_FILTER_OFF   0
 
#define LBMMON_FORMAT_FILTER_ON   1
 
#define LBMMON_FORMAT_FILTER_EQ   2
 
#define LBMMON_FORMAT_FILTER_NE   3
 
#define LBMMON_FORMAT_FILTER_LT   4
 
#define LBMMON_FORMAT_FILTER_GT   5
 
#define LBMMON_FORMAT_SELECT_EQ   6
 
#define LBMMON_FORMAT_SELECT_NE   7
 
#define LBMMON_FORMAT_SELECT_LT   8
 
#define LBMMON_FORMAT_SELECT_GT   9
 
#define LBMMON_FORMAT_SELECT_MATCH   10
 
#define LBMMON_FORMAT_SELECT_MATCH_REGX   11
 
#define LBMMON_FORMAT_DESERIALIZE_OK   0
 
#define LBMMON_FORMAT_DESERIALIZE_PASSTHROUGH   1
 
#define LBMMON_FORMAT_DESERIALIZE_CONVERT_PASSTHROUGH   2
 
#define LBMMON_FORMAT_DESERIALIZE_FAILURE   -1
 
#define LBMMON_FORMAT_DESERIALIZE_TOO_SMALL   -2
 
#define LBMMON_RCTL_RECEIVER_CALLBACK   0
 
#define LBMMON_RCTL_SOURCE_CALLBACK   1
 
#define LBMMON_RCTL_EVENT_QUEUE_CALLBACK   2
 
#define LBMMON_RCTL_CONTEXT_CALLBACK   3
 
#define LBMMON_RCTL_RECEIVER_TOPIC_CALLBACK   4
 
#define LBMMON_RCTL_WILDCARD_RECEIVER_CALLBACK   5
 
#define LBMMON_RCTL_UMESTORE_CALLBACK   6
 
#define LBMMON_RCTL_GATEWAY_CALLBACK   7
 
#define LBMMON_RCTL_PASSTHROUGH_CALLBACK   8
 

Typedefs

typedef struct lbmmon_packet_hdr_t_stct lbmmon_packet_hdr_t
 Statistics packet header layout. More...
 
typedef struct lbmmon_packet_attributes_t_stct lbmmon_packet_attributes_t
 
typedef struct lbmmon_attr_block_t_stct lbmmon_attr_block_t
 Statistics attribute block layout. Associated with each statistics message is a set of optional attributes. Any attributes present will immediately follow the packet header.
 
typedef struct lbmmon_attr_entry_t_stct lbmmon_attr_entry_t
 Statistics attribute entry layout. Each attribute entry within the attributes block consists of an entry header, followed immediately by the attribute data.
 
typedef int(* lbmmon_format_init_t) (void **FormatClientData, const void *FormatOptions)
 Function to initialize a format module. More...
 
typedef int(* lbmmon_format_apply_options_t) (void *FormatClientData, const void *FormatOptions)
 Function to apply options to a format module at startup or dynamically to a running system. More...
 
typedef int(* lbmmon_rcv_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_rcv_transport_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_rcv_transport_stats_t structure. More...
 
typedef int(* lbmmon_src_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_src_transport_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_src_transport_stats_t structure. More...
 
typedef int(* lbmmon_evq_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_event_queue_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_event_queue_stats_t structure. More...
 
typedef int(* lbmmon_ctx_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_context_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_context_stats_t structure. More...
 
typedef int(* lbmmon_rcv_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_rcv_transport_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 Function to deserialize a buffer into an lbm_rcv_transport_stats_t structure. More...
 
typedef int(* lbmmon_src_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_src_transport_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 Function to deserialize a buffer into an lbm_src_transport_stats_t structure. More...
 
typedef int(* lbmmon_evq_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_event_queue_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 Function to deserialize a buffer into an lbm_event_queue_stats_t structure. More...
 
typedef int(* lbmmon_ctx_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_context_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 Function to deserialize a buffer into an lbm_context_stats_t structure. More...
 
typedef int(* lbmmon_rcv_topic_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const char *Topic, lbm_ulong_t SourceCount, const lbm_rcv_topic_stats_t *Sources, void *FormatClientData)
 Function to serialize receiver topic statistics. More...
 
typedef int(* lbmmon_rcv_topic_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, size_t *Count, lbm_rcv_topic_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 Function to deserialize a buffer into an lbm_rcv_topic_stats_t structure. More...
 
typedef int(* lbmmon_wildcard_rcv_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_wildcard_rcv_stats_t *Statistics, void *FormatClientData)
 Function to serialize wildcard receiver statistics. More...
 
typedef int(* lbmmon_wildcard_rcv_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_wildcard_rcv_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 Function to deserialize a buffer into an lbm_wildcard_rcv_stats_t structure. More...
 
typedef int(* lbmmon_umestore_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, Lbmmon__UMPMonMsg *StoreMsg, int Action, void *FormatClientData)
 Function to serialize store statistics. More...
 
typedef int(* lbmmon_umestore_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, Lbmmon__UMPMonMsg **StoreMsg, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 
typedef char *(* lbmmon_umestore_filter_options_t) (const char *FormatOptions)
 Function to return the store filter options from a format module. More...
 
typedef int(* lbmmon_umestore_free_unpacked_t) (Lbmmon__UMPMonMsg *StoreMsg)
 Function to free an unpacked Lbmmon__UMPMonMsg structure. More...
 
typedef int(* lbmmon_gateway_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, Lbmmon__DROMonMsg *GatewayMsg, void *FormatClientData)
 Function to serialize gateway statistics. More...
 
typedef int(* lbmmon_gateway_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, Lbmmon__DROMonMsg **GatewayMsg, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)
 
typedef int(* lbmmon_gateway_free_unpacked_t) (Lbmmon__DROMonMsg *GatewayMsg)
 Function to free an unpacked Lbmmon__DROMonMsg structure. More...
 
typedef int(* lbmmon_format_finish_t) (void *FormatClientData)
 Function to finish format module processing. More...
 
typedef const char *(* lbmmon_format_errmsg_t) (void)
 Function to return the last error message from a format module. More...
 
typedef struct lbmmon_format_func_t_stct lbmmon_format_func_t
 Format module function pointer container.
 
typedef void(* lbmmon_rcv_statistics_cb) (const void *AttributeBlock, const lbm_rcv_transport_stats_t *Statistics, void *ClientData)
 Client callback function to process a received receiver statistics packet. More...
 
typedef struct lbmmon_rcv_statistics_func_t_stct lbmmon_rcv_statistics_func_t
 A structure that holds the callback information for receiver statistics. More...
 
typedef void(* lbmmon_src_statistics_cb) (const void *AttributeBlock, const lbm_src_transport_stats_t *Statistics, void *ClientData)
 Client callback function to process a received source statistics packet. More...
 
typedef struct lbmmon_src_statistics_func_t_stct lbmmon_src_statistics_func_t
 A structure that holds the callback information for source statistics. More...
 
typedef void(* lbmmon_evq_statistics_cb) (const void *AttributeBlock, const lbm_event_queue_stats_t *Statistics, void *ClientData)
 Client callback function to process a received event queue statistics packet. More...
 
typedef struct lbmmon_evq_statistics_func_t_stct lbmmon_evq_statistics_func_t
 A structure that holds the callback information for event queue statistics. More...
 
typedef void(* lbmmon_ctx_statistics_cb) (const void *AttributeBlock, const lbm_context_stats_t *Statistics, void *ClientData)
 Client callback function to process a received context statistics packet. More...
 
typedef struct lbmmon_ctx_statistics_func_t_stct lbmmon_ctx_statistics_func_t
 A structure that holds the callback information for context statistics. More...
 
typedef void(* lbmmon_rcv_topic_statistics_cb) (const void *AttributeBlock, const lbm_rcv_topic_stats_t *Statistics, void *ClientData)
 For internal use only. Client callback function to process a received receiver topic statistics packet. More...
 
typedef struct lbmmon_rcv_topic_statistics_func_t_stct lbmmon_rcv_topic_statistics_func_t
 For internal use only. A structure that holds the callback information for receiver topic statistics. More...
 
typedef void(* lbmmon_wildcard_rcv_statistics_cb) (const void *AttributeBlock, const lbm_wildcard_rcv_stats_t *Statistics, void *ClientData)
 For internal use only. Client callback function to process a received wildcard receiver statistics packet. More...
 
typedef struct lbmmon_wildcard_rcv_statistics_func_t_stct lbmmon_wildcard_rcv_statistics_func_t
 A structure that holds the callback information for wildcard receiver statistics. More...
 
typedef void(* lbmmon_umestore_statistics_cb) (const void *AttributeBlock, const Lbmmon__UMPMonMsg *StoreMsg, void *ClientData)
 Client callback function to process a received store statistics packet. More...
 
typedef struct lbmmon_umestore_statistics_func_t_stct lbmmon_umestore_statistics_func_t
 A structure that holds the callback information for store statistics. More...
 
typedef void(* lbmmon_gateway_statistics_cb) (const void *AttributeBlock, const Lbmmon__DROMonMsg *GatewayMsg, void *ClientData)
 Client callback function to process a received gateway statistics packet. More...
 
typedef struct lbmmon_gateway_statistics_func_t_stct lbmmon_gateway_statistics_func_t
 A structure that holds the callback information for gateway statistics. More...
 
typedef void(* lbmmon_passthrough_statistics_cb) (const lbmmon_packet_hdr_t *PacketHeader, lbmmon_packet_attributes_t *Attributes, void *AttributeBlock, void *Statistics, size_t Length, void *ClientData)
 Client callback function to process a statistics packet when using the passthrough format option. More...
 
typedef struct lbmmon_passthrough_statistics_func_t_stct lbmmon_passthrough_statistics_func_t
 A structure that holds the callback information for the passthrough format option. More...
 
typedef int(* lbmmon_transport_initsrc_t) (void **TransportClientData, const void *TransportOptions)
 Function to initialize a transport module to serve as a source of statistics. More...
 
typedef int(* lbmmon_transport_initrcv_t) (void **TransportClientData, const void *TransportOptions)
 Function to initialize a transport module to serve as a receiver of statistics. More...
 
typedef int(* lbmmon_transport_send_t) (const char *Data, size_t Length, void *TransportClientData)
 Send a statistics packet. More...
 
typedef int(* lbmmon_transport_receive_t) (char *Data, size_t *Length, unsigned int TimeoutMS, void *TransportClientData)
 Receive statistics data. More...
 
typedef int(* lbmmon_transport_finishsrc_t) (void *TransportClientData)
 Finish processing for a source transport. More...
 
typedef int(* lbmmon_transport_finishrcv_t) (void *TransportClientData)
 Finish processing for a receiver transport. More...
 
typedef const char *(* lbmmon_transport_errmsg_t) (void)
 Function to return the last error message from a transport module. More...
 
typedef const char *(* lbmmon_transport_ctrlmsgtarget_t) (void)
 Function to return the target address for control message requests. More...
 
typedef int(* lbmmon_transport_ctrlmsg_receive_t) (char *Data, size_t *Length, void *TransportClientData)
 Receive control message requests. More...
 
typedef int(* lbmmon_transport_ctrlmsg_response_t) (const char *Data, size_t Length, void *TransportClientData)
 Function to send response to control message requests. More...
 
typedef const int(* lbmmon_transport_allow_debug_t) (void *TransportClientData)
 Function to return the allow debug indicator from a transport module. More...
 
typedef struct lbmmon_transport_func_t_stct lbmmon_transport_func_t
 Transport module function pointer container.
 
typedef struct lbmmon_sctl_t_stct lbmmon_sctl_t
 LBM Monitoring Source Controller object (opaque).
 
typedef struct lbmmon_rctl_attr_t_stct lbmmon_rctl_attr_t
 LBM Monitoring Receiver Controller Attribute object (opaque).
 
typedef struct lbmmon_rctl_t_stct lbmmon_rctl_t
 LBM Monitoring Receiver Controller object (opaque).
 

Functions

LBMExpDLL int lbmmon_attributes_deserialize (lbmmon_packet_attributes_t *Attributes, char *Source, size_t Length)
 Deserialize the Attributes Block into the lbmmon_packet_attributes_t structure. More...
 
LBMExpDLL int lbmmon_sctl_create (lbmmon_sctl_t **Control, const lbmmon_format_func_t *Format, const void *FormatOptions, const lbmmon_transport_func_t *Transport, const void *TransportOptions)
 Create an LBM Monitoring Source Controller. More...
 
LBMExpDLL int lbmmon_rctl_attr_create (lbmmon_rctl_attr_t **Attributes)
 Create an LBM Monitoring Receive Controller attribute object. More...
 
LBMExpDLL int lbmmon_rctl_attr_delete (lbmmon_rctl_attr_t *Attributes)
 Delete an LBM Monitoring Receive Controller attribute object. More...
 
LBMExpDLL int lbmmon_rctl_attr_setopt (lbmmon_rctl_attr_t *Attributes, int Option, void *Value, size_t Length)
 Set an LBMMON receive controller attribute option value. More...
 
LBMExpDLL int lbmmon_rctl_attr_getopt (lbmmon_rctl_attr_t *Attributes, int Option, void *Value, size_t *Length)
 Get an LBMMON receive controller attribute option value. More...
 
LBMExpDLL int lbmmon_rctl_create (lbmmon_rctl_t **Control, const lbmmon_format_func_t *Format, const void *FormatOptions, const lbmmon_transport_func_t *Transport, const void *TransportOptions, lbmmon_rctl_attr_t *Attributes, void *ClientData)
 Create an LBM Monitoring Receive Controller. More...
 
LBMExpDLL int lbmmon_context_monitor (lbmmon_sctl_t *Control, lbm_context_t *Context, const char *ApplicationSourceID, unsigned int Seconds)
 Register a context for monitoring. More...
 
LBMExpDLL int lbmmon_context_unmonitor (lbmmon_sctl_t *Control, lbm_context_t *Context)
 Terminate monitoring for a context. More...
 
LBMExpDLL int lbmmon_src_monitor (lbmmon_sctl_t *Control, lbm_src_t *Source, const char *ApplicationSourceID, unsigned int Seconds)
 Register a source for monitoring. More...
 
LBMExpDLL int lbmmon_ssrc_monitor (lbmmon_sctl_t *Control, lbm_ssrc_t *SmartSource, const char *ApplicationSourceID, unsigned int Seconds)
 Register a smart source for monitoring. More...
 
LBMExpDLL int lbmmon_src_unmonitor (lbmmon_sctl_t *Control, lbm_src_t *Source)
 Terminate monitoring for a source. More...
 
LBMExpDLL int lbmmon_ssrc_unmonitor (lbmmon_sctl_t *Control, lbm_ssrc_t *SmartSource)
 Terminate monitoring for a smart source. More...
 
LBMExpDLL int lbmmon_rcv_monitor (lbmmon_sctl_t *Control, lbm_rcv_t *Receiver, const char *ApplicationSourceID, unsigned int Seconds)
 Register a receiver for monitoring. More...
 
LBMExpDLL int lbmmon_rcv_unmonitor (lbmmon_sctl_t *Control, lbm_rcv_t *Receiver)
 Terminate monitoring for a receiver. More...
 
LBMExpDLL int lbmmon_evq_monitor (lbmmon_sctl_t *Control, lbm_event_queue_t *EventQueue, const char *ApplicationSourceID, unsigned int Seconds)
 Register an event queue for monitoring. More...
 
LBMExpDLL int lbmmon_evq_unmonitor (lbmmon_sctl_t *Control, lbm_event_queue_t *EventQueue)
 Terminate monitoring for an event queue. More...
 
LBMExpDLL int lbmmon_sctl_destroy (lbmmon_sctl_t *Control)
 Destroy a source monitoring controller. More...
 
LBMExpDLL int lbmmon_rctl_destroy (lbmmon_rctl_t *Control)
 Destroy a statistics receive controller. More...
 
LBMExpDLL int lbmmon_sctl_sample (lbmmon_sctl_t *Control)
 Gather statistics for on-demand objects. More...
 
LBMExpDLL int lbmmon_sctl_sample_ex (lbmmon_sctl_t *Control, const char *ApplicationSourceID)
 Extended gather statistics for on-demand objects. More...
 
LBMExpDLL int lbmmon_attr_get_ipv4sender (const void *AttributeBlock, lbm_uint_t *Address)
 Retrieve the IPV4 sender address attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_timestamp (const void *AttributeBlock, time_t *Timestamp)
 Retrieve the timestamp attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_appsourceid (const void *AttributeBlock, char *ApplicationSourceID, size_t Length)
 Retrieve the application source ID attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_objectid (const void *AttributeBlock, lbm_ulong_t *ObjectID)
 Retrieve the object ID attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_contextid (const void *AttributeBlock, lbm_ulong_t *ContextID)
 Retrieve the context ID attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_processid (const void *AttributeBlock, lbm_ulong_t *ProcessID)
 Retrieve the process ID attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_source (const void *AttributeBlock, lbm_ulong_t *Source)
 Retrieve the source attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_ctxinst (const void *AttributeBlock, lbm_uint8_t *ContextInstance, size_t Length)
 For internal use only. Retrieve the context instance attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_attr_get_domainid (const void *AttributeBlock, lbm_uint32_t *DomainID)
 For internal use only. Retrieve the domain ID attribute from the statistics attribute block. More...
 
LBMExpDLL int lbmmon_errnum (void)
 Retrieve the error number for the last error encountered. More...
 
LBMExpDLL const char * lbmmon_errmsg (void)
 Retrieve the error message for the last error encountered. More...
 
LBMExpDLL const char * lbmmon_next_key_value_pair (const char *String, char *Key, size_t KeySize, char *Value, size_t ValueSize)
 Retrieve the next key/value pair from a semicolon-separated list. More...
 
LBMExpDLL int lbmmon_control_serialize (char *Destination, size_t *Size, int Command, char *Data, int NodeType, char *ApplicationSourceID)
 Function to serialize a control message. More...
 
LBMExpDLL const char * lbmmon_control_valid_commands (void)
 Retrieve the list of valid LBMMON control commands. More...
 
LBMExpDLL const char * lbmmon_control_valid_node_types (void)
 Retrieve the list of valid LBMMON control node types. More...
 
LBMExpDLL int lbmmon_control_index_for_command (char *Command)
 Retrieve the index associated with the given LBMMON control command. More...
 
LBMExpDLL int lbmmon_control_index_for_node_type (char *NodeType)
 Retrieve the index associated with the given LBMMON control node type. More...
 
LBMExpDLL int lbmmon_control_load_data_from_filename (char *Filename, char **Data)
 Load data from filename into a buffer. More...
 
LBMExpDLL int lbmmon_control_dump_default_filter_options (void)
 Dump the default filter options to stdout. More...
 
LBMExpDLL const char * lbmmon_control_errmsg (void)
 Function to return the last error message from lbmmon_control. More...
 
LBMExpDLL void lbmmon_add_header (char *Packet, const char *Data, size_t Length, int PacketType)
 Add an LBMMON header to a serialized PB Buffer. More...
 

Detailed Description

Ultra Messaging (UM) Monitoring API. The "lbmmon.h" header file defines APIs for UM application monitoring, both the send side (application being monitored) and the receive side (application doing the monitoring). The binary code is contained in the "lbm" library (dynamic on Unix: "liblbm.so", static on Unix: "liblbm.a", dynamic only on Windows: "lbm.dll"). See Monitoring UM with the lbmmon API for general information on UM monitoring. See UM C API for general information on the C API. See Fundamental Concepts for an introduction to Ultra Messaging.

Macro Definition Documentation

#define LBMMON_ATTR_APPSOURCEID   2

Attribute block entry contains the application source ID string.

#define LBMMON_ATTR_BLOCK_FORMAT_PB   1

Attribute block in Protocol Buffer format

#define LBMMON_ATTR_BLOCK_FORMAT_TABLE   0

Attribute block in table format

#define LBMMON_ATTR_BLOCK_MAGIC   0xABCD

Used to differentiate between attribute block in lbmmon_packet_attributes_t format (lbmmon_packet_attributes_t_stct.mPacketAttributesMagic == LBMMON_ATTR_BLOCK_MAGIC vs. an array of lbmmon_attr_block_t structures.

#define LBMMON_ATTR_CONTEXTID   LBMMON_ATTR_OBJECTID

Attribute block entry contains the context ID.

Deprecated:
Use LBMMON_ATTR_OBJECTID instead.
#define LBMMON_ATTR_CTXINST   7

Attribute block entry contains the context instance.

#define LBMMON_ATTR_DOMAINID   8

Attribute block entry contains the domain ID.

#define LBMMON_ATTR_FORMAT_MODULEID   3

Attribute block entry contains the format module ID. See LBMMON_FORMAT_* for possible values. Used to determine the format of the statistics packet. Values 1 and 2 are currently defined. Values 3 through 9 are reserved for UM use. Values 10 and over can be used for custom formats.

#define LBMMON_ATTR_OBJECTID   4

Attribute block contains the object ID.

#define LBMMON_ATTR_PROCESSID   5

Attribute block entry contains the process ID.

#define LBMMON_ATTR_SENDER_IPV4   0

Attribute block entry contains the sender IPV4 address.

#define LBMMON_ATTR_SOURCE   6

Attribute block entry contains the source flag. See LBMMON_ATTR_SOURCE_* for possible values. Used to distinguish between MIM source/receiver statistics and normal transport source/receiver statistics.

#define LBMMON_ATTR_SOURCE_IM   1

Source/receiver statistics are from a MIM transport session.

#define LBMMON_ATTR_SOURCE_NORMAL   0

Source/receiver statistics are from a normal transport session.

#define LBMMON_ATTR_TIMESTAMP   1

Attribute block entry contains the timestamp.

#define LBMMON_EAGAIN   (LBMMON_ERROR_BASE + 5)

lbmmon_errnum() value. Insufficient resources.

#define LBMMON_EALREADY   (LBMMON_ERROR_BASE + 6)

lbmmon_errnum() value. Resource already registered.

#define LBMMON_EINVAL   (LBMMON_ERROR_BASE + 1)

lbmmon_errnum() value. An invalid argument was passed.

#define LBMMON_ELBMFAIL   (LBMMON_ERROR_BASE + 4)

lbmmon_errnum() value. A call to an LBM function failed.

#define LBMMON_EMODFAIL   (LBMMON_ERROR_BASE + 3)

lbmmon_errnum() value. A call to a module function failed.

#define LBMMON_ENOMEM   (LBMMON_ERROR_BASE + 2)

lbmmon_errnum() value. Out of memory.

#define LBMMON_EOP   (LBMMON_ERROR_BASE + 7)

lbmmon_errnum() value. Internal operation error.

#define LBMMON_ERROR_BASE   4096

Base value for LBMMON error codes.

#define LBMMON_FORMAT_ATTRIBUTES_PB   1

Format of the attributes block for a PB packet is PB (Default)

#define LBMMON_FORMAT_ATTRIBUTES_TABLE   2

Format of the attributes block for a PB packet is table

#define LBMMON_FORMAT_CSV_MODULE_ID   1

Module ID used for lbmmon_format_csv_module()

#define LBMMON_FORMAT_DESERIALIZE_CONVERT_PASSTHROUGH   2

Format deserialize function return indicates convert to PB then passthrough to callback

#define LBMMON_FORMAT_DESERIALIZE_FAILURE   -1

Format deserialize function return FAILURE.

#define LBMMON_FORMAT_DESERIALIZE_OK   0

Format deserialize function return OK. Use normal callbacks

#define LBMMON_FORMAT_DESERIALIZE_PASSTHROUGH   1

Format deserialize function return indicates passthrough raw packet to callback

#define LBMMON_FORMAT_DESERIALIZE_TOO_SMALL   -2

Format deserialize function return indicates not enough memory was allocated for this packet

#define LBMMON_FORMAT_FILTER_EQ   2

Format option to filter out when field == value

#define LBMMON_FORMAT_FILTER_GT   5

Format option to filter out when field > value

#define LBMMON_FORMAT_FILTER_LT   4

Format option to filter out when field < value

#define LBMMON_FORMAT_FILTER_NE   3

Format option to filter out when field != value

#define LBMMON_FORMAT_FILTER_OFF   0

Format option filter is off (default); this field will be sent

#define LBMMON_FORMAT_FILTER_ON   1

Format option filter is on; field will not be sent

#define LBMMON_FORMAT_PASSTHROUGH_CONVERT   2

Format option to convert the received packet to PB format then passthrough

#define LBMMON_FORMAT_PASSTHROUGH_OFF   0

Format option to passthrough the received packet without deserializing is off (Default)

#define LBMMON_FORMAT_PASSTHROUGH_ON   1

Format option to passthrough the received packet without deserializing is on

#define LBMMON_FORMAT_PB_MODULE_ID   2

Module ID used for lbmmon_format_pb_module()

#define LBMMON_FORMAT_SELECT_EQ   6

Format option to send when field == value

#define LBMMON_FORMAT_SELECT_GT   9

Format option to send when field > value

#define LBMMON_FORMAT_SELECT_LT   8

Format option to send when field < value

#define LBMMON_FORMAT_SELECT_MATCH   10

Format option to send when string matches value

#define LBMMON_FORMAT_SELECT_MATCH_REGX   11

Format option to send when regualr expression string matches value

#define LBMMON_FORMAT_SELECT_NE   7

Format option to send when field != value

#define LBMMON_PACKET_SIGNATURE   0x1b33041b

Packet signature value

#define LBMMON_PACKET_TYPE_CONTEXT   3

Packet contains context statistics

#define LBMMON_PACKET_TYPE_CONTROL_MESSAGE   9

Packet contains LBMMON Control Message.

#define LBMMON_PACKET_TYPE_EVENT_QUEUE   2

Packet contains event queue statistics

#define LBMMON_PACKET_TYPE_GATEWAY   7

Packet contains gateway statistics.

#define LBMMON_PACKET_TYPE_RECEIVER   1

Packet contains receiver statistics

#define LBMMON_PACKET_TYPE_RECEIVER_TOPIC   4

Packet contains receiver topic statistics.

#define LBMMON_PACKET_TYPE_SOURCE   0

Packet contains source statistics

#define LBMMON_PACKET_TYPE_SRS   10

Packet contains SRS statistics.

#define LBMMON_PACKET_TYPE_UMDS   8

Packet contains UMDS statistics.

#define LBMMON_PACKET_TYPE_UMESTORE   6

Packet contains store statistics.

#define LBMMON_PACKET_TYPE_WILDCARD_RECEIVER   5

Packet contains wildcard receiver statistics.

#define LBMMON_RCTL_CONTEXT_CALLBACK   3

Receive controller attribute option: Context statistics callback.

#define LBMMON_RCTL_EVENT_QUEUE_CALLBACK   2

Receive controller attribute option: Event queue statistics callback.

#define LBMMON_RCTL_GATEWAY_CALLBACK   7

Receive controller attribute option: Gateway statistics callback.

#define LBMMON_RCTL_PASSTHROUGH_CALLBACK   8

Receive controller attribute option: Passthrough callback.

#define LBMMON_RCTL_RECEIVER_CALLBACK   0

Receive controller attribute option: Receiver statistics callback.

#define LBMMON_RCTL_RECEIVER_TOPIC_CALLBACK   4

Receive controller attribute option: Receiver topic statistics callback.

#define LBMMON_RCTL_SOURCE_CALLBACK   1

Receive controller attribute option: Source statistics callback.

#define LBMMON_RCTL_UMESTORE_CALLBACK   6

Receive controller attribute option: Store statistics callback.

#define LBMMON_RCTL_WILDCARD_RECEIVER_CALLBACK   5

Receive controller attribute option: Wildcard receiver statistics callback.

#define LBMMON_SERIALIZE_CALC_SIZE_ONLY   1

Serialize function should only return the size of the packed message

#define LBMMON_SERIALIZE_PACK_MESSAGE   0

Serialize funtion should pack the message

#define MODULE_ID (   id)    ((unsigned char) ((id & 0xff00) >> 8))

Extracts the Module ID from the ModuleID value

#define MODULE_VERSION (   id)    ((unsigned char) (id & 0xff))

Extracts the Module Version from the ModuleID value

Typedef Documentation

typedef int(* lbmmon_ctx_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_context_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)

Function to deserialize a buffer into an lbm_context_stats_t structure.

Transform a block of data serialized by the lbmmon_ctx_format_serialize_t function into a lbm_context_stats_t structure.

See also
lbmmon_ctx_format_serialize_t
Parameters
AttributesA pointer to a lbmmon_packet_attributes_t structure for storing the deserialized packet attributes.
StatisticsA pointer to an lbm_context_stats_t structure into which the data is deserialized.
SourceA pointer to a buffer containing the serialized data.
LengthThe length of the serialized data.
ModuleIDThe module ID received in the packet. It may be used to verify and differentiate between different version of the module (and thus the format of the data it expects).
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, 1 if passthrough, -1 otherwise. If 1 is returned, the packet was not deserialized and Statistics will not be populated. If -1 is returned, the deserialized data will not be delivered to the application.
typedef int(* lbmmon_ctx_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_context_stats_t *Statistics, void *FormatClientData)

Function to serialize an lbm_context_stats_t structure.

This function should transform the lbm_context_stats_t structure into a form which can be deserialized by the corresponding lbmmon_ctx_format_deserialize_t function.

See also
lbmmon_ctx_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the lbm_context_stats_t statistics.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
StatisticsA pointer to the lbm_context_stats_t structure to be serialized.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef void(* lbmmon_ctx_statistics_cb) (const void *AttributeBlock, const lbm_context_stats_t *Statistics, void *ClientData)

Client callback function to process a received context statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
StatisticsPointer to the context statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for context statistics.

A structure used with receive controller options to get/set specific callback information.

typedef int(* lbmmon_evq_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_event_queue_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)

Function to deserialize a buffer into an lbm_event_queue_stats_t structure.

Transform a block of data serialized by the lbmmon_evq_format_serialize_t function into a lbm_event_queue_stats_t structure.

See also
lbmmon_evq_format_serialize_t
Parameters
AttributesA pointer to a lbmmon_packet_attributes_t structure for storing the deserialized packet attributes.
StatisticsA pointer to an lbm_event_queue_stats_t structure into which the data is deserialized.
SourceA pointer to a buffer containing the serialized data.
LengthThe length of the serialized data.
ModuleIDThe module ID received in the packet. It may be used to verify and differentiate between different version of the module (and thus the format of the data it expects).
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, 1 if passthrough, -1 otherwise. If 1 is returned, the packet was not deserialized and Statistics will not be populated. If -1 is returned, the deserialized data will not be delivered to the application.
typedef int(* lbmmon_evq_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_event_queue_stats_t *Statistics, void *FormatClientData)

Function to serialize an lbm_event_queue_stats_t structure.

This function should transform the lbm_event_queue_stats_t structure into a form which can be deserialized by the corresponding lbmmon_evq_format_deserialize_t function.

See also
lbmmon_evq_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the lbm_event_queue_stats_t statistics.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
StatisticsA pointer to the lbm_event_queue_stats_t structure to be serialized.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef void(* lbmmon_evq_statistics_cb) (const void *AttributeBlock, const lbm_event_queue_stats_t *Statistics, void *ClientData)

Client callback function to process a received event queue statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
StatisticsPointer to the event queue statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for event queue statistics.

A structure used with receive controller options to get/set specific callback information.

typedef int(* lbmmon_format_apply_options_t) (void *FormatClientData, const void *FormatOptions)

Function to apply options to a format module at startup or dynamically to a running system.

Parameters
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
FormatOptionsA pointer to data containing options in the same format as specified by config options.
Returns
Zero if successful, -1 otherwise.
typedef const char*(* lbmmon_format_errmsg_t) (void)

Function to return the last error message from a format module.

Returns
A string containing a description of the last error encountered by the module.
typedef int(* lbmmon_format_finish_t) (void *FormatClientData)

Function to finish format module processing.

Perform any required format module cleanup processing. If format-specific client data was allocated in the lbmmon_format_init_t function, it should be freed in this function.

This function is called by lbmmon_sctl_destroy() and lbmmon_rctl_destroy().

Parameters
FormatClientDataA pointer to format-specific client data. This pointer should be freed if it was allocated previously.
Returns
Zero if successful, -1 otherwise.
typedef int(* lbmmon_format_init_t) (void **FormatClientData, const void *FormatOptions)

Function to initialize a format module.

This function should perform any initialization required by the format module. While, depending on the module, initialization may not be required, representative tasks include allocating a block of format-specific data, parsing options from the supplied options string, and initializing any operating parameters for the module.

This function is called by lbmmon_sctl_create() and lbmmon_rctl_create().

Parameters
FormatClientDataA pointer which may be filled in (by this function) with a pointer to format-specific client data. A pointer to the format-specific data is passed to each function in the module, to be used as the module sees fit.
FormatOptionsThe FormatOptions argument originally passed to lbmmon_sctl_create() or lbmmon_rctl_create().
Returns
Zero if successful, -1 otherwise. If -1 is returned, no further calls to the format module will be made, and the calling function (lbmmon_sctl_create() or lbmmon_rctl_create()) will return -1.
typedef int(* lbmmon_gateway_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, Lbmmon__DROMonMsg *GatewayMsg, void *FormatClientData)

Function to serialize gateway statistics.

This function should transform the Lbmmon__DROMonMsg structure into a form which can be deserialized by the corresponding lbmmon_gateway_format_deserialize function.

See also
lbmmon_gateway_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the Lbmmon__DROMonMsg structure.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
GatewayMsgA pointer to an Lbmmon__DROMonMsg structure to be serialized.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef int(* lbmmon_gateway_free_unpacked_t) (Lbmmon__DROMonMsg *GatewayMsg)

Function to free an unpacked Lbmmon__DROMonMsg structure.

Parameters
GatewayMsgA pointer to a pointer to an Lbmmon__DROMonMsg structure into which the data was deserialized.
Returns
Zero if successful, -1 otherwise.
typedef void(* lbmmon_gateway_statistics_cb) (const void *AttributeBlock, const Lbmmon__DROMonMsg *GatewayMsg, void *ClientData)

Client callback function to process a received gateway statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
GatewayMsgPointer to the gateway statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for gateway statistics.

A structure used with receive controller options to get/set specific callback information.

Statistics packet header layout.

A statistics packet consists of five fixed-length and fixed-position fields, as documented below. It is followed by two variable-length blocks. The attribute block is located at packet + sizeof(lbmmon_packet_hdr_t), and is mAttributeBlockLength (when properly interpreted) bytes in length (which may be zero). The statistics data block is located immediately following the attribute block.

typedef void(* lbmmon_passthrough_statistics_cb) (const lbmmon_packet_hdr_t *PacketHeader, lbmmon_packet_attributes_t *Attributes, void *AttributeBlock, void *Statistics, size_t Length, void *ClientData)

Client callback function to process a statistics packet when using the passthrough format option.

Parameters
PacketHeaderPointer to the packet header.
AttributesPointer to structure containing values from attributes block.
AttributeBlockPointer to the raw packet attributes block.
StatisticsPointer to the raw statistics packet.
LengthThe length of the raw statistics packet.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for the passthrough format option.

A structure used with receive controller options to get/set specific callback information.

typedef int(* lbmmon_rcv_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_rcv_transport_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)

Function to deserialize a buffer into an lbm_rcv_transport_stats_t structure.

Transform a block of data serialized by the lbmmon_rcv_format_serialize_t function into a lbm_rcv_transport_stats_t structure.

See also
lbmmon_rcv_format_serialize_t
lbmmon_src_format_serialize_t
lbmmon_src_format_deserialize_t
Parameters
AttributesA pointer to a lbmmon_packet_attributes_t structure for storing the deserialized packet attributes.
StatisticsA pointer to an lbm_rcv_transport_stats_t structure into which the data is deserialized.
SourceA pointer to a buffer containing the serialized data.
LengthThe length of the serialized data.
ModuleIDThe module ID received in the packet. It may be used to verify and differentiate between different version of the module (and thus the format of the data it expects).
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, 1 if passthrough, -1 otherwise. If 1 is returned, the packet was not deserialized and Statistics will not be populated. If -1 is returned, the deserialized data will not be delivered to the application.
typedef int(* lbmmon_rcv_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_rcv_transport_stats_t *Statistics, void *FormatClientData)

Function to serialize an lbm_rcv_transport_stats_t structure.

This function should transform the lbm_rcv_transport_stat_t structure into a form which can be deserialized by the corresponding lbmmon_rcv_format_deserialize_t function.

See also
lbmmon_src_format_serialize_t
lbmmon_rcv_format_deserialize_t
lbmmon_src_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the lbm_rcv_transport_stats_t statistics.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
StatisticsA pointer to the lbm_rcv_transport_stats_t structure to be serialized.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef void(* lbmmon_rcv_statistics_cb) (const void *AttributeBlock, const lbm_rcv_transport_stats_t *Statistics, void *ClientData)

Client callback function to process a received receiver statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
StatisticsPointer to the receiver statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for receiver statistics.

A structure used with receive controller options to get/set specific callback information.

typedef int(* lbmmon_rcv_topic_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, size_t *Count, lbm_rcv_topic_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)

Function to deserialize a buffer into an lbm_rcv_topic_stats_t structure.

Transform a block of data serialized by the lbmmon_rcv_topic_format_serialize_t function into a lbm_rcv_topic_stats_t structure.

See also
lbmmon_rcv_topic_format_serialize_t
Parameters
AttributesA pointer to a lbmmon_packet_attributes_t structure for storing the deserialized packet attributes.
CountA pointer to an integer containing the number of elements in the Statistics array. On exit, it will contain the actual number of elements parsed.
StatisticsAn array of lbm_rcv_topic_stats_t elements into which is written the actual deserialized data.
SourceA pointer to a buffer containing the serialized data.
LengthThe length of the serialized data.
ModuleIDThe module ID received in the packet. It may be used to verify and differentiate between different version of the module (and thus the format of the data it expects).
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, 1 if passthrough, -2 if Count is not large enough for all elements, -1 otherwise. If 1 is returned, the packet was not deserialized and Count and Statistics will not be populated. If -2 is returned, Count will contain the number of elements required. If -1 is returned, the deserialized data will not be delivered to the application.
typedef int(* lbmmon_rcv_topic_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const char *Topic, lbm_ulong_t SourceCount, const lbm_rcv_topic_stats_t *Sources, void *FormatClientData)

Function to serialize receiver topic statistics.

This function should transform the topic, source count, and array of sources into a form which can be deserialized by the corresponding lbmmon_rcv_topic_format_deserialize_t function.

See also
lbmmon_rcv_topic_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the lbm_context_stats_t statistics.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
TopicA NUL-terminated string containing the topic.
SourceCountThe number of sources in the Sources array.
SourcesAn array of lbm_rcv_topic_stats_t structures containing the sources to which the receiver is joined.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef void(* lbmmon_rcv_topic_statistics_cb) (const void *AttributeBlock, const lbm_rcv_topic_stats_t *Statistics, void *ClientData)

For internal use only. Client callback function to process a received receiver topic statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
StatisticsPointer to the receiver topic statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

For internal use only. A structure that holds the callback information for receiver topic statistics.

A structure used with receive controller options to get/set specific callback information.

typedef int(* lbmmon_src_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_src_transport_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)

Function to deserialize a buffer into an lbm_src_transport_stats_t structure.

See also
lbmmon_rcv_format_serialize_t
lbmmon_src_format_serialize_t
lbmmon_rcv_format_deserialize_t
Parameters
AttributesA pointer to a lbmmon_packet_attributes_t structure for storing the deserialized packet attributes.
StatisticsA pointer to an lbm_src_transport_stats_t structure into which the data is deserialized.
SourceA pointer to a buffer containing the serialized data.
LengthThe length of the serialized data.
ModuleIDThe module ID received in the packet. It may be used to verify and differentiate between different version of the module (and thus the format of the data it expects).
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, 1 if passthrough, -1 otherwise. If 1 is returned, the packet was not deserialized and Statistics will not be populated. If -1 is returned, the deserialized data will not be delivered to the application.
typedef int(* lbmmon_src_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_src_transport_stats_t *Statistics, void *FormatClientData)

Function to serialize an lbm_src_transport_stats_t structure.

See also
lbmmon_rcv_format_serialize_t
lbmmon_rcv_format_deserialize_t
lbmmon_src_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the lbm_src_transport_stats_t statistics.
SizeA pointer to a size_t. On entry, it contains the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
StatisticsA pointer to an lbm_src_transport_stats_t structure to be serialized.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef void(* lbmmon_src_statistics_cb) (const void *AttributeBlock, const lbm_src_transport_stats_t *Statistics, void *ClientData)

Client callback function to process a received source statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
StatisticsPointer to the source statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for source statistics.

A structure used with receive controller options to get/set specific callback information.

typedef const int(* lbmmon_transport_allow_debug_t) (void *TransportClientData)

Function to return the allow debug indicator from a transport module.

Returns
Zero if debug is disabled, 1 if debug is enabled.
typedef int(* lbmmon_transport_ctrlmsg_receive_t) (char *Data, size_t *Length, void *TransportClientData)

Receive control message requests.

Parameters
DataPointer to a buffer into which the received (serialized) data is to be placed.
LengthPointer to a size_t variable. On entry, it contains the maximum number of bytes to read. On exit, it must contain the actual number of bytes read.
TransportClientDataA pointer to transport-specific client data as returned by the lbmmon_transport_initrcv_t function.
Returns
Zero if successful, >0 if timeout exceeded, -1 otherwise.
typedef int(* lbmmon_transport_ctrlmsg_response_t) (const char *Data, size_t Length, void *TransportClientData)

Function to send response to control message requests.

Parameters
DataPointer to the serialized statistics data.
LengthLength of the serialized statistics data.
TransportClientDataA pointer to transport-specific client data.
Returns
Zero if successful, -1 otherwise.
typedef const char*(* lbmmon_transport_ctrlmsgtarget_t) (void)

Function to return the target address for control message requests.

Returns
A string containing the IP address and port of the request port if opened or NULL if none.
typedef const char*(* lbmmon_transport_errmsg_t) (void)

Function to return the last error message from a transport module.

Returns
A string containing a description of the last error encountered by the module.
typedef int(* lbmmon_transport_finishrcv_t) (void *TransportClientData)

Finish processing for a receiver transport.

Parameters
TransportClientDataA pointer to transport-specific client data as returned by the lbmmon_transport_initrcv_t function. If previously allocated by the lbmmon_transport_initrcv_t function, it must be freed in this function.
Returns
Zero if successful, -1 otherwise.
typedef int(* lbmmon_transport_finishsrc_t) (void *TransportClientData)

Finish processing for a source transport.

Parameters
TransportClientDataA pointer to transport-specific client data as returned by the lbmmon_transport_initsrc_t function. If previously allocated by the lbmmon_transport_initsrc_t function, it must be freed in this function.
Returns
Zero if successful, -1 otherwise.
typedef int(* lbmmon_transport_initrcv_t) (void **TransportClientData, const void *TransportOptions)

Function to initialize a transport module to serve as a receiver of statistics.

Parameters
TransportClientDataA pointer which may be filled in (by this function) with a pointer to transport-specific client data.
TransportOptionsThe TransportOptions argument originally passed to lbmmon_rctl_create().
Returns
Zero if successful, -1 otherwise.
typedef int(* lbmmon_transport_initsrc_t) (void **TransportClientData, const void *TransportOptions)

Function to initialize a transport module to serve as a source of statistics.

Parameters
TransportClientDataA pointer which may be filled in (by this function) with a pointer to transport-specific client data.
TransportOptionsThe TransportOptions argument originally passed to lbmmon_sctl_create().
Returns
Zero if successful, -1 otherwise.
typedef int(* lbmmon_transport_receive_t) (char *Data, size_t *Length, unsigned int TimeoutMS, void *TransportClientData)

Receive statistics data.

Parameters
DataPointer to a buffer into which the received (serialized) data is to be placed.
LengthPointer to a size_t variable. On entry, it contains the maximum number of bytes to read. On exit, it must contain the actual number of bytes read.
TimeoutMSMaximum time, in milliseconds, the function may wait for incoming data before returning a timeout indicator.
TransportClientDataA pointer to transport-specific client data as returned by the lbmmon_transport_initrcv_t function.
Returns
Zero if successful, >0 if timeout exceeded, -1 otherwise.
typedef int(* lbmmon_transport_send_t) (const char *Data, size_t Length, void *TransportClientData)

Send a statistics packet.

Parameters
DataPointer to the serialized statistics data.
LengthLength of the serialized statistics data.
TransportClientDataA pointer to transport-specific client data as returned by the lbmmon_transport_initsrc_t function.
Returns
Zero if successful, -1 otherwise.
typedef char*(* lbmmon_umestore_filter_options_t) (const char *FormatOptions)

Function to return the store filter options from a format module.

Parameters
FormatOptionsThe FormatOptions associated with the store's context.
Returns
A string containing the store filter options.
typedef int(* lbmmon_umestore_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, Lbmmon__UMPMonMsg *StoreMsg, int Action, void *FormatClientData)

Function to serialize store statistics.

This function should transform the Lbmmon__UMPMonMsg structure into a form which can be deserialized by the corresponding lbmmon_umestore_format_deserialize function.

See also
lbmmon_umestore_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the Lbmmon__UMPMonMsg structure.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
StoreMsgA pointer to an Lbmmon__UMPMonMsg structure to be serialized.
ActionIf 1, return size of packed message only. If 0, pack the message and copy into the buffer.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef int(* lbmmon_umestore_free_unpacked_t) (Lbmmon__UMPMonMsg *StoreMsg)

Function to free an unpacked Lbmmon__UMPMonMsg structure.

Parameters
StoreMsgA pointer to a pointer to an Lbmmon__UMPMonMsg structure into which the data was deserialized.
Returns
Zero if successful, -1 otherwise.
typedef void(* lbmmon_umestore_statistics_cb) (const void *AttributeBlock, const Lbmmon__UMPMonMsg *StoreMsg, void *ClientData)

Client callback function to process a received store statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
StoreMsgPointer to the store statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for store statistics.

A structure used with receive controller options to get/set specific callback information.

typedef int(* lbmmon_wildcard_rcv_format_deserialize_t) (lbmmon_packet_attributes_t *Attributes, lbm_wildcard_rcv_stats_t *Statistics, const char *Source, size_t Length, unsigned short ModuleID, void *FormatClientData)

Function to deserialize a buffer into an lbm_wildcard_rcv_stats_t structure.

Transform a block of data serialized by the lbmmon_wildcard_rcv_format_serialize_t function into a lbm_wildcard_rcv_stats_t structure.

See also
lbmmon_wildcard_rcv_format_serialize_t
Parameters
AttributesA pointer to a lbmmon_packet_attributes_t structure for storing the deserialized packet attributes.
StatisticsA pointer to an lbm_wildcard_rcv_stats_t structure into which the data is deserialized.
SourceA pointer to a buffer containing the serialized data.
LengthThe length of the serialized data.
ModuleIDThe module ID received in the packet. It may be used to verify and differentiate between different version of the module (and thus the format of the data it expects).
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, 1 if passthrough, -1 otherwise. If 1 is returned, the packet was not deserialized and Statistics will not be populated. If -1 is returned, the deserialized data will not be delivered to the application.
typedef int(* lbmmon_wildcard_rcv_format_serialize_t) (char *Destination, size_t *Size, unsigned short *ModuleID, const lbmmon_packet_attributes_t *Attributes, const lbm_wildcard_rcv_stats_t *Statistics, void *FormatClientData)

Function to serialize wildcard receiver statistics.

This function should transform the lbm_wildcard_receiver_stats_t structure into a form which can be deserialized by the corresponding lbmmon_wildcard_rcv_format_deserialize function.

See also
lbmmon_wildcard_rcv_format_deserialize_t
Parameters
DestinationA pointer to a buffer to receive the serialized format of the lbm_wildcard_rcv_stats_t statistics.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized statistics. On exit, it must contain the actual size of the serialized statistics.
ModuleIDA pointer to an unsigned short, into which the module may write a module identification value. This value is included in the transmitted packet, and may be used by the receiver to verify and differentiate between different version of the module (and thus the format of the data it expects).
AttributesA pointer to a lbmmon_packet_attributes_t structure from which to take packet attributes.
StatisticsA pointer to an lbm_wildcard_rcv_stats_t structure to be serialized.
FormatClientDataA pointer to format-specific client data as returned by the lbmmon_format_init_t function.
Returns
Zero if successful, -1 otherwise. If -1 is returned, the serialized data will not be sent.
typedef void(* lbmmon_wildcard_rcv_statistics_cb) (const void *AttributeBlock, const lbm_wildcard_rcv_stats_t *Statistics, void *ClientData)

For internal use only. Client callback function to process a received wildcard receiver statistics packet.

Parameters
AttributeBlockPointer to the statistics packet attribute block.
StatisticsPointer to the wildcard receiver statistics.
ClientDataPointer to client-specific data as passed to lbmmon_rctl_create().

A structure that holds the callback information for wildcard receiver statistics.

A structure used with receive controller options to get/set specific callback information.

Function Documentation

LBMExpDLL void lbmmon_add_header ( char *  Packet,
const char *  Data,
size_t  Length,
int  PacketType 
)

Add an LBMMON header to a serialized PB Buffer.

Parameters
PacketA pointer to a buffer to receive the full packet.
DataA pointer to the serialized statistics data.
LengthThe length of the serialized statistics data.
PacketTypeType of statistics. See LBMMON_PACKET_TYPE_*.
LBMExpDLL int lbmmon_attr_get_appsourceid ( const void *  AttributeBlock,
char *  ApplicationSourceID,
size_t  Length 
)

Retrieve the application source ID attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
ApplicationSourceIDPointer to a buffer to receive the application source ID as a null-terminated string.
LengthMaximum length of ApplicationSourceID
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attr_get_contextid ( const void *  AttributeBlock,
lbm_ulong_t ContextID 
)

Retrieve the context ID attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
ContextIDPointer to a variable to receive the context ID.
Returns
0 if successful, -1 if the attribute does not exist.
Deprecated:
Use lbmmon_attr_get_objectid instead.
LBMExpDLL int lbmmon_attr_get_ctxinst ( const void *  AttributeBlock,
lbm_uint8_t ContextInstance,
size_t  Length 
)

For internal use only. Retrieve the context instance attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
ContextInstancePointer to a buffer to receive the context instance.
LengthMaximum length of ContextInstance.
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attr_get_domainid ( const void *  AttributeBlock,
lbm_uint32_t DomainID 
)

For internal use only. Retrieve the domain ID attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
DomainIDPointer to a variable to receive the domain ID.
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attr_get_ipv4sender ( const void *  AttributeBlock,
lbm_uint_t Address 
)

Retrieve the IPV4 sender address attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
AddressPointer to a 32-bit integer to receive the IPV4 address in network order.
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attr_get_objectid ( const void *  AttributeBlock,
lbm_ulong_t ObjectID 
)

Retrieve the object ID attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
ObjectIDPointer to a variable to receive the object ID.
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attr_get_processid ( const void *  AttributeBlock,
lbm_ulong_t ProcessID 
)

Retrieve the process ID attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
ProcessIDPointer to a variable to receive the process ID.
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attr_get_source ( const void *  AttributeBlock,
lbm_ulong_t Source 
)

Retrieve the source attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
SourcePointer to a variable to receive the source flag.
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attr_get_timestamp ( const void *  AttributeBlock,
time_t *  Timestamp 
)

Retrieve the timestamp attribute from the statistics attribute block.

Parameters
AttributeBlockPointer to the attribute block as passed to the callback function.
TimestampPointer to a time_t to receive the timestamp.
Returns
0 if successful, -1 if the attribute does not exist.
LBMExpDLL int lbmmon_attributes_deserialize ( lbmmon_packet_attributes_t Attributes,
char *  Source,
size_t  Length 
)

Deserialize the Attributes Block into the lbmmon_packet_attributes_t structure.

Parameters
AttributesA pointer to a lbmmon_packet_attributes_t structure for storing the deserialized packet attributes.
SourceA pointer to a buffer containing the Attributes Block from the incoming message from an LBM receiver (not from LBMMON RCTL).
LengthThe length of the Attributes Block.
LBMExpDLL int lbmmon_context_monitor ( lbmmon_sctl_t Control,
lbm_context_t Context,
const char *  ApplicationSourceID,
unsigned int  Seconds 
)

Register a context for monitoring.

When a context is monitored, statistics are gathered for all transports on that context, broken out by transport. Monitoring may be done at regular intervals, specified by the Seconds parameter. As an alternative, passing zero for Seconds will not automatically monitor the context, but instead require an explicit call to lbmmon_sctl_sample().

If monitoring is to be used as a form of heartbeat, the preferred method is to call lbmmon_sctl_sample() from a context thread or event queue timer callback. This ensures that the object actually processing the messages is the one generating the monitoring statistics, guaranteeing that it is truly acting as a heartbeat mechanism.

Parameters
ControlPointer to an lbmmon_sctl_t which is to be used to monitor the context.
ContextPointer to an lbm_context_t which will be monitored.
ApplicationSourceIDNull-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
SecondsInterval (in seconds) at which monitoring information will be gathered and sent. If zero, the context will not be automatically monitored, but instead will be monitored upon a call to lbmmon_ctl_sample().
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_context_unmonitor ( lbmmon_sctl_t Control,
lbm_context_t Context 
)

Terminate monitoring for a context.

Unregister a context to prevent further monitoring of that context.

Parameters
ControlPointer to an lbmmon_sctl_t which is used to monitor the context.
ContextPointer to an previously registered lbm_context_t.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_control_dump_default_filter_options ( void  )

Dump the default filter options to stdout.

Returns
Zero if successful, -1 otherwise.
LBMExpDLL const char* lbmmon_control_errmsg ( void  )

Function to return the last error message from lbmmon_control.

Returns
A string containing a description of the last error encountered by the module.
LBMExpDLL int lbmmon_control_index_for_command ( char *  Command)

Retrieve the index associated with the given LBMMON control command.

Parameters
CommandThe command to convert to an index.
Returns
The command index or -1 if command was invalid.
LBMExpDLL int lbmmon_control_index_for_node_type ( char *  NodeType)

Retrieve the index associated with the given LBMMON control node type.

Parameters
NodeTypeThe node type to convert to an index.
Returns
The node type index or -1 if node type was invalid.
LBMExpDLL int lbmmon_control_load_data_from_filename ( char *  Filename,
char **  Data 
)

Load data from filename into a buffer.

Parameters
FilenameString with filename to be read.
DataA pointer to a buffer (if successful) with the contents of the file. Will be malloc'd by this function and must be free'd by caller.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_control_serialize ( char *  Destination,
size_t *  Size,
int  Command,
char *  Data,
int  NodeType,
char *  ApplicationSourceID 
)

Function to serialize a control message.

Parameters
DestinationA pointer to a buffer to receive the serialized format of the control message.
SizeA pointer to a size_t. On entry, it will contain the maximum allowed size of the serialized packet. On exit, it must contain the actual size of the serialized packet.
CommandThe result from lbmmon_index_for_command.
DataA pointer to any data required for a command.
NodeTypeThe result from lbmmon_control_index_for_command.
ApplicationSourceIDNull-terminated string containing an application-specified source identifier.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL const char* lbmmon_control_valid_commands ( void  )

Retrieve the list of valid LBMMON control commands.

Returns
String containing the list of commands.
LBMExpDLL const char* lbmmon_control_valid_node_types ( void  )

Retrieve the list of valid LBMMON control node types.

Returns
String containing the list of node types.
LBMExpDLL const char* lbmmon_errmsg ( void  )

Retrieve the error message for the last error encountered.

Returns
A pointer to a static character array containing the last error message.
LBMExpDLL int lbmmon_errnum ( void  )

Retrieve the error number for the last error encountered.

Returns
The last error encountered. See LBMMON_ERR_*.
LBMExpDLL int lbmmon_evq_monitor ( lbmmon_sctl_t Control,
lbm_event_queue_t EventQueue,
const char *  ApplicationSourceID,
unsigned int  Seconds 
)

Register an event queue for monitoring.

Monitoring may be done at regular intervals, specified by the Seconds parameter. As an alternative, passing zero for Seconds will not automatically monitor the receiver, but instead require an explicit call to lbmmon_ctl_sample().

If monitoring is to be used as a form of heartbeat, the preferred method is to call lbmmon_ctl_sample() from a context thread or event queue timer callback. This ensures that the object actually processing the messages is the one generating the monitoring statistics, guaranteeing that it is truly acting as a heartbeat mechanism.

Parameters
ControlPointer to an lbmmon_sctl_t which is to be used to monitor the context.
EventQueuePointer to an lbm_event_queue_t which will be monitored.
ApplicationSourceIDNull-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
SecondsInterval (in seconds) at which monitoring information will be gathered and sent. If zero, the receiver will not be automatically monitored, but instead will be monitored upon a call to lbmmon_sctl_sample().
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_evq_unmonitor ( lbmmon_sctl_t Control,
lbm_event_queue_t EventQueue 
)

Terminate monitoring for an event queue.

Unregister an event queue to prevent further monitoring of that receiver.

Parameters
ControlPointer to an lbmmon_sctl_t which is used to monitor the context.
EventQueuePointer to an previously registered lbm_event_queue_t.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL const char* lbmmon_next_key_value_pair ( const char *  String,
char *  Key,
size_t  KeySize,
char *  Value,
size_t  ValueSize 
)

Retrieve the next key/value pair from a semicolon-separated list.

This is a convenience utility function to facilitate processing of a semicolon-separated list of key/value pairs. Each pair is of the form "key=value".

Parameters
StringA pointer to the unprocessed part of the semicolon-separated list.
KeyPointer to a character string into which is written the null-terminated key.
KeySizeMaximum length of Key.
ValuePointer to a character string into which is written the null-terminated value.
ValueSizeMaximum length of Value.
Returns
NULL if no key/value pair is found. Otherwise a pointer to the remainder of the string, to be passed to subsequent calls to lbmmon_next_key_value_pair().
LBMExpDLL int lbmmon_rctl_attr_create ( lbmmon_rctl_attr_t **  Attributes)

Create an LBM Monitoring Receive Controller attribute object.

The attribute object is created and initialized.

Parameters
AttributesA pointer to a pointer to an LBMMON receive controller attribute structure. Will be filled in by the function to point to the newly created lbmmon_rctl_attr_t object.
Returns
0 if successful, -1 otherwise.
LBMExpDLL int lbmmon_rctl_attr_delete ( lbmmon_rctl_attr_t Attributes)

Delete an LBM Monitoring Receive Controller attribute object.

The attribute object is cleaned up and deleted.

Parameters
AttributesA pointer to an LBMMON receive controller attribute structure as created by lbmmon_rctl_attr_create.
Returns
0 if successful, -1 otherwise.
LBMExpDLL int lbmmon_rctl_attr_getopt ( lbmmon_rctl_attr_t Attributes,
int  Option,
void *  Value,
size_t *  Length 
)

Get an LBMMON receive controller attribute option value.

Parameters
AttributesThe attributes object to get the option value for.
OptionThe option to get. See LBMMON_RCTL_ATTR_*.
ValuePointer to the option value structure to be filled.
LengthLength (in bytes) of the Value structure when passed in. Upon return, this is set to the actual size of the Value structure filled in.
Returns
0 if successful, -1 otherwise.
LBMExpDLL int lbmmon_rctl_attr_setopt ( lbmmon_rctl_attr_t Attributes,
int  Option,
void *  Value,
size_t  Length 
)

Set an LBMMON receive controller attribute option value.

Parameters
AttributesThe attributes object to set the option value for.
OptionThe option to set. See LBMMON_RCTL_ATTR_*.
ValueThe value to set for the option.
LengthThe size (in bytes) of Value.
Returns
0 if successful, -1 otherwise.
LBMExpDLL int lbmmon_rctl_create ( lbmmon_rctl_t **  Control,
const lbmmon_format_func_t Format,
const void *  FormatOptions,
const lbmmon_transport_func_t Transport,
const void *  TransportOptions,
lbmmon_rctl_attr_t Attributes,
void *  ClientData 
)

Create an LBM Monitoring Receive Controller.

This creates an instance of an LBM Monitoring Receive Controller.

Parameters
ControlA pointer to a pointer to an LBM Monitoring Receive Control object. Will be filled in by this function to point to the newly created lbmmon_rctl_t object.
FormatA pointer to an lbmmon_format_func_t object which has been filled in with the appropriate function pointers.
FormatOptionsA block of data which is passed to the format module's initialization function. This may be used to pass configuration options to the format module.
TransportA pointer to an lbmmon_transport_func_t object which has been filled in with the appropriate function pointers.
TransportOptionsA block of data which is passed to the transport module's initialization function. This may be used to pass configuration options to the transport module.
AttributesA pointer to an lbmmon_rctl_attr_t object which has been filled in with the appropriate options.
ClientDataA pointer to a block of memory which can be used for client-specific data. It is passed to all callback functions.
Returns
0 if successful, -1 otherwise.
LBMExpDLL int lbmmon_rctl_destroy ( lbmmon_rctl_t Control)

Destroy a statistics receive controller.

Destroys a monitoring controller.

Parameters
ControlPointer to an lbmmon_rctl_t to be destroyed.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_rcv_monitor ( lbmmon_sctl_t Control,
lbm_rcv_t Receiver,
const char *  ApplicationSourceID,
unsigned int  Seconds 
)

Register a receiver for monitoring.

Monitoring may be done at regular intervals, specified by the Seconds parameter. As an alternative, passing zero for Seconds will not automatically monitor the receiver, but instead require an explicit call to lbmmon_ctl_sample().

If monitoring is to be used as a form of heartbeat, the preferred method is to call lbmmon_ctl_sample() from a context thread or event queue timer callback. This ensures that the object actually processing the messages is the one generating the monitoring statistics, guaranteeing that it is truly acting as a heartbeat mechanism.

Parameters
ControlPointer to an lbmmon_sctl_t which is to be used to monitor the context.
ReceiverPointer to an lbm_rcv_t which will be monitored.
ApplicationSourceIDNull-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
SecondsInterval (in seconds) at which monitoring information will be gathered and sent. If zero, the receiver will not be automatically monitored, but instead will be monitored upon a call to lbmmon_sctl_sample().
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_rcv_unmonitor ( lbmmon_sctl_t Control,
lbm_rcv_t Receiver 
)

Terminate monitoring for a receiver.

Unregister a receiver to prevent further monitoring of that receiver.

Parameters
ControlPointer to an lbmmon_sctl_t which is used to monitor the context.
ReceiverPointer to an previously registered lbm_rcv_t.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_sctl_create ( lbmmon_sctl_t **  Control,
const lbmmon_format_func_t Format,
const void *  FormatOptions,
const lbmmon_transport_func_t Transport,
const void *  TransportOptions 
)

Create an LBM Monitoring Source Controller.

This creates an instance of an LBM Monitoring Source Controller.

Parameters
ControlA pointer to a pointer to an LBM Monitoring Source Control object. It will be filled in by this function to point to the newly created lbmmon_sctl_t object.
FormatA pointer to an lbmmon_format_func_t object which has been filled in with the appropriate function pointers.
FormatOptionsA block of data which is passed to the format module's initialization function. This may be used to pass configuration options to the format module.
TransportA pointer to an lbmmon_transport_func_t object which has been filled in with the appropriate function pointers.
TransportOptionsA block of data which is passed to the transport module's initialization function. This may be used to pass configuration options to the transport module.
Returns
0 if successful, -1 otherwise.
LBMExpDLL int lbmmon_sctl_destroy ( lbmmon_sctl_t Control)

Destroy a source monitoring controller.

Destroys a monitoring controller. Any contexts, sources, or receivers currently registered to the controller will be automatically unregistered.

Parameters
ControlPointer to an lbmmon_sctl_t to be destroyed.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_sctl_sample ( lbmmon_sctl_t Control)

Gather statistics for on-demand objects.

Parameters
ControlPointer to an existing lbmmon_sctl_t controller.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_sctl_sample_ex ( lbmmon_sctl_t Control,
const char *  ApplicationSourceID 
)

Extended gather statistics for on-demand objects.

Parameters
ControlPointer to an existing lbmmon_sctl_t controller.
ApplicationSourceIDNull-terminated string containing an application-specified source identifier. This overrides any application source ID passed to any of the lbmmon_*_monitor() functions for this call only. If a NULL pointer or an empty string is passed, the original application source ID will be used.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_src_monitor ( lbmmon_sctl_t Control,
lbm_src_t Source,
const char *  ApplicationSourceID,
unsigned int  Seconds 
)

Register a source for monitoring.

Monitoring may be done at regular intervals, specified by the Seconds parameter. As an alternative, passing zero for Seconds will not automatically monitor the source, but instead require an explicit call to lbmmon_sctl_sample().

If monitoring is to be used as a form of heartbeat, the preferred method is to call lbmmon_ctl_sample() from a context thread or event queue timer callback. This ensures that the object actually processing the messages is the one generating the monitoring statistics, guaranteeing that it is truly acting as a heartbeat mechanism.

Parameters
ControlPointer to an lbmmon_sctl_t which is to be used to monitor the context.
SourcePointer to an lbm_src_t which will be monitored.
ApplicationSourceIDNull-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
SecondsInterval (in seconds) at which monitoring information will be gathered and sent. If zero, the source will not be automatically monitored, but instead will be monitored upon a call to lbmmon_sctl_sample().
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_src_unmonitor ( lbmmon_sctl_t Control,
lbm_src_t Source 
)

Terminate monitoring for a source.

Unregister a source to prevent further monitoring of that source.

Parameters
ControlPointer to an lbmmon_sctl_t which is used to monitor the context.
SourcePointer to an previously registered lbm_src_t.
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_ssrc_monitor ( lbmmon_sctl_t Control,
lbm_ssrc_t SmartSource,
const char *  ApplicationSourceID,
unsigned int  Seconds 
)

Register a smart source for monitoring.

Monitoring may be done at regular intervals, specified by the Seconds parameter. As an alternative, passing zero for Seconds will not automatically monitor the smart source, but instead require an explicit call to lbmmon_sctl_sample().

If monitoring is to be used as a form of heartbeat, the preferred method is to call lbmmon_ctl_sample() from a context thread or event queue timer callback. This ensures that the object actually processing the messages is the one generating the monitoring statistics, guaranteeing that it is truly acting as a heartbeat mechanism.

Parameters
ControlPointer to an lbmmon_sctl_t which is to be used to monitor the context.
SmartSourcePointer to an lbm_ssrc_t which will be monitored.
ApplicationSourceIDNull-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
SecondsInterval (in seconds) at which monitoring information will be gathered and sent. If zero, the smart source will not be automatically monitored, but instead will be monitored upon a call to lbmmon_sctl_sample().
Returns
Zero if successful, -1 otherwise.
LBMExpDLL int lbmmon_ssrc_unmonitor ( lbmmon_sctl_t Control,
lbm_ssrc_t SmartSource 
)

Terminate monitoring for a smart source.

Unregister a smart source to prevent further monitoring of that source.

Parameters
ControlPointer to an lbmmon_sctl_t which is used to monitor the context.
SmartSourcePointer to an previously registered lbm_ssrc_t.
Returns
Zero if successful, -1 otherwise.