lbmmon.h

Go to the documentation of this file.
00001 /** \file lbmmon.h
00002         \brief Ultra Messaging (UM) Monitoring API
00003         \author David K. Ameiss - Informatica Corporation 
00004         \version $Id: //UMprod/REL_5_3_6/29West/lbm/src/mon/lbm/lbmmon.h#2 $
00005         
00006         The Ultra Messaging (UM) Monitoring API Description. Included
00007         are types, constants, and functions related to the API. Contents are
00008         subject to change.
00009 
00010         All of the documentation and software included in this and any
00011         other Informatica Corporation Ultra Messaging Releases
00012         Copyright (C) Informatica Corporation. All rights reserved.
00013         
00014         Redistribution and use in source and binary forms, with or without
00015         modification, are permitted only as covered by the terms of a
00016         valid software license agreement with Informatica Corporation.
00017         
00018         Copyright (C) 2006-2014, Informatica Corporation. All Rights Reserved.
00019         
00020         THE SOFTWARE IS PROVIDED "AS IS" AND INFORMATICA DISCLAIMS ALL WARRANTIES 
00021         EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF 
00022         NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00023         PURPOSE.  INFORMATICA DOES NOT WARRANT THAT USE OF THE SOFTWARE WILL BE 
00024         UNINTERRUPTED OR ERROR-FREE.  INFORMATICA SHALL NOT, UNDER ANY CIRCUMSTANCES, BE 
00025         LIABLE TO LICENSEE FOR LOST PROFITS, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR 
00026         INDIRECT DAMAGES ARISING OUT OF OR RELATED TO THIS AGREEMENT OR THE 
00027         TRANSACTIONS CONTEMPLATED HEREUNDER, EVEN IF INFORMATICA HAS BEEN APPRISED OF 
00028         THE LIKELIHOOD OF SUCH DAMAGES.
00029 
00030         The LBM Monitoring API provides a framework to allow the convenient
00031         gathering of LBM statistics.
00032 
00033 
00034 */
00035 
00036 /** \page lbmmon_examples LBMMON Example source code
00037 
00038         Select one of the following for LBMMON example source code.
00039 
00040         - \subpage lbmmon_lbm_transport "LBMMON LBM transport module"
00041         - \subpage lbmmon_udp_transport "LBMMON UDP transport module"
00042         - \subpage lbmmon_csv_format "LBMMON CSV format module"
00043         - \subpage lbmmon_lbmsnmp_transport "LBMMON LBMSNMP transport module"
00044         
00045         \page lbmmon_lbm_transport LBMMON LBM transport module
00046 
00047         - \subpage lbmmontrlbm_h_page "lbmmontrlbm.h"
00048         - \subpage lbmmontrlbm_c_page "lbmmontrlbm.c"
00049 
00050         \page lbmmontrlbm_h_page Source code for lbmmontrlbm.h
00051 
00052         \include lbmmontrlbm.exh
00053 
00054         \page lbmmontrlbm_c_page Source code for lbmmontrlbm.c
00055 
00056         \include lbmmontrlbm.c
00057 
00058         \page lbmmon_udp_transport LBMMON UDP transport module
00059 
00060         - \subpage lbmmontrudp_h_page "lbmmontrudp.h"
00061         - \subpage lbmmontrudp_c_page "lbmmontrudp.c"
00062 
00063         \page lbmmontrudp_h_page Source code for lbmmontrudp.h
00064 
00065         \include lbmmontrudp.exh
00066 
00067         \page lbmmontrudp_c_page Source code for lbmmontrudp.c
00068 
00069         \include lbmmontrudp.c
00070 
00071         \page lbmmon_csv_format LBMMON CSV format module
00072 
00073         - \subpage lbmmonfmtcsv_h_page "lbmmonfmtcsv.h"
00074         - \subpage lbmmonfmtcsv_c_page "lbmmonfmtcsv.c"
00075 
00076         \page lbmmonfmtcsv_h_page Source code for lbmmonfmtcsv.h
00077         \include lbmmonfmtcsv.exh
00078 
00079         \page lbmmonfmtcsv_c_page Source code for lbmmonfmtcsv.c
00080         \include lbmmonfmtcsv.c
00081         
00082         \page lbmmon_lbmsnmp_transport LBMMON LBMSNMP transport module
00083 
00084         - \subpage lbmmontrlbmsnmp_h_page "lbmmontrlbmsnmp.h"
00085         - \subpage lbmmontrlbmsnmp_c_page "lbmmontrlbmsnmp.c"
00086 
00087         \page lbmmontrlbmsnmp_h_page Source code for lbmmontrlbmsnmp.h
00088 
00089         \include lbmmontrlbmsnmp.exh
00090 
00091         \page lbmmontrlbmsnmp_c_page Source code for lbmmontrlbmsnmp.c
00092 
00093         \include lbmmontrlbmsnmp.c
00094 
00095 */
00096 
00097 #ifndef LBMMON_H
00098 #define LBMMON_H
00099 
00100 #include <stdlib.h>
00101 #ifdef _WIN32
00102         #include <winsock2.h>
00103 #endif
00104 #include <lbm/lbm.h>
00105 
00106 #if defined(__cplusplus)
00107 extern "C" {
00108 #endif /* __cplusplus */
00109 
00110 /*! Base value for LBMMON error codes. */
00111 #define LBMMON_ERROR_BASE 4096
00112 /*! lbmmon_errnum() value. An invalid argument was passed. */
00113 #define LBMMON_EINVAL (LBMMON_ERROR_BASE + 1)
00114 /*! lbmmon_errnum() value. Out of memory. */
00115 #define LBMMON_ENOMEM (LBMMON_ERROR_BASE + 2)
00116 /*! lbmmon_errnum() value. A call to a module function failed. */
00117 #define LBMMON_EMODFAIL (LBMMON_ERROR_BASE + 3)
00118 /*! lbmmon_errnum() value. A call to an LBM function failed. */
00119 #define LBMMON_ELBMFAIL (LBMMON_ERROR_BASE + 4)
00120 /*! lbmmon_errnum() value. Insufficient resources. */
00121 #define LBMMON_EAGAIN (LBMMON_ERROR_BASE + 5)
00122 /*! lbmmon_errnum() value. Resource already registered. */
00123 #define LBMMON_EALREADY (LBMMON_ERROR_BASE + 6)
00124 
00125 /*! Packet signature value */
00126 #define LBMMON_PACKET_SIGNATURE 0x1b33041b
00127 
00128 /*! Packet contains source statistics */
00129 #define LBMMON_PACKET_TYPE_SOURCE 0
00130 /*! Packet contains receiver statistics */
00131 #define LBMMON_PACKET_TYPE_RECEIVER 1
00132 /*! Packet contains event queue statistics */
00133 #define LBMMON_PACKET_TYPE_EVENT_QUEUE 2
00134 /*! Packet contains context statistics */
00135 #define LBMMON_PACKET_TYPE_CONTEXT 3
00136 
00137 /*!     \brief Statistics packet header layout.
00138 
00139         A statistics packet consists of four fixed-length and fixed-position fields,
00140         as documented below.
00141         It is followed by two variable-length fields.
00142         The option block is located at packet + sizeof(lbmmon_packet_hdr_t), and is
00143         mOptionBlockLength (when properly interpreted) bytes in length (which may be zero).
00144         The statistics data block is located immediately following the option block.
00145 */
00146 typedef struct lbmmon_packet_hdr_t_stct
00147 {
00148         /*! Packet signature in network order. Must be ::LBMMON_PACKET_SIGNATURE. */
00149         lbm_uint_t mSignature;
00150         /*! Type of statistics, in network order. See LBMMON_PACKET_TYPE_*. */
00151         lbm_ushort_t mType;
00152         /*! Length of optional, variable-length attribute block in network order. */
00153         lbm_ushort_t mAttributeBlockLength;
00154         /*! Length of variable-length statistics data in network order. */
00155         lbm_ushort_t mDataLength;
00156         /*! Filler to assure proper alignment of the structure. */
00157         lbm_ushort_t mFiller;
00158 } lbmmon_packet_hdr_t;
00159 
00160 /*!     \brief Statistics attribute block layout.
00161         Associated with each statistics message is a set of optional attributes.
00162         Any attributes present will immediately follow the packet header.
00163 */
00164 typedef struct lbmmon_attr_block_t_stct
00165 {
00166         /*! Number of attribute entries in network order. */
00167         lbm_ushort_t mEntryCount;
00168         /*! Total length of the attribute block in network order. */
00169         lbm_ushort_t mEntryLength;
00170 } lbmmon_attr_block_t;
00171 
00172 /*! Attribute block entry contains the sender IPV4 address. */
00173 #define LBMMON_ATTR_SENDER_IPV4 0
00174 /*! Attribute block entry contains the timestamp. */
00175 #define LBMMON_ATTR_TIMESTAMP 1
00176 /*! Attribute block entry contains the application source ID string. */
00177 #define LBMMON_ATTR_APPSOURCEID 2
00178 /*! Attribute block entry contains the format module ID. */
00179 #define LBMMON_ATTR_FORMAT_MODULEID 3
00180 /*! Attribute block contains the object ID. */
00181 #define LBMMON_ATTR_OBJECTID 4
00182 /*! Attribute block entry contains the context ID.
00183         @deprecated Use ::LBMMON_ATTR_OBJECTID instead.
00184 */
00185 #define LBMMON_ATTR_CONTEXTID LBMMON_ATTR_OBJECTID
00186 /*! Attribute block entry contains the process ID. */
00187 #define LBMMON_ATTR_PROCESSID 5
00188 /*!
00189         Attribute block entry contains the source flag. See LBMMON_ATTR_SOURCE_* for possible values.
00190         Used to distinguish between MIM source/receiver statistics and normal transport
00191         source/receiver statistics.
00192 */
00193 #define LBMMON_ATTR_SOURCE 6
00194 
00195 /*! Source/receiver statistics are from a normal transport session. */
00196 #define LBMMON_ATTR_SOURCE_NORMAL 0
00197 /*! Source/receiver statistics are from a MIM transport session. */
00198 #define LBMMON_ATTR_SOURCE_IM 1
00199 
00200 /*!     \brief Statistics attribute entry layout.
00201         Each attribute entry within the attributes block consists of an entry header,
00202         followed immediately by the attribute data.
00203 */
00204 typedef struct lbmmon_attr_entry_t_stct
00205 {
00206         /*! Attribute type in network order. */
00207         lbm_ushort_t mType;
00208         /*! Length of attribute data for this entry in network order. */
00209         lbm_ushort_t mLength;
00210 } lbmmon_attr_entry_t;
00211 
00212 /*!     \brief Function to initialize a format module.
00213 
00214         This function should perform any initialization required by the format
00215         module.
00216         While, depending on the module, initialization may not be required,
00217         representative tasks include allocating a block of format-specific data,
00218         parsing options from the supplied options string,
00219         and initializing any operating parameters for the module.
00220 
00221         This function is called by lbmmon_sctl_create() and lbmmon_rctl_create().
00222 
00223         \param FormatClientData A pointer which may be filled in (by this function)
00224                 with a pointer to format-specific client data.
00225                 A pointer to the format-specific data is passed to each function in the
00226                 module,
00227                 to be used as the module sees fit.
00228         \param FormatOptions The FormatOptions argument originally passed to
00229                 lbmmon_sctl_create() or lbmmon_rctl_create().
00230         \return Zero if successful, -1 otherwise.
00231                 If -1 is returned,
00232                 no further calls to the format module will be made, and the calling
00233                 function (lbmmon_sctl_create() or lbmmon_rctl_create()) will return -1.
00234 */
00235 typedef int (*lbmmon_format_init_t)(void * * FormatClientData,
00236                                                                         const void * FormatOptions);
00237 
00238 /*!     \brief Function to serialize an lbm_rcv_transport_stats_t structure.
00239 
00240         This function should transform the lbm_rcv_transport_stat_t structure into
00241         a form which can be deserialized by the corresponding
00242         ::lbmmon_rcv_format_deserialize_t function.
00243 
00244         \sa lbmmon_src_format_serialize_t
00245         \sa lbmmon_rcv_format_deserialize_t
00246         \sa lbmmon_src_format_deserialize_t
00247         \param Destination A pointer to a buffer to receive the serialized format
00248                 of the lbm_rcv_transport_stats_t statistics.
00249         \param Size A pointer to a \c size_t.
00250                 On entry,
00251                 it will contain the maximum allowed size of the serialized statistics.
00252                 On exit,
00253                 it must contain the actual size of the serialized statistics.
00254         \param ModuleID A pointer to an \c unsigned \c short,
00255                 into which the module may write a module identification value.
00256                 This value is included in the transmitted packet,
00257                 and may be used by the receiver to verify and differentiate between
00258                 different version of the module (and thus the format of the data it expects).
00259         \param Statistics A pointer to the lbm_rcv_transport_stats_t structure
00260                 to be serialized.
00261         \param FormatClientData A pointer to format-specific client data as
00262                 returned by the ::lbmmon_format_init_t function.
00263         \return Zero if successful, -1 otherwise.
00264                 If -1 is returned,
00265                 the serialized data will not be sent.
00266 */
00267 typedef int (*lbmmon_rcv_format_serialize_t)(char * Destination,
00268                                                                                          size_t * Size,
00269                                                                                          unsigned short * ModuleID,
00270                                                                                          const lbm_rcv_transport_stats_t * Statistics,
00271                                                                                          void * FormatClientData);
00272 
00273 /*!     \brief Function to serialize an lbm_src_transport_stats_t structure.
00274 
00275         \sa lbmmon_rcv_format_serialize_t
00276         \sa lbmmon_rcv_format_deserialize_t
00277         \sa lbmmon_src_format_deserialize_t
00278         \param Destination A pointer to a buffer to receive the serialized format
00279                 of the lbm_src_transport_stats_t statistics.
00280         \param Size A pointer to a size_t.
00281                 On entry,
00282                 it contains the maximum allowed size of the serialized statistics.
00283                 On exit,
00284                 it must contain the actual size of the serialized statistics.
00285         \param ModuleID A pointer to an \c unsigned \c short,
00286                 into which the module may write a module identification value.
00287                 This value is included in the transmitted packet,
00288                 and may be used by the receiver to verify and differentiate between
00289                 different version of the module (and thus the format of the data it expects).
00290         \param Statistics A pointer to an lbm_src_transport_stats_t structure to be
00291                 serialized.
00292         \param FormatClientData A pointer to format-specific client data as
00293                 returned by the ::lbmmon_format_init_t function.
00294         \return Zero if successful, -1 otherwise.
00295                 If -1 is returned,
00296                 the serialized data will not be sent.
00297 */
00298 typedef int (*lbmmon_src_format_serialize_t)(char * Destination,
00299                                                                                          size_t * Size,
00300                                                                                          unsigned short * ModuleID,
00301                                                                                          const lbm_src_transport_stats_t * Statistics,
00302                                                                                          void * FormatClientData);
00303 
00304 /*!     \brief Function to serialize an lbm_event_queue_stats_t structure.
00305 
00306         This function should transform the lbm_event_queue_stats_t structure into
00307         a form which can be deserialized by the corresponding
00308         ::lbmmon_evq_format_deserialize_t function.
00309 
00310         \sa lbmmon_evq_format_deserialize_t
00311         \param Destination A pointer to a buffer to receive the serialized format
00312                 of the lbm_event_queue_stats_t statistics.
00313         \param Size A pointer to a \c size_t.
00314                 On entry,
00315                 it will contain the maximum allowed size of the serialized statistics.
00316                 On exit,
00317                 it must contain the actual size of the serialized statistics.
00318         \param ModuleID A pointer to an \c unsigned \c short,
00319                 into which the module may write a module identification value.
00320                 This value is included in the transmitted packet,
00321                 and may be used by the receiver to verify and differentiate between
00322                 different version of the module (and thus the format of the data it expects).
00323         \param Statistics A pointer to the lbm_event_queue_stats_t structure
00324                 to be serialized.
00325         \param FormatClientData A pointer to format-specific client data as
00326                 returned by the ::lbmmon_format_init_t function.
00327         \return Zero if successful, -1 otherwise.
00328                 If -1 is returned,
00329                 the serialized data will not be sent.
00330 */
00331 typedef int (*lbmmon_evq_format_serialize_t)(char * Destination,
00332                                                                                          size_t * Size,
00333                                                                                          unsigned short * ModuleID,
00334                                                                                          const lbm_event_queue_stats_t * Statistics,
00335                                                                                          void * FormatClientData);
00336 
00337 /*!     \brief Function to serialize an lbm_context_stats_t structure.
00338 
00339         This function should transform the lbm_context_stats_t structure into
00340         a form which can be deserialized by the corresponding
00341         ::lbmmon_ctx_format_deserialize_t function.
00342 
00343         \sa lbmmon_ctx_format_deserialize_t
00344         \param Destination A pointer to a buffer to receive the serialized format
00345                 of the lbm_context_stats_t statistics.
00346         \param Size A pointer to a \c size_t.
00347                 On entry,
00348                 it will contain the maximum allowed size of the serialized statistics.
00349                 On exit,
00350                 it must contain the actual size of the serialized statistics.
00351         \param ModuleID A pointer to an \c unsigned \c short,
00352                 into which the module may write a module identification value.
00353                 This value is included in the transmitted packet,
00354                 and may be used by the receiver to verify and differentiate between
00355                 different version of the module (and thus the format of the data it expects).
00356         \param Statistics A pointer to the lbm_context_stats_t structure
00357                 to be serialized.
00358         \param FormatClientData A pointer to format-specific client data as
00359                 returned by the ::lbmmon_format_init_t function.
00360         \return Zero if successful, -1 otherwise.
00361                 If -1 is returned,
00362                 the serialized data will not be sent.
00363 */
00364 typedef int (*lbmmon_ctx_format_serialize_t)(char * Destination,
00365                                                                                          size_t * Size,
00366                                                                                          unsigned short * ModuleID,
00367                                                                                          const lbm_context_stats_t * Statistics,
00368                                                                                          void * FormatClientData);
00369 
00370 /*!     \brief Function to deserialize a buffer into an
00371         lbm_rcv_transport_stats_t structure.
00372 
00373         Transform a block of data serialized by the ::lbmmon_rcv_format_serialize_t
00374         function into a lbm_rcv_transport_stats_t structure.
00375 
00376         \sa lbmmon_rcv_format_serialize_t
00377         \sa lbmmon_src_format_serialize_t
00378         \sa lbmmon_src_format_deserialize_t
00379         \param Statistics A pointer to an lbm_rcv_transport_stats_t structure into
00380                 which the data is deserialized.
00381         \param Source A pointer to a buffer containing the serialized data.
00382         \param Length The length of the serialized data.
00383         \param ModuleID The module ID received in the packet.
00384                 It may be used to verify and differentiate between different version of
00385                 the module (and thus the format of the data it expects).
00386         \param FormatClientData A pointer to format-specific client data as
00387                 returned by the ::lbmmon_format_init_t function.
00388         \return Zero if successful, -1 otherwise.
00389                 If -1 is returned,
00390                 the deserialized data will not be delivered to the application.
00391 */
00392 typedef int (*lbmmon_rcv_format_deserialize_t)(lbm_rcv_transport_stats_t * Statistics,
00393                                                                                            const char * Source,
00394                                                                                            size_t Length,
00395                                                                                            unsigned short ModuleID,
00396                                                                                            void * FormatClientData);
00397 
00398 /*!     \brief Function to deserialize a buffer into an lbm_src_transport_stats_t
00399         structure.
00400 
00401         \sa lbmmon_rcv_format_serialize_t
00402         \sa lbmmon_src_format_serialize_t
00403         \sa lbmmon_rcv_format_deserialize_t
00404         \param Statistics A pointer to an lbm_src_transport_stats_t structure into
00405                 which the data is deserialized.
00406         \param Source A pointer to a buffer containing the serialized data.
00407         \param Length The length of the serialized data.
00408         \param ModuleID The module ID received in the packet.
00409                 It may be used to verify and differentiate between different version of
00410                 the module (and thus the format of the data it expects).
00411         \param FormatClientData A pointer to format-specific client data as
00412                 returned by the ::lbmmon_format_init_t function.
00413         \return Zero if successful, -1 otherwise.
00414                 If -1 is returned,
00415                 the deserialized data will not be delivered to the application.
00416 */
00417 typedef int (*lbmmon_src_format_deserialize_t)(lbm_src_transport_stats_t * Statistics,
00418                                                                                            const char * Source,
00419                                                                                            size_t Length,
00420                                                                                            unsigned short ModuleID,
00421                                                                                            void * FormatClientData);
00422 
00423 /*!     \brief Function to deserialize a buffer into an
00424         lbm_event_queue_stats_t structure.
00425 
00426         Transform a block of data serialized by the ::lbmmon_evq_format_serialize_t
00427         function into a lbm_event_queue_stats_t structure.
00428 
00429         \sa lbmmon_evq_format_serialize_t
00430         \param Statistics A pointer to an lbm_event_queue_stats_t structure into
00431                 which the data is deserialized.
00432         \param Source A pointer to a buffer containing the serialized data.
00433         \param Length The length of the serialized data.
00434         \param ModuleID The module ID received in the packet.
00435                 It may be used to verify and differentiate between different version of
00436                 the module (and thus the format of the data it expects).
00437         \param FormatClientData A pointer to format-specific client data as
00438                 returned by the ::lbmmon_format_init_t function.
00439         \return Zero if successful, -1 otherwise.
00440                 If -1 is returned,
00441                 the deserialized data will not be delivered to the application.
00442 */
00443 typedef int (*lbmmon_evq_format_deserialize_t)(lbm_event_queue_stats_t * Statistics,
00444                                                                                            const char * Source,
00445                                                                                            size_t Length,
00446                                                                                            unsigned short ModuleID,
00447                                                                                            void * FormatClientData);
00448 
00449 /*!     \brief Function to deserialize a buffer into an
00450         lbm_context_stats_t structure.
00451 
00452         Transform a block of data serialized by the ::lbmmon_ctx_format_serialize_t
00453         function into a lbm_context_stats_t structure.
00454 
00455         \sa lbmmon_ctx_format_serialize_t
00456         \param Statistics A pointer to an lbm_context_stats_t structure into
00457                 which the data is deserialized.
00458         \param Source A pointer to a buffer containing the serialized data.
00459         \param Length The length of the serialized data.
00460         \param ModuleID The module ID received in the packet.
00461                 It may be used to verify and differentiate between different version of
00462                 the module (and thus the format of the data it expects).
00463         \param FormatClientData A pointer to format-specific client data as
00464                 returned by the ::lbmmon_format_init_t function.
00465         \return Zero if successful, -1 otherwise.
00466                 If -1 is returned,
00467                 the deserialized data will not be delivered to the application.
00468 */
00469 typedef int (*lbmmon_ctx_format_deserialize_t)(lbm_context_stats_t * Statistics,
00470                                                                                            const char * Source,
00471                                                                                            size_t Length,
00472                                                                                            unsigned short ModuleID,
00473                                                                                            void * FormatClientData);
00474 
00475 /*!     \brief Function to finish format module processing.
00476 
00477         Perform any required format module cleanup processing.
00478         If format-specific client data was allocated in the ::lbmmon_format_init_t
00479         function,
00480         it should be freed in this function.
00481 
00482         This function is called by lbmmon_sctl_destroy() and lbmmon_rctl_destroy().
00483 
00484         \param FormatClientData A pointer to format-specific client data.
00485                 This pointer should be freed if it was allocated previously.
00486         \return Zero if successful, -1 otherwise.
00487 */
00488 typedef int (*lbmmon_format_finish_t)(void * FormatClientData);
00489 
00490 /*!     \brief Function to return the last error message from a format module.
00491 
00492         \return A string containing a description of the last error encountered by the module.
00493 */
00494 typedef const char * (*lbmmon_format_errmsg_t)(void);
00495 
00496 /*!     \brief Format module function pointer container.
00497 */
00498 typedef struct lbmmon_format_func_t_stct
00499 {
00500         /*! Initialization function. */
00501         lbmmon_format_init_t mInit;
00502         /*! Function to serialize receiver statistics (lbm_rcv_transport_stats_t). */
00503         lbmmon_rcv_format_serialize_t mRcvSerialize;
00504         /*! Function to serialize source statistics (lbm_src_transport_stats_t). */
00505         lbmmon_src_format_serialize_t mSrcSerialize;
00506         /*! Function to deserialize receiver statistics (lbm_rcv_transport_stats_t). */
00507         lbmmon_rcv_format_deserialize_t mRcvDeserialize;
00508         /*! Function to deserialize source statistics (lbm_src_transport_stats_t). */
00509         lbmmon_src_format_deserialize_t mSrcDeserialize;
00510         /*! Format-specific cleanup function. */
00511         lbmmon_format_finish_t mFinish;
00512         /*! Function to return a message describing the last error encountered. */
00513         lbmmon_format_errmsg_t mErrorMessage;
00514         /*! Function to serialize event queue statistics (lbm_event_queue_stats_t). */
00515         lbmmon_evq_format_serialize_t mEvqSerialize;
00516         /*! Function to deserialize event queue statistics (lbm_event_queue_stats_t). */
00517         lbmmon_evq_format_deserialize_t mEvqDeserialize;
00518         /*! Function to serialize context statistics (lbm_context_stats_t). */
00519         lbmmon_ctx_format_serialize_t mCtxSerialize;
00520         /*! Function to deserialize context statistics (lbm_context_stats_t). */
00521         lbmmon_ctx_format_deserialize_t mCtxDeserialize;
00522 } lbmmon_format_func_t;
00523 
00524 /*!     \brief Client callback function to process a received receiver statistics
00525                 packet.
00526 
00527         \param AttributeBlock Pointer to the statistics packet attribute block.
00528         \param Statistics Pointer to the receiver statistics.
00529         \param ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().
00530 */
00531 typedef void (*lbmmon_rcv_statistics_cb)(const void * AttributeBlock,
00532                                                                                  const lbm_rcv_transport_stats_t * Statistics,
00533                                                                                  void * ClientData);
00534 
00535 /*!     \brief A structure that holds the callback information for receiver statistics.
00536 
00537          A structure used with receive controller options to get/set specific callback information.
00538 */
00539 typedef struct lbmmon_rcv_statistics_func_t_stct
00540 {
00541         /*! Receiver statistics callback function. */
00542         lbmmon_rcv_statistics_cb cbfunc;
00543 } lbmmon_rcv_statistics_func_t;
00544 
00545 /*!     \brief Client callback function to process a received source statistics
00546                 packet.
00547 
00548         \param AttributeBlock Pointer to the statistics packet attribute block.
00549         \param Statistics Pointer to the source statistics.
00550         \param ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().
00551 */
00552 typedef void (*lbmmon_src_statistics_cb)(const void * AttributeBlock,
00553                                                                                  const lbm_src_transport_stats_t * Statistics,
00554                                                                                  void * ClientData);
00555 
00556 /*!     \brief A structure that holds the callback information for source statistics.
00557 
00558          A structure used with receive controller options to get/set specific callback information.
00559 */
00560 typedef struct lbmmon_src_statistics_func_t_stct
00561 {
00562         /*! Source statistics callback function. */
00563         lbmmon_src_statistics_cb cbfunc;
00564 } lbmmon_src_statistics_func_t;
00565 
00566 /*!     \brief Client callback function to process a received event queue statistics
00567                 packet.
00568 
00569         \param AttributeBlock Pointer to the statistics packet attribute block.
00570         \param Statistics Pointer to the event queue statistics.
00571         \param ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().
00572 */
00573 typedef void (*lbmmon_evq_statistics_cb)(const void * AttributeBlock,
00574                                                                                  const lbm_event_queue_stats_t * Statistics,
00575                                                                                  void * ClientData);
00576 
00577 /*!     \brief A structure that holds the callback information for event queue statistics.
00578 
00579          A structure used with receive controller options to get/set specific callback information.
00580 */
00581 typedef struct lbmmon_evq_statistics_func_t_stct
00582 {
00583         /*! Event queue statistics callback function. */
00584         lbmmon_evq_statistics_cb cbfunc;
00585 } lbmmon_evq_statistics_func_t;
00586 
00587 /*!     \brief Client callback function to process a received context statistics
00588                 packet.
00589 
00590         \param AttributeBlock Pointer to the statistics packet attribute block.
00591         \param Statistics Pointer to the context statistics.
00592         \param ClientData Pointer to client-specific data as passed to lbmmon_rctl_create().
00593 */
00594 typedef void (*lbmmon_ctx_statistics_cb)(const void * AttributeBlock,
00595                                                                                  const lbm_context_stats_t * Statistics,
00596                                                                                  void * ClientData);
00597 
00598 /*!     \brief A structure that holds the callback information for context statistics.
00599 
00600          A structure used with receive controller options to get/set specific callback information.
00601 */
00602 typedef struct lbmmon_ctx_statistics_func_t_stct
00603 {
00604         /*! Context statistics callback function. */
00605         lbmmon_ctx_statistics_cb cbfunc;
00606 } lbmmon_ctx_statistics_func_t;
00607 
00608 /*! Receive controller attribute option: Receiver statistics callback. */
00609 #define LBMMON_RCTL_RECEIVER_CALLBACK 0
00610 /*! Receive controller attribute option: Source statistics callback. */
00611 #define LBMMON_RCTL_SOURCE_CALLBACK 1
00612 /*! Receive controller attribute option: Event queue statistics callback. */
00613 #define LBMMON_RCTL_EVENT_QUEUE_CALLBACK 2
00614 /*! Receive controller attribute option: Context statistics callback. */
00615 #define LBMMON_RCTL_CONTEXT_CALLBACK 3
00616 
00617 /*!     \brief Function to initialize a transport module to serve as a source
00618                 of statistics.
00619 
00620         \param TransportClientData A pointer which may be filled in
00621                 (by this function)
00622                 with a pointer to transport-specific client data.
00623         \param TransportOptions The TransportOptions argument originally passed to
00624                 lbmmon_sctl_create().
00625         \return Zero if successful, -1 otherwise.
00626 */
00627 typedef int (*lbmmon_transport_initsrc_t)(void * * TransportClientData,
00628                                                                                   const void * TransportOptions);
00629 
00630 /*!     \brief Function to initialize a transport module to serve as a receiver
00631                 of statistics.
00632 
00633         \param TransportClientData A pointer which may be filled in
00634                 (by this function)
00635                 with a pointer to transport-specific client data.
00636         \param TransportOptions The TransportOptions argument originally passed to
00637                 lbmmon_rctl_create().
00638         \return Zero if successful, -1 otherwise.
00639 */
00640 typedef int (*lbmmon_transport_initrcv_t)(void * * TransportClientData,
00641                                                                                   const void * TransportOptions);
00642 
00643 /*!     \brief Send a statistics packet.
00644 
00645         \param Data Pointer to the serialized statistics data.
00646         \param Length Length of the serialized statistics data.
00647         \param TransportClientData A pointer to transport-specific client data
00648                 as returned by the ::lbmmon_transport_initsrc_t function.
00649         \return Zero if successful, -1 otherwise.
00650 */
00651 typedef int (*lbmmon_transport_send_t)(const char * Data,
00652                                                                            size_t Length,
00653                                                                            void * TransportClientData);
00654 
00655 /*!     \brief Receive statistics data.
00656 
00657         \param Data Pointer to a buffer into which the received
00658                 (serialized) data is to be placed.
00659         \param Length Pointer to a size_t variable.
00660                 On entry,
00661                 it contains the maximum number of bytes to read.
00662                 On exit,
00663                 it must contain the actual number of bytes read.
00664         \param TimeoutMS Maximum time,
00665                 in milliseconds,
00666                 the function may wait for incoming data before returning a
00667                 timeout indicator.
00668         \param TransportClientData A pointer to transport-specific client data
00669                 as returned by the ::lbmmon_transport_initrcv_t function.
00670         \return Zero if successful, >0 if timeout exceeded, -1 otherwise.
00671 */
00672 typedef int (*lbmmon_transport_receive_t)(char * Data,
00673                                                                                   size_t * Length,
00674                                                                                   unsigned int TimeoutMS,
00675                                                                                   void * TransportClientData);
00676 
00677 /*!     \brief Finish processing for a source transport.
00678 
00679         \param TransportClientData A pointer to transport-specific client data
00680                 as returned by the ::lbmmon_transport_initsrc_t function.
00681                 If previously allocated by the ::lbmmon_transport_initsrc_t function,
00682                 it must be freed in this function.
00683         \return Zero if successful, -1 otherwise.
00684 */
00685 typedef int (*lbmmon_transport_finishsrc_t)(void * TransportClientData);
00686 
00687 /*!     \brief Finish processing for a receiver transport.
00688 
00689         \param TransportClientData A pointer to transport-specific client data
00690                 as returned by the ::lbmmon_transport_initrcv_t function.
00691                 If previously allocated by the ::lbmmon_transport_initrcv_t function,
00692                 it must be freed in this function.
00693         \return Zero if successful, -1 otherwise.
00694 */
00695 typedef int (*lbmmon_transport_finishrcv_t)(void * TransportClientData);
00696 
00697 /*!     \brief Function to return the last error message from a transport module.
00698 
00699         \return A string containing a description of the last error encountered by the module.
00700 */
00701 typedef const char * (*lbmmon_transport_errmsg_t)(void);
00702 
00703 /*!     \brief Transport module function pointer container.
00704 */
00705 typedef struct lbmmon_transport_func_t_stct
00706 {
00707         /*! Initialize module as a statistics source. */
00708         lbmmon_transport_initsrc_t mInitSource;
00709         /*! Initialize module as a statistics receiver. */
00710         lbmmon_transport_initrcv_t mInitReceiver;
00711         /*! Send a statistics packet. */
00712         lbmmon_transport_send_t mSend;
00713         /*! Receive statistics data. */
00714         lbmmon_transport_receive_t mReceive;
00715         /*! Finish processing for a source transport. */
00716         lbmmon_transport_finishsrc_t mFinishSource;
00717         /*! Finish processing for a receiver transport. */
00718         lbmmon_transport_finishrcv_t mFinishReceiver;
00719         /*! Function to return a message describing the last error encountered. */
00720         lbmmon_transport_errmsg_t mErrorMessage;
00721 } lbmmon_transport_func_t;
00722 
00723 /*!     \brief LBM Monitoring Source Controller object (opaque).
00724 */
00725 struct lbmmon_sctl_t_stct;
00726 typedef struct lbmmon_sctl_t_stct lbmmon_sctl_t;
00727 
00728 /*!     \brief LBM Monitoring Receiver Controller Attribute object (opaque).
00729 */
00730 struct lbmmon_rctl_attr_t_stct;
00731 typedef struct lbmmon_rctl_attr_t_stct lbmmon_rctl_attr_t;
00732 
00733 /*!     \brief LBM Monitoring Receiver Controller object (opaque).
00734 */
00735 struct lbmmon_rctl_t_stct;
00736 typedef struct lbmmon_rctl_t_stct lbmmon_rctl_t;
00737 
00738 /*!     \brief Create an LBM Monitoring Source Controller.
00739 
00740         This creates an instance of an LBM Monitoring Source Controller.
00741 
00742         \param Control A pointer to a pointer to an LBM Monitoring Source Control
00743                 object.
00744                 It will be filled in by this function to point to the newly created
00745                 ::lbmmon_sctl_t object.
00746         \param Format A pointer to an lbmmon_format_func_t object which has been
00747                 filled in with the appropriate function pointers.
00748         \param FormatOptions A block of data which is passed to the format module's
00749                 initialization function.
00750                 This may be used to pass configuration options to the format module.
00751         \param Transport A pointer to an lbmmon_transport_func_t object which has
00752                 been filled in with the appropriate function pointers.
00753         \param TransportOptions A block of data which is passed to the transport
00754                 module's initialization function.
00755                 This may be used to pass configuration options to the transport module.
00756         \return 0 if successful, -1 otherwise.
00757 */
00758 LBMExpDLL int lbmmon_sctl_create(lbmmon_sctl_t * * Control,
00759                                                                  const lbmmon_format_func_t * Format,
00760                                                                  const void * FormatOptions,
00761                                                                  const lbmmon_transport_func_t * Transport,
00762                                                                  const void * TransportOptions);
00763 
00764 /*!     \brief Create an LBM Monitoring Receive Controller attribute object.
00765 
00766         The attribute object is created and initialized.
00767 
00768         \param Attributes A pointer to a pointer to an LBMMON receive controller attribute
00769                 structure. Will be filled in by the function to point to the newly created
00770                 lbmmon_rctl_attr_t object.
00771         \return 0 if successful, -1 otherwise.
00772 */
00773 LBMExpDLL int lbmmon_rctl_attr_create(lbmmon_rctl_attr_t * * Attributes);
00774 
00775 /*!     \brief Delete an LBM Monitoring Receive Controller attribute object.
00776 
00777         The attribute object is cleaned up and deleted.
00778 
00779         \param Attributes A pointer to an LBMMON receive controller attribute
00780                 structure as created by ::lbmmon_rctl_attr_create.
00781         \return 0 if successful, -1 otherwise.
00782 */
00783 LBMExpDLL int lbmmon_rctl_attr_delete(lbmmon_rctl_attr_t * Attributes);
00784 
00785 /*!
00786         \brief Set an LBMMON receive controller attribute option value.
00787 
00788         \param Attributes The attributes object to set the option value for.
00789         \param Option The option to set. See LBMMON_RCTL_ATTR_*.
00790         \param Value The value to set for the option.
00791         \param Length The size (in bytes) of \a Value.
00792         \return 0 if successful, -1 otherwise.
00793  */
00794 LBMExpDLL int lbmmon_rctl_attr_setopt(lbmmon_rctl_attr_t * Attributes, int Option, void * Value, size_t Length);
00795 
00796 /*!
00797         \brief Get an LBMMON receive controller attribute option value.
00798 
00799         \param Attributes The attributes object to get the option value for.
00800         \param Option The option to get. See LBMMON_RCTL_ATTR_*.
00801         \param Value Pointer to the option value structure to be filled.
00802         \param Length Length (in bytes) of the \a Value structure when passed in.
00803                 Upon return, this is set to the actual size of the \a Value structure filled in.
00804         \return 0 if successful, -1 otherwise.
00805  */
00806 LBMExpDLL int lbmmon_rctl_attr_getopt(lbmmon_rctl_attr_t * Attributes, int Option, void * Value, size_t * Length);
00807 
00808 /*!     \brief Create an LBM Monitoring Receive Controller.
00809 
00810         This creates an instance of an LBM Monitoring Receive Controller.
00811 
00812         \param Control A pointer to a pointer to an LBM Monitoring Receive Control
00813                 object.
00814                 Will be filled in by this function to point to the newly created
00815                 ::lbmmon_rctl_t object.
00816         \param Format A pointer to an lbmmon_format_func_t object which has been
00817                 filled in with the appropriate function pointers.
00818         \param FormatOptions A block of data which is passed to the format module's
00819                 initialization function.
00820                 This may be used to pass configuration options to the format module.
00821         \param Transport A pointer to an lbmmon_transport_func_t object which has
00822                 been filled in with the appropriate function pointers.
00823         \param TransportOptions A block of data which is passed to the transport
00824                 module's initialization function.
00825                 This may be used to pass configuration options to the transport module.
00826         \param Attributes A pointer to an ::lbmmon_rctl_attr_t object which has been
00827                 filled in with the appropriate options.
00828         \param ClientData A pointer to a block of memory which can be used for
00829                 client-specific data. It is passed to all callback functions.
00830         \return 0 if successful, -1 otherwise.
00831 */
00832 LBMExpDLL int lbmmon_rctl_create(lbmmon_rctl_t * * Control,
00833                                                                  const lbmmon_format_func_t * Format,
00834                                                                  const void * FormatOptions,
00835                                                                  const lbmmon_transport_func_t * Transport,
00836                                                                  const void * TransportOptions,
00837                                                                  lbmmon_rctl_attr_t * Attributes,
00838                                                                  void * ClientData);
00839 
00840 /*!     \brief Register a context for monitoring.
00841 
00842         When a context is monitored,
00843         statistics are gathered for all transports on that context,
00844         broken out by transport.
00845         Monitoring may be done at regular intervals,
00846         specified by the \a Seconds parameter.
00847         As an alternative,
00848         passing zero for \a Seconds will not automatically monitor the context,
00849         but instead require an explicit call to lbmmon_sctl_sample().
00850 
00851         If monitoring is to be used as a form of heartbeat,
00852         the preferred method is to call lbmmon_sctl_sample() from a context
00853         thread or event queue timer callback.
00854         This ensures that the object actually processing the messages is the
00855         one generating the monitoring statistics,
00856         guaranteeing that it is truly acting as a heartbeat mechanism.
00857 
00858         \param Control Pointer to an ::lbmmon_sctl_t which is to be used to
00859                 monitor the context.
00860         \param Context Pointer to an ::lbm_context_t which will be monitored.
00861         \param ApplicationSourceID Null-terminated string containing an
00862                 application-specified source identifier.
00863                 If a NULL pointer or an empty string is passed,
00864                 the application name will be used.
00865         \param Seconds Interval (in seconds) at which monitoring information
00866                 will be gathered and sent.
00867                 If zero,
00868                 the context will not be automatically monitored,
00869                 but instead will be monitored upon a call to lbmmon_ctl_sample().
00870         \return Zero if successful, -1 otherwise.
00871 */ 
00872 LBMExpDLL int lbmmon_context_monitor(lbmmon_sctl_t * Control,
00873                                                                          lbm_context_t * Context,
00874                                                                          const char * ApplicationSourceID,
00875                                                                          unsigned int Seconds);
00876 
00877 /*!     \brief Terminate monitoring for a context.
00878 
00879         Unregister a context to prevent further monitoring of that context.
00880 
00881         \param Control Pointer to an ::lbmmon_sctl_t which is used to monitor
00882                 the context.
00883         \param Context Pointer to an previously registered ::lbm_context_t.
00884         \return Zero if successful, -1 otherwise.
00885 */
00886 LBMExpDLL int lbmmon_context_unmonitor(lbmmon_sctl_t * Control,
00887                                                                            lbm_context_t * Context);
00888 
00889 /*!     \brief Register a source for monitoring.
00890 
00891         Monitoring may be done at regular intervals,
00892         specified by the \a Seconds parameter.
00893         As an alternative,
00894         passing zero for \a Seconds will not automatically monitor the source,
00895         but instead require an explicit call to lbmmon_sctl_sample().
00896 
00897         If monitoring is to be used as a form of heartbeat,
00898         the preferred method is to call lbmmon_ctl_sample() from a context
00899         thread or event queue timer callback.
00900         This ensures that the object actually processing the messages is the
00901         one generating the monitoring statistics,
00902         guaranteeing that it is truly acting as a heartbeat mechanism.
00903 
00904         \param Control Pointer to an ::lbmmon_sctl_t which is to be used to
00905                 monitor the context.
00906         \param Source Pointer to an ::lbm_src_t which will be monitored.
00907         \param ApplicationSourceID Null-terminated string containing an
00908                 application-specified source identifier.
00909                 If a NULL pointer or an empty string is passed,
00910                 the application name will be used.
00911         \param Seconds Interval (in seconds) at which monitoring information
00912                 will be gathered and sent.
00913                 If zero,
00914                 the source will not be automatically monitored,
00915                 but instead will be monitored upon a call to lbmmon_sctl_sample().
00916         \return Zero if successful, -1 otherwise.
00917 */ 
00918 LBMExpDLL int lbmmon_src_monitor(lbmmon_sctl_t * Control,
00919                                                                  lbm_src_t * Source,
00920                                                                  const char * ApplicationSourceID,
00921                                                                  unsigned int Seconds);
00922 
00923 /*!     \brief Terminate monitoring for a source.
00924 
00925         Unregister a source to prevent further monitoring of that source.
00926 
00927         \param Control Pointer to an ::lbmmon_sctl_t which is used to monitor
00928                 the context.
00929         \param Source Pointer to an previously registered ::lbm_src_t.
00930         \return Zero if successful, -1 otherwise.
00931 */
00932 LBMExpDLL int lbmmon_src_unmonitor(lbmmon_sctl_t * Control,
00933                                                                    lbm_src_t * Source);
00934 
00935 /*!     \brief Register a receiver for monitoring.
00936 
00937         Monitoring may be done at regular intervals,
00938         specified by the \a Seconds parameter.
00939         As an alternative,
00940         passing zero for \a Seconds will not automatically monitor the receiver,
00941         but instead require an explicit call to lbmmon_ctl_sample().
00942 
00943         If monitoring is to be used as a form of heartbeat,
00944         the preferred method is to call lbmmon_ctl_sample() from a context
00945         thread or event queue timer callback.
00946         This ensures that the object actually processing the messages is the
00947         one generating the monitoring statistics,
00948         guaranteeing that it is truly acting as a heartbeat mechanism.
00949 
00950         \param Control Pointer to an ::lbmmon_sctl_t which is to be used to
00951                 monitor the context.
00952         \param Receiver Pointer to an lbm_rcv_t which will be monitored.
00953         \param ApplicationSourceID Null-terminated string containing an
00954                 application-specified source identifier.
00955                 If a NULL pointer or an empty string is passed,
00956                 the application name will be used.
00957         \param Seconds Interval (in seconds) at which monitoring information
00958                 will be gathered and sent.
00959                 If zero, the receiver will not be automatically monitored,
00960                 but instead will be monitored upon a call to lbmmon_sctl_sample().
00961         \return Zero if successful, -1 otherwise.
00962 */ 
00963 LBMExpDLL int lbmmon_rcv_monitor(lbmmon_sctl_t * Control,
00964                                                                  lbm_rcv_t * Receiver,
00965                                                                  const char * ApplicationSourceID,
00966                                                                  unsigned int Seconds);
00967 
00968 /*!     \brief Terminate monitoring for a receiver.
00969 
00970         Unregister a receiver to prevent further monitoring of that receiver.
00971 
00972         \param Control Pointer to an ::lbmmon_sctl_t which is used to monitor
00973                 the context.
00974         \param Receiver Pointer to an previously registered ::lbm_rcv_t.
00975         \return Zero if successful, -1 otherwise.
00976 */
00977 LBMExpDLL int lbmmon_rcv_unmonitor(lbmmon_sctl_t * Control,
00978                                                                    lbm_rcv_t * Receiver);
00979 
00980 /*!     \brief Register an event queue for monitoring.
00981 
00982         Monitoring may be done at regular intervals,
00983         specified by the \a Seconds parameter.
00984         As an alternative,
00985         passing zero for \a Seconds will not automatically monitor the receiver,
00986         but instead require an explicit call to lbmmon_ctl_sample().
00987 
00988         If monitoring is to be used as a form of heartbeat,
00989         the preferred method is to call lbmmon_ctl_sample() from a context
00990         thread or event queue timer callback.
00991         This ensures that the object actually processing the messages is the
00992         one generating the monitoring statistics,
00993         guaranteeing that it is truly acting as a heartbeat mechanism.
00994 
00995         \param Control Pointer to an ::lbmmon_sctl_t which is to be used to
00996                 monitor the context.
00997         \param Receiver Pointer to an lbm_event_queue_t which will be monitored.
00998         \param ApplicationSourceID Null-terminated string containing an
00999                 application-specified source identifier.
01000                 If a NULL pointer or an empty string is passed,
01001                 the application name will be used.
01002         \param Seconds Interval (in seconds) at which monitoring information
01003                 will be gathered and sent.
01004                 If zero, the receiver will not be automatically monitored,
01005                 but instead will be monitored upon a call to lbmmon_sctl_sample().
01006         \return Zero if successful, -1 otherwise.
01007 */ 
01008 LBMExpDLL int lbmmon_evq_monitor(lbmmon_sctl_t * Control,
01009                                                                  lbm_event_queue_t * EventQueue,
01010                                                                  const char * ApplicationSourceID,
01011                                                                  unsigned int Seconds);
01012 
01013 /*!     \brief Terminate monitoring for an event queue.
01014 
01015         Unregister an event queue to prevent further monitoring of that receiver.
01016 
01017         \param Control Pointer to an ::lbmmon_sctl_t which is used to monitor
01018                 the context.
01019         \param EventQueue Pointer to an previously registered ::lbm_event_queue_t.
01020         \return Zero if successful, -1 otherwise.
01021 */
01022 LBMExpDLL int lbmmon_evq_unmonitor(lbmmon_sctl_t * Control,
01023                                                                    lbm_event_queue_t * EventQueue);
01024 
01025 /*!     \brief Destroy a source monitoring controller.
01026 
01027         Destroys a monitoring controller. Any contexts, sources, or receivers
01028         currently registered to the controller will be automatically unregistered.
01029 
01030         \param Control Pointer to an ::lbmmon_sctl_t to be destroyed.
01031         \return Zero if successful, -1 otherwise.
01032 */
01033 LBMExpDLL int lbmmon_sctl_destroy(lbmmon_sctl_t * Control);
01034 
01035 /*!     \brief Destroy a statistics receive controller.
01036 
01037         Destroys a monitoring controller.
01038 
01039         \param Control Pointer to an ::lbmmon_rctl_t to be destroyed.
01040         \return Zero if successful, -1 otherwise.
01041 */
01042 LBMExpDLL int lbmmon_rctl_destroy(lbmmon_rctl_t * Control);
01043 
01044 /*!     \brief Gather statistics for on-demand objects.
01045 
01046         \param Control Pointer to an existing ::lbmmon_sctl_t controller.
01047         \return Zero if successful, -1 otherwise.
01048 */      
01049 LBMExpDLL int lbmmon_sctl_sample(lbmmon_sctl_t * Control);
01050 
01051 /*!     \brief Extended gather statistics for on-demand objects.
01052 
01053         \param Control Pointer to an existing ::lbmmon_sctl_t controller.
01054         \param ApplicationSourceID Null-terminated string containing an
01055                 application-specified source identifier.
01056                 This overrides any application source ID passed to any of
01057                 the lbmmon_*_monitor() functions for this call only.
01058                 If a NULL pointer or an empty string is passed,
01059                 the original application source ID will be used.
01060         \return Zero if successful, -1 otherwise.
01061 */      
01062 LBMExpDLL int lbmmon_sctl_sample_ex(lbmmon_sctl_t * Control, const char * ApplicationSourceID);
01063 
01064 /*!     \brief Retrieve the IPV4 sender address attribute from the statistics
01065                 attribute block.
01066 
01067         \param AttributeBlock Pointer to the attribute block as passed to the callback function.
01068         \param Address Pointer to a 32-bit integer to receive the IPV4 address in network
01069                 order.
01070         \return 0 if successful, -1 if the attribute does not exist.
01071 */
01072 LBMExpDLL int lbmmon_attr_get_ipv4sender(const void * AttributeBlock,
01073                                                                                  lbm_uint_t * Address);
01074 
01075 /*!     \brief Retrieve the timestamp attribute from the statistics attribute block.
01076 
01077         \param AttributeBlock Pointer to the attribute block as passed to the callback function.
01078         \param Timestamp Pointer to a \c time_t to receive the timestamp.
01079         \return 0 if successful, -1 if the attribute does not exist.
01080 */
01081 LBMExpDLL int lbmmon_attr_get_timestamp(const void * AttributeBlock,
01082                                                                                 time_t * Timestamp);
01083 
01084 /*!     \brief Retrieve the application source ID attribute from the statistics attribute block.
01085 
01086         \param AttributeBlock Pointer to the attribute block as passed to the callback function.
01087         \param ApplicationSourceID Pointer to a buffer to receive the application source ID as
01088                 a null-terminated string.
01089         \param Length Maximum length of \a ApplicationSourceID
01090         \return 0 if successful, -1 if the attribute does not exist.
01091 */
01092 LBMExpDLL int lbmmon_attr_get_appsourceid(const void * AttributeBlock,
01093                                                                                   char * ApplicationSourceID,
01094                                                                                   size_t Length);
01095 
01096 /*!     \brief Retrieve the object ID attribute from the statistics attribute block.
01097 
01098         \param AttributeBlock Pointer to the attribute block as passed to the callback function.
01099         \param ObjectID Pointer to a variable to receive the object ID.
01100         \return 0 if successful, -1 if the attribute does not exist.
01101 */
01102 LBMExpDLL int lbmmon_attr_get_objectid(const void * AttributeBlock,
01103                                                                            lbm_ulong_t * ObjectID);
01104 
01105 /*!     \brief Retrieve the context ID attribute from the statistics attribute block.
01106 
01107         \param AttributeBlock Pointer to the attribute block as passed to the callback function.
01108         \param ContextID Pointer to a variable to receive the context ID.
01109         \return 0 if successful, -1 if the attribute does not exist.
01110         \deprecated Use ::lbmmon_attr_get_objectid instead.
01111 */
01112 LBMExpDLL int lbmmon_attr_get_contextid(const void * AttributeBlock,
01113                                                                                 lbm_ulong_t * ContextID);
01114 
01115 /*!     \brief Retrieve the process ID attribute from the statistics attribute block.
01116 
01117         \param AttributeBlock Pointer to the attribute block as passed to the callback function.
01118         \param ProcessID Pointer to a variable to receive the process ID.
01119         \return 0 if successful, -1 if the attribute does not exist.
01120 */
01121 LBMExpDLL int lbmmon_attr_get_processid(const void * AttributeBlock,
01122                                                                                 lbm_ulong_t * ProcessID);
01123 
01124 /*!     \brief Retrieve the source attribute from the statistics attribute block.
01125 
01126         \param AttributeBlock Pointer to the attribute block as passed to the callback function.
01127         \param Source Pointer to a variable to receive the source flag.
01128         \return 0 if successful, -1 if the attribute does not exist.
01129 */
01130 LBMExpDLL int lbmmon_attr_get_source(const void * AttributeBlock,
01131                                                                          lbm_ulong_t * Source);
01132 
01133 /*!     \brief Retrieve the error number for the last error encountered.
01134 
01135         \return The last error encountered. See LBMMON_ERR_*.
01136 */
01137 LBMExpDLL int lbmmon_errnum(void);
01138 
01139 /*!     \brief Retrieve the error message for the last error encountered.
01140 
01141         \return A pointer to a static character array containing the last error message.
01142 */
01143 LBMExpDLL const char * lbmmon_errmsg(void);
01144 
01145 /*!     \brief Retrieve the next key/value pair from a semicolon-separated list.
01146 
01147         This is a convenience utility function to facilitate processing of a
01148         semicolon-separated list of key/value pairs. Each pair is of the form "key=value".
01149         \param String A pointer to the unprocessed part of the semicolon-separated list.
01150         \param Key Pointer to a character string into which is written the null-terminated key.
01151         \param KeySize Maximum length of \a Key.
01152         \param Value Pointer to a character string into which is written the null-terminated value.
01153         \param ValueSize Maximum length of \a Value.
01154         \return \c NULL if no key/value pair is found.
01155                 Otherwise a pointer to the remainder of the string, to be passed to subsequent
01156                 calls to lbmmon_next_key_value_pair().
01157 */
01158 const char * lbmmon_next_key_value_pair(const char * String,
01159                                                                                 char * Key,
01160                                                                                 size_t KeySize,
01161                                                                                 char * Value,
01162                                                                                 size_t ValueSize);
01163 
01164 #if defined(__cplusplus)
01165 }
01166 #endif /* __cplusplus */
01167 
01168 #include <lbm/lbmmonfmtcsv.h>
01169 #include <lbm/lbmmontrlbm.h>
01170 #include <lbm/lbmmontrudp.h>
01171 #include <lbm/lbmmontrlbmsnmp.h>
01172 
01173 #endif
01174 

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