/** \file lbmmonfmtcsv.h \brief Ultra Messaging (UM) Monitoring API \author David K. Ameiss - Informatica Corporation \version $Id: //UMprod/REL_5_3_6/29West/lbm/src/mon/lbm/lbmmonfmtcsv.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. */ #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 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 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 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 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 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 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 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 lbm_context_stats_t * Statistics, void * FormatClientData); /*! \brief Deserialize a buffer from CSV into an ::lbm_rcv_transport_stats_t structure. \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(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 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(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 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(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 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(lbm_context_stats_t * Statistics, 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