UM C API  6.16
Source code for lbmmonfmtcsv.h
/** \file lbmmonfmtcsv.h
\brief Ultra Messaging (UM) Monitoring API
\author David K. Ameiss - Informatica Inc.
\version $Id: //UMprod/DEV_HF_6_16/29West/lbm/src/mon/lbm/lbmmonfmtcsv.h#1 $
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 Inc. Ultra Messaging Releases
Copyright (C) Informatica Inc. 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 Inc.
(C) Copyright 2006,2023 Informatica Inc. 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.
*/
#ifndef LBMMONFMTCSV_H
#define LBMMONFMTCSV_H
#include <stdlib.h>
#ifdef _WIN32
#include <winsock2.h>
#endif
#include <lbm/lbmmon.h>
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
/*! \brief Return a pointer to the LBMMON_FORMAT_CSV module structure.
\return Pointer to LBMMON_FORMAT_CSV.
*/
LBMExpDLL const lbmmon_format_func_t * lbmmon_format_csv_module(void);
/*! \brief Initialize the CSV format module.
\param FormatClientData A pointer which may be filled in
(by this function)
with a pointer to format-specific client data.
\param FormatOptions The FormatOptions argument originally passed to
lbmmon_sctl_create() or lbmmon_rctl_create().
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_format_csv_init(void * * FormatClientData,
const void * FormatOptions);
/*! \brief Serialize an ::lbm_rcv_transport_stats_t structure to CSV.
\param Destination A pointer to a buffer to receive the serialized format
of the ::lbm_rcv_transport_stats_t statistics.
\param Size A pointer to a \c 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.
\param ModuleID A pointer to an \c unsigned \c 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).
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
from which to take packet attributes.
\param Statistics A pointer to an ::lbm_rcv_transport_stats_t structure
to be serialized.
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_rcv_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
const lbm_rcv_transport_stats_t * Statistics,
void * FormatClientData);
/*! \brief Serialize an ::lbm_src_transport_stats_t structure to CSV.
\param Destination A pointer to a buffer to receive the serialized format
of the ::lbm_src_transport_stats_t statistics.
\param Size A pointer to a \c 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.
\param ModuleID A pointer to an \c unsigned \c 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).
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
from which to take packet attributes.
\param Statistics A pointer to an ::lbm_src_transport_stats_t structure to be
serialized.
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_src_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
const lbm_src_transport_stats_t * Statistics,
void * FormatClientData);
/*! \brief Serialize an ::lbm_event_queue_stats_t structure to CSV.
\param Destination A pointer to a buffer to receive the serialized format
of the ::lbm_event_queue_stats_t statistics.
\param Size A pointer to a \c 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.
\param ModuleID A pointer to an \c unsigned \c 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).
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
from which to take packet attributes.
\param Statistics A pointer to an ::lbm_event_queue_stats_t structure
to be serialized.
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_evq_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
const lbm_event_queue_stats_t * Statistics,
void * FormatClientData);
/*! \brief Serialize an ::lbm_context_stats_t structure to CSV.
\param Destination A pointer to a buffer to receive the serialized format
of the ::lbm_context_stats_t statistics.
\param Size A pointer to a \c 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.
\param ModuleID A pointer to an \c unsigned \c 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).
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
from which to take packet attributes.
\param Statistics A pointer to an ::lbm_context_stats_t structure
to be serialized.
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_ctx_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
const lbm_context_stats_t * Statistics,
void * FormatClientData);
/*! \brief Deserialize a buffer from CSV into an ::lbm_rcv_transport_stats_t
structure.
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
for storing the deserialized packet attributes.
\param Statistics A pointer to an ::lbm_rcv_transport_stats_t structure into
which the data is deserialized.
\param Source A pointer to a buffer containing the serialized data.
\param Length The length of the serialized data.
\param 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).
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the deserialized data will not be delivered to the application.
*/
LBMExpDLL int lbmmon_rcv_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
lbm_rcv_transport_stats_t * Statistics,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Deserialize a buffer from CSV into an ::lbm_src_transport_stats_t
structure.
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
for storing the deserialized packet attributes.
\param Statistics A pointer to an ::lbm_src_transport_stats_t structure
into which the data is deserialized.
\param Source A pointer to a buffer containing the serialized data.
\param Length The length of the serialized data.
\param 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).
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the deserialized data will not be delivered to the application.
*/
LBMExpDLL int lbmmon_src_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
lbm_src_transport_stats_t * Statistics,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Deserialize a buffer from CSV into an ::lbm_event_queue_stats_t
structure.
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
for storing the deserialized packet attributes.
\param Statistics A pointer to an ::lbm_event_queue_stats_t structure into
which the data is deserialized.
\param Source A pointer to a buffer containing the serialized data.
\param Length The length of the serialized data.
\param 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).
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the deserialized data will not be delivered to the application.
*/
LBMExpDLL int lbmmon_evq_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
lbm_event_queue_stats_t * Statistics,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Deserialize a buffer from CSV into an ::lbm_context_stats_t
structure.
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
for storing the deserialized packet attributes.
\param Statistics A pointer to an ::lbm_context_stats_t structure into
which the data is deserialized.
\param Source A pointer to a buffer containing the serialized data.
\param Length The length of the serialized data.
\param 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).
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the deserialized data will not be delivered to the application.
*/
LBMExpDLL int lbmmon_ctx_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
lbm_context_stats_t * Statistics,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Serialize receiver topic statistics.
\param Destination A pointer to a buffer to receive the serialized format
of the lbm_context_stats_t statistics.
\param Size A pointer to a \c 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.
\param ModuleID A pointer to an \c unsigned \c 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).
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
from which to take packet attributes.
\param Topic A NUL-terminated string containing the topic.
\param SourceCount The number of sources in the \a Sources array.
\param Sources An array of ::lbm_rcv_topic_stats_t structures containing
the sources to which the receiver is joined.
\param FormatClientData A pointer to format-specific client data as
returned by the ::lbmmon_format_init_t function.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_rcv_topic_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
const char * Topic,
lbm_ulong_t SourceCount,
const lbm_rcv_topic_stats_t * Sources,
void * FormatClientData);
/*! \brief Deserialize a buffer into an ::lbm_rcv_topic_stats_t structure.
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
for storing the deserialized packet attributes.
\param Count A pointer to an integer containing the number of elements in the
\a Statistics array. On exit, it will contain the actual number of elements parsed.
\param Statistics An array of ::lbm_rcv_topic_stats_t elements into which is written the
actual deserialized data.
\param Source A pointer to a buffer containing the serialized data.
\param Length The length of the serialized data.
\param 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).
\param FormatClientData A pointer to format-specific client data as
returned by the ::lbmmon_format_init_t function.
\return Zero if successful, -2 if \a Count is not large enough for all elements, -1 otherwise.
If -2 is returned, \a Count will contain the number of elements required.
If -1 is returned,
the deserialized data will not be delivered to the application.
*/
LBMExpDLL int lbmmon_rcv_topic_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
size_t * Count,
lbm_rcv_topic_stats_t * Statistics,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Serialize wildcard receiver statistics.
\param Destination A pointer to a buffer to receive the serialized format
of the lbm_wildcard_rcv_stats_t statistics.
\param Size A pointer to a \c 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.
\param ModuleID A pointer to an \c unsigned \c 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).
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
from which to take packet attributes.
\param Statistics A pointer to an lbm_wildcard_rcv_stats_t structure to
be serialized.
\param FormatClientData A pointer to format-specific client data as
returned by the ::lbmmon_format_init_t function.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_wildcard_rcv_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
const lbm_wildcard_rcv_stats_t * Statistics,
void * FormatClientData);
/*! \brief Deserialize a buffer into an ::lbm_wildcard_rcv_stats_t structure.
\param Attributes A pointer to a lbmmon_packet_attributes_t structure
for storing the deserialized packet attributes.
\param Statistics A pointer to an lbm_wildcard_rcv_stats_t structure into
which the data is deserialized.
\param Source A pointer to a buffer containing the serialized data.
\param Length The length of the serialized data.
\param 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).
\param FormatClientData A pointer to format-specific client data as
returned by the ::lbmmon_format_init_t function.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the deserialized data will not be delivered to the application.
*/
LBMExpDLL int lbmmon_wildcard_rcv_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
lbm_wildcard_rcv_stats_t * Statistics,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Serialize in CSV format not supported for stores.
\return -1
*/
LBMExpDLL int lbmmon_store_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
Lbmmon__UMPMonMsg * StoreMsg,
int Action,
void * FormatClientData);
/*! \brief Deserialize in CSV format not supported for stores.
\return -1
*/
LBMExpDLL int lbmmon_store_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
Lbmmon__UMPMonMsg ** StoreMsg,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Serialize in CSV format not supported for gateways.
\return -1
*/
LBMExpDLL int lbmmon_gateway_format_csv_serialize(char * Destination,
size_t * Size,
unsigned short * ModuleID,
const lbmmon_packet_attributes_t * Attributes,
Lbmmon__DROMonMsg * GatewayMsg,
void * FormatClientData);
/*! \brief Deserialize in CSV format not supported for gateways.
\return -1
*/
LBMExpDLL int lbmmon_gateway_format_csv_deserialize(lbmmon_packet_attributes_t * Attributes,
Lbmmon__DROMonMsg ** GatewayMsg,
const char * Source,
size_t Length,
unsigned short ModuleID,
void * FormatClientData);
/*! \brief Finish CSV format module processing.
\param FormatClientData A pointer to format-specific client data.
\return Zero if successful, -1 otherwise.
If -1 is returned,
the serialized data will not be sent.
*/
LBMExpDLL int lbmmon_format_csv_finish(void * FormatClientData);
/*! \brief Return a messages describing the last error encountered.
\return A string containing a description of the last error encountered by the module.
*/
LBMExpDLL const char * lbmmon_format_csv_errmsg(void);
#if defined(__cplusplus)
}
#endif /* __cplusplus */
#endif