#ifdef _WIN32
#include <Windows.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <sys/timeb.h>
void MyInfoCallback(const struct tm *occur_time, const char *msg)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Info: %s\n", occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec,
msg );
}
void MyWarningCallback(const struct tm *occur_time, const char *msg)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Warn: %s\n", occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec,
msg );
}
void MyDiagnosticCallback(const struct tm *occur_time, const char *msg)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Diag: %s\n", occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec,
msg );
}
void MyBundleStatusReportCallback(const struct tm *occur_time, const char *msg)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Bund: %s\n", occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec,
msg );
}
void MyCommStatsCallback
(
const struct tm *occur_time,
)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Comm:\n", occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec );
}
void MyFreeFormCallback(const struct tm *occur_time, const char *msg)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Free: %s\n", occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec,
msg );
}
void MyReadErrorCallback(const struct tm *occur_time, const char *msg)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Read: %s\n", occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec,
msg );
}
void MyMissingProcessCallback
(
const struct tm *occur_time,
const char *process,
unsigned int number_expected,
unsigned int number_found
)
{
printf("%04u-%02u-%02u %02u:%02u:%02u Missing process...\n",
occur_time->tm_year,
occur_time->tm_mon,
occur_time->tm_mday,
occur_time->tm_hour,
occur_time->tm_min,
occur_time->tm_sec );
printf("Found %u of %u for %s\n", number_found, number_expected, process );
}
int main()
{
int ret_value;
const char *ion_dir_path = "d:/two_node_shutdown/node_1";
if( ret_value )
{
printf("Error %d: WatchIonLog function failed.\n", ret_value );
return 1;
}
if( ret_value )
{
printf("Error %d: RegisterMissingProcessCallback function failed.\n", ret_value );
return 1;
}
char buf[1000];
scanf( "%s", buf );
return 0;
if( ret_value )
{
printf("Error %d: StopIonLogWatch failed.\n", ret_value);
}
if( ret_value )
{
printf("Error %d: StopIonProcessWatch failed.\n", ret_value);
}
return 0;
}
All communication statistics for the local ION node.
Definition: trek_ionizer_api.h:25
Holds count/byte information for single comm statistics line.
Definition: trek_ionizer_api.h:12
unsigned int totalBytes
Total bytes.
Definition: trek_ionizer_api.h:20
unsigned int firstCount
Priority-0 (bulk) bundle count.
Definition: trek_ionizer_api.h:13
unsigned int totalCount
Total bundle count.
Definition: trek_ionizer_api.h:19
unsigned int thirdCount
Priority-2 (expedited) bundle count.
Definition: trek_ionizer_api.h:17
unsigned int firstBytes
Priority-0 (bulk) bytes.
Definition: trek_ionizer_api.h:14
unsigned int secondCount
Priority-1 (standard) bundle count.
Definition: trek_ionizer_api.h:15
unsigned int secondBytes
Priority-1 (standard) bytes.
Definition: trek_ionizer_api.h:16
unsigned int thirdBytes
Priority-2 (expedited) bytes.
Definition: trek_ionizer_api.h:18
The commonly shared macros, structures and functions.
int EXPORT_THIS_IONIZER_C_FUNCTION WatchIonLog(const char *ion_working_dir)
Starts monitoring the ion.log file for messages.
Definition: trek_ionizer_api.cpp:1017
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterDiagnosticCallback(DiagnosticCallback function_ptr)
Registers a function that will be called whenever a diagnostic message is generated in the ion....
Definition: trek_ionizer_api.cpp:169
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterInfoCallback(InfoCallback function_ptr)
Registers a function that will be called whenever an information message is generated in the ion....
Definition: trek_ionizer_api.cpp:90
int EXPORT_THIS_IONIZER_C_FUNCTION StopIonLogWatch()
Stops monitoring the ion.log file.
Definition: trek_ionizer_api.cpp:1125
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterFreeFormCallback(FreeFormCallback function_ptr)
Registers a function that will be called whenever a free form message is generated in the ion....
Definition: trek_ionizer_api.cpp:288
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterReadErrorCallback(ReadErrorCallback function_ptr)
Registers a function that will be called whenever an error occurs while attempting to read the ion....
Definition: trek_ionizer_api.cpp:322
int EXPORT_THIS_IONIZER_C_FUNCTION StopIonProcessWatch()
Stops monitoring expected processes for ION.
Definition: process_functions.cpp:536
int EXPORT_THIS_IONIZER_C_FUNCTION WatchIonProcesses(const char *ion_working_dir)
Starts monitoring expected processes for ION.
Definition: process_functions.cpp:278
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterCommunicationStatisticsCallback(CommunicationStatisticsCallback function_ptr)
Registers a function that will be called whenever communication statistics are generated in the ion....
Definition: trek_ionizer_api.cpp:252
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterBundleStatusReportCallback(BundleStatusReportCallback function_ptr)
Registers a function that will be called whenever a bundle status report is generated in the ion....
Definition: trek_ionizer_api.cpp:207
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterWarningCallback(WarningCallback function_ptr)
Registers a function that will be called whenever a warning message is generated in the ion....
Definition: trek_ionizer_api.cpp:129
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterMissingProcessCallback(MissingProcessCallback function_ptr)
Registers a function that will be called whenever a process is detected as missing.
Definition: process_functions.cpp:86