lbmmon.h File Reference

Ultra Messaging (UM) Monitoring API. More...

#include <stdlib.h>
#include <lbm/lbm.h>
#include <lbm/lbmmonfmtcsv.h>
#include <lbm/lbmmontrlbm.h>
#include <lbm/lbmmontrudp.h>
#include <lbm/lbmmontrlbmsnmp.h>

Include dependency graph for lbmmon.h:

Go to the source code of this file.

Data Structures

struct  lbmmon_packet_hdr_t_stct
 Statistics packet header layout. More...
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_transport_func_t_stct
 Transport module function pointer container. More...

Defines

#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_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_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_SOURCE_NORMAL   0
#define LBMMON_ATTR_SOURCE_IM   1
#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

Typedefs

typedef lbmmon_packet_hdr_t_stct lbmmon_packet_hdr_t
 Statistics packet header layout.
typedef 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 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.
typedef int(*) lbmmon_rcv_format_serialize_t (char *Destination, size_t *Size, unsigned short *ModuleID, const lbm_rcv_transport_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_rcv_transport_stats_t structure.
typedef int(*) lbmmon_src_format_serialize_t (char *Destination, size_t *Size, unsigned short *ModuleID, const lbm_src_transport_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_src_transport_stats_t structure.
typedef int(*) lbmmon_evq_format_serialize_t (char *Destination, size_t *Size, unsigned short *ModuleID, const lbm_event_queue_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_event_queue_stats_t structure.
typedef int(*) lbmmon_ctx_format_serialize_t (char *Destination, size_t *Size, unsigned short *ModuleID, const lbm_context_stats_t *Statistics, void *FormatClientData)
 Function to serialize an lbm_context_stats_t structure.
typedef int(*) lbmmon_rcv_format_deserialize_t (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.
typedef int(*) lbmmon_src_format_deserialize_t (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.
typedef int(*) lbmmon_evq_format_deserialize_t (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.
typedef int(*) lbmmon_ctx_format_deserialize_t (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.
typedef int(*) lbmmon_format_finish_t (void *FormatClientData)
 Function to finish format module processing.
typedef const char *(*) lbmmon_format_errmsg_t (void)
 Function to return the last error message from a format module.
typedef 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.
typedef lbmmon_rcv_statistics_func_t_stct lbmmon_rcv_statistics_func_t
 A structure that holds the callback information for receiver statistics.
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.
typedef lbmmon_src_statistics_func_t_stct lbmmon_src_statistics_func_t
 A structure that holds the callback information for source statistics.
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.
typedef lbmmon_evq_statistics_func_t_stct lbmmon_evq_statistics_func_t
 A structure that holds the callback information for event queue statistics.
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.
typedef lbmmon_ctx_statistics_func_t_stct lbmmon_ctx_statistics_func_t
 A structure that holds the callback information for context statistics.
typedef int(*) lbmmon_transport_initsrc_t (void **TransportClientData, const void *TransportOptions)
 Function to initialize a transport module to serve as a source of statistics.
typedef int(*) lbmmon_transport_initrcv_t (void **TransportClientData, const void *TransportOptions)
 Function to initialize a transport module to serve as a receiver of statistics.
typedef int(*) lbmmon_transport_send_t (const char *Data, size_t Length, void *TransportClientData)
 Send a statistics packet.
typedef int(*) lbmmon_transport_receive_t (char *Data, size_t *Length, unsigned int TimeoutMS, void *TransportClientData)
 Receive statistics data.
typedef int(*) lbmmon_transport_finishsrc_t (void *TransportClientData)
 Finish processing for a source transport.
typedef int(*) lbmmon_transport_finishrcv_t (void *TransportClientData)
 Finish processing for a receiver transport.
typedef const char *(*) lbmmon_transport_errmsg_t (void)
 Function to return the last error message from a transport module.
typedef lbmmon_transport_func_t_stct lbmmon_transport_func_t
 Transport module function pointer container.
typedef lbmmon_sctl_t_stct lbmmon_sctl_t
typedef lbmmon_rctl_attr_t_stct lbmmon_rctl_attr_t
typedef lbmmon_rctl_t_stct lbmmon_rctl_t

Functions

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.
LBMExpDLL int lbmmon_rctl_attr_create (lbmmon_rctl_attr_t **Attributes)
 Create an LBM Monitoring Receive Controller attribute object.
LBMExpDLL int lbmmon_rctl_attr_delete (lbmmon_rctl_attr_t *Attributes)
 Delete an LBM Monitoring Receive Controller attribute object.
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.
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.
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.
LBMExpDLL int lbmmon_context_monitor (lbmmon_sctl_t *Control, lbm_context_t *Context, const char *ApplicationSourceID, unsigned int Seconds)
 Register a context for monitoring.
LBMExpDLL int lbmmon_context_unmonitor (lbmmon_sctl_t *Control, lbm_context_t *Context)
 Terminate monitoring for a context.
LBMExpDLL int lbmmon_src_monitor (lbmmon_sctl_t *Control, lbm_src_t *Source, const char *ApplicationSourceID, unsigned int Seconds)
 Register a source for monitoring.
LBMExpDLL int lbmmon_src_unmonitor (lbmmon_sctl_t *Control, lbm_src_t *Source)
 Terminate monitoring for a source.
LBMExpDLL int lbmmon_rcv_monitor (lbmmon_sctl_t *Control, lbm_rcv_t *Receiver, const char *ApplicationSourceID, unsigned int Seconds)
 Register a receiver for monitoring.
LBMExpDLL int lbmmon_rcv_unmonitor (lbmmon_sctl_t *Control, lbm_rcv_t *Receiver)
 Terminate monitoring for a receiver.
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.
LBMExpDLL int lbmmon_evq_unmonitor (lbmmon_sctl_t *Control, lbm_event_queue_t *EventQueue)
 Terminate monitoring for an event queue.
LBMExpDLL int lbmmon_sctl_destroy (lbmmon_sctl_t *Control)
 Destroy a source monitoring controller.
LBMExpDLL int lbmmon_rctl_destroy (lbmmon_rctl_t *Control)
 Destroy a statistics receive controller.
LBMExpDLL int lbmmon_sctl_sample (lbmmon_sctl_t *Control)
 Gather statistics for on-demand objects.
LBMExpDLL int lbmmon_sctl_sample_ex (lbmmon_sctl_t *Control, const char *ApplicationSourceID)
 Extended gather statistics for on-demand objects.
LBMExpDLL int lbmmon_attr_get_ipv4sender (const void *AttributeBlock, lbm_uint_t *Address)
 Retrieve the IPV4 sender address attribute from the statistics attribute block.
LBMExpDLL int lbmmon_attr_get_timestamp (const void *AttributeBlock, time_t *Timestamp)
 Retrieve the timestamp attribute from the statistics attribute block.
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.
LBMExpDLL int lbmmon_attr_get_objectid (const void *AttributeBlock, lbm_ulong_t *ObjectID)
 Retrieve the object ID attribute from the statistics attribute block.
LBMExpDLL int lbmmon_attr_get_contextid (const void *AttributeBlock, lbm_ulong_t *ContextID)
 Retrieve the context ID attribute from the statistics attribute block.
LBMExpDLL int lbmmon_attr_get_processid (const void *AttributeBlock, lbm_ulong_t *ProcessID)
 Retrieve the process ID attribute from the statistics attribute block.
LBMExpDLL int lbmmon_attr_get_source (const void *AttributeBlock, lbm_ulong_t *Source)
 Retrieve the source attribute from the statistics attribute block.
LBMExpDLL int lbmmon_errnum (void)
 Retrieve the error number for the last error encountered.
LBMExpDLL const char * lbmmon_errmsg (void)
 Retrieve the error message for the last error encountered.
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.


Detailed Description

Author:
David K. Ameiss - Informatica Corporation
Version:
Id
//UMprod/REL_5_3_6/29West/lbm/src/mon/lbm/lbmmon.h#2
The Ultra Messaging (UM) Monitoring API Description. Included are types, constants, and functions related to the API. Contents are subject to change.

All of the documentation and software included in this and any other Informatica Corporation Ultra Messaging Releases Copyright (C) Informatica Corporation. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with Informatica Corporation.

Copyright (C) 2006-2014, Informatica Corporation. All Rights Reserved.

THE SOFTWARE IS PROVIDED "AS IS" AND INFORMATICA DISCLAIMS ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. INFORMATICA DOES NOT WARRANT THAT USE OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE. INFORMATICA SHALL NOT, UNDER ANY CIRCUMSTANCES, BE LIABLE TO LICENSEE FOR LOST PROFITS, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR INDIRECT DAMAGES ARISING OUT OF OR RELATED TO THIS AGREEMENT OR THE TRANSACTIONS CONTEMPLATED HEREUNDER, EVEN IF INFORMATICA HAS BEEN APPRISED OF THE LIKELIHOOD OF SUCH DAMAGES.

The LBM Monitoring API provides a framework to allow the convenient gathering of LBM statistics.


Define Documentation

#define LBMMON_ATTR_APPSOURCEID   2

Attribute block entry contains the application source ID string.

#define LBMMON_ATTR_CONTEXTID   LBMMON_ATTR_OBJECTID

Attribute block entry contains the context ID.

Deprecated:
Use LBMMON_ATTR_OBJECTID instead.

#define LBMMON_ATTR_FORMAT_MODULEID   3

Attribute block entry contains the format module ID.

#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_ERROR_BASE   4096

Base value for LBMMON error codes.

#define LBMMON_PACKET_SIGNATURE   0x1b33041b

Packet signature value

#define LBMMON_PACKET_TYPE_CONTEXT   3

Packet contains context statistics

#define LBMMON_PACKET_TYPE_EVENT_QUEUE   2

Packet contains event queue statistics

#define LBMMON_PACKET_TYPE_RECEIVER   1

Packet contains receiver statistics

#define LBMMON_PACKET_TYPE_SOURCE   0

Packet contains source 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_RECEIVER_CALLBACK   0

Receive controller attribute option: Receiver statistics callback.

#define LBMMON_RCTL_SOURCE_CALLBACK   1

Receive controller attribute option: Source statistics callback.


Typedef Documentation

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

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:
Statistics A pointer to an lbm_context_stats_t structure into which the data is deserialized.
Source A pointer to a buffer containing the serialized data.
Length The length of the serialized data.
ModuleID The 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).
FormatClientData A 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 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 lbm_context_stats_t *Statistics, void *FormatClientData)

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:
Destination A pointer to a buffer to receive the serialized format of the lbm_context_stats_t statistics.
Size A 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.
ModuleID A 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).
Statistics A pointer to the lbm_context_stats_t structure to be serialized.
FormatClientData A 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)

Parameters:
AttributeBlock Pointer to the statistics packet attribute block.
Statistics Pointer to the context statistics.
ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().

typedef struct lbmmon_ctx_statistics_func_t_stct lbmmon_ctx_statistics_func_t

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

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

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:
Statistics A pointer to an lbm_event_queue_stats_t structure into which the data is deserialized.
Source A pointer to a buffer containing the serialized data.
Length The length of the serialized data.
ModuleID The 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).
FormatClientData A 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 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 lbm_event_queue_stats_t *Statistics, void *FormatClientData)

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:
Destination A pointer to a buffer to receive the serialized format of the lbm_event_queue_stats_t statistics.
Size A 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.
ModuleID A 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).
Statistics A pointer to the lbm_event_queue_stats_t structure to be serialized.
FormatClientData A 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)

Parameters:
AttributeBlock Pointer to the statistics packet attribute block.
Statistics Pointer to the event queue statistics.
ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().

typedef struct lbmmon_evq_statistics_func_t_stct lbmmon_evq_statistics_func_t

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

typedef const char*(*) lbmmon_format_errmsg_t(void)

Returns:
A string containing a description of the last error encountered by the module.

typedef int(*) lbmmon_format_finish_t(void *FormatClientData)

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:
FormatClientData A 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)

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:
FormatClientData A 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.
FormatOptions The 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 struct lbmmon_packet_hdr_t_stct lbmmon_packet_hdr_t

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

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

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:
Statistics A pointer to an lbm_rcv_transport_stats_t structure into which the data is deserialized.
Source A pointer to a buffer containing the serialized data.
Length The length of the serialized data.
ModuleID The 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).
FormatClientData A 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 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 lbm_rcv_transport_stats_t *Statistics, void *FormatClientData)

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:
Destination A pointer to a buffer to receive the serialized format of the lbm_rcv_transport_stats_t statistics.
Size A 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.
ModuleID A 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).
Statistics A pointer to the lbm_rcv_transport_stats_t structure to be serialized.
FormatClientData A 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)

Parameters:
AttributeBlock Pointer to the statistics packet attribute block.
Statistics Pointer to the receiver statistics.
ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().

typedef struct lbmmon_rcv_statistics_func_t_stct lbmmon_rcv_statistics_func_t

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

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

See also:
lbmmon_rcv_format_serialize_t

lbmmon_src_format_serialize_t

lbmmon_rcv_format_deserialize_t

Parameters:
Statistics A pointer to an lbm_src_transport_stats_t structure into which the data is deserialized.
Source A pointer to a buffer containing the serialized data.
Length The length of the serialized data.
ModuleID The 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).
FormatClientData A 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 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 lbm_src_transport_stats_t *Statistics, void *FormatClientData)

See also:
lbmmon_rcv_format_serialize_t

lbmmon_rcv_format_deserialize_t

lbmmon_src_format_deserialize_t

Parameters:
Destination A pointer to a buffer to receive the serialized format of the lbm_src_transport_stats_t statistics.
Size A 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.
ModuleID A 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).
Statistics A pointer to an lbm_src_transport_stats_t structure to be serialized.
FormatClientData A 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)

Parameters:
AttributeBlock Pointer to the statistics packet attribute block.
Statistics Pointer to the source statistics.
ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().

typedef struct lbmmon_src_statistics_func_t_stct lbmmon_src_statistics_func_t

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

typedef const char*(*) lbmmon_transport_errmsg_t(void)

Returns:
A string containing a description of the last error encountered by the module.

typedef int(*) lbmmon_transport_finishrcv_t(void *TransportClientData)

Parameters:
TransportClientData A 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)

Parameters:
TransportClientData A 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)

Parameters:
TransportClientData A pointer which may be filled in (by this function) with a pointer to transport-specific client data.
TransportOptions The 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)

Parameters:
TransportClientData A pointer which may be filled in (by this function) with a pointer to transport-specific client data.
TransportOptions The 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)

Parameters:
Data Pointer to a buffer into which the received (serialized) data is to be placed.
Length Pointer 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.
TimeoutMS Maximum time, in milliseconds, the function may wait for incoming data before returning a timeout indicator.
TransportClientData A 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)

Parameters:
Data Pointer to the serialized statistics data.
Length Length of the serialized statistics data.
TransportClientData A pointer to transport-specific client data as returned by the lbmmon_transport_initsrc_t function.
Returns:
Zero if successful, -1 otherwise.


Function Documentation

LBMExpDLL int lbmmon_attr_get_appsourceid ( const void *  AttributeBlock,
char *  ApplicationSourceID,
size_t  Length 
)

Parameters:
AttributeBlock Pointer to the attribute block as passed to the callback function.
ApplicationSourceID Pointer to a buffer to receive the application source ID as a null-terminated string.
Length Maximum 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 
)

Parameters:
AttributeBlock Pointer to the attribute block as passed to the callback function.
ContextID Pointer 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_ipv4sender ( const void *  AttributeBlock,
lbm_uint_t *  Address 
)

Parameters:
AttributeBlock Pointer to the attribute block as passed to the callback function.
Address Pointer 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 
)

Parameters:
AttributeBlock Pointer to the attribute block as passed to the callback function.
ObjectID Pointer 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 
)

Parameters:
AttributeBlock Pointer to the attribute block as passed to the callback function.
ProcessID Pointer 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 
)

Parameters:
AttributeBlock Pointer to the attribute block as passed to the callback function.
Source Pointer 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 
)

Parameters:
AttributeBlock Pointer to the attribute block as passed to the callback function.
Timestamp Pointer to a time_t to receive the timestamp.
Returns:
0 if successful, -1 if the attribute does not exist.

LBMExpDLL int lbmmon_context_monitor ( lbmmon_sctl_t *  Control,
lbm_context_t *  Context,
const char *  ApplicationSourceID,
unsigned int  Seconds 
)

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:
Control Pointer to an lbmmon_sctl_t which is to be used to monitor the context.
Context Pointer to an lbm_context_t which will be monitored.
ApplicationSourceID Null-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
Seconds Interval (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 
)

Unregister a context to prevent further monitoring of that context.

Parameters:
Control Pointer to an lbmmon_sctl_t which is used to monitor the context.
Context Pointer to an previously registered lbm_context_t.
Returns:
Zero if successful, -1 otherwise.

LBMExpDLL const char* lbmmon_errmsg ( void   ) 

Returns:
A pointer to a static character array containing the last error message.

LBMExpDLL int lbmmon_errnum ( void   ) 

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 
)

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:
Control Pointer to an lbmmon_sctl_t which is to be used to monitor the context.
Receiver Pointer to an lbm_event_queue_t which will be monitored.
ApplicationSourceID Null-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
Seconds Interval (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 
)

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

Parameters:
Control Pointer to an lbmmon_sctl_t which is used to monitor the context.
EventQueue Pointer to an previously registered lbm_event_queue_t.
Returns:
Zero if successful, -1 otherwise.

const char* lbmmon_next_key_value_pair ( const char *  String,
char *  Key,
size_t  KeySize,
char *  Value,
size_t  ValueSize 
)

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:
String A pointer to the unprocessed part of the semicolon-separated list.
Key Pointer to a character string into which is written the null-terminated key.
KeySize Maximum length of Key.
Value Pointer to a character string into which is written the null-terminated value.
ValueSize Maximum 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  ) 

The attribute object is created and initialized.

Parameters:
Attributes A 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  ) 

The attribute object is cleaned up and deleted.

Parameters:
Attributes A 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 
)

Parameters:
Attributes The attributes object to get the option value for.
Option The option to get. See LBMMON_RCTL_ATTR_*.
Value Pointer to the option value structure to be filled.
Length Length (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 
)

Parameters:
Attributes The attributes object to set the option value for.
Option The option to set. See LBMMON_RCTL_ATTR_*.
Value The value to set for the option.
Length The 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 
)

This creates an instance of an LBM Monitoring Receive Controller.

Parameters:
Control A 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.
Format A pointer to an lbmmon_format_func_t object which has been filled in with the appropriate function pointers.
FormatOptions A 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.
Transport A pointer to an lbmmon_transport_func_t object which has been filled in with the appropriate function pointers.
TransportOptions A 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.
Attributes A pointer to an lbmmon_rctl_attr_t object which has been filled in with the appropriate options.
ClientData A 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  ) 

Destroys a monitoring controller.

Parameters:
Control Pointer 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 
)

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:
Control Pointer to an lbmmon_sctl_t which is to be used to monitor the context.
Receiver Pointer to an lbm_rcv_t which will be monitored.
ApplicationSourceID Null-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
Seconds Interval (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 
)

Unregister a receiver to prevent further monitoring of that receiver.

Parameters:
Control Pointer to an lbmmon_sctl_t which is used to monitor the context.
Receiver Pointer 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 
)

This creates an instance of an LBM Monitoring Source Controller.

Parameters:
Control A 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.
Format A pointer to an lbmmon_format_func_t object which has been filled in with the appropriate function pointers.
FormatOptions A 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.
Transport A pointer to an lbmmon_transport_func_t object which has been filled in with the appropriate function pointers.
TransportOptions A 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  ) 

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

Parameters:
Control Pointer to an lbmmon_sctl_t to be destroyed.
Returns:
Zero if successful, -1 otherwise.

LBMExpDLL int lbmmon_sctl_sample ( lbmmon_sctl_t *  Control  ) 

Parameters:
Control Pointer 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 
)

Parameters:
Control Pointer to an existing lbmmon_sctl_t controller.
ApplicationSourceID Null-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 
)

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:
Control Pointer to an lbmmon_sctl_t which is to be used to monitor the context.
Source Pointer to an lbm_src_t which will be monitored.
ApplicationSourceID Null-terminated string containing an application-specified source identifier. If a NULL pointer or an empty string is passed, the application name will be used.
Seconds Interval (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 
)

Unregister a source to prevent further monitoring of that source.

Parameters:
Control Pointer to an lbmmon_sctl_t which is used to monitor the context.
Source Pointer to an previously registered lbm_src_t.
Returns:
Zero if successful, -1 otherwise.


Generated on Thu Mar 6 13:11:12 2014 for LBM API by  doxygen 1.5.2