|
Telescience Resource Kit
TReK ANSI-C
5.4.0 ART
|
The commonly shared macros, structures and functions. More...
#include "trek_ionizer_defines.h"
Data Structures | |
struct | ion_stats |
Holds count/byte information for single comm statistics line. More... | |
struct | ion_comm_statistics |
All communication statistics for the local ION node. More... | |
Typedefs | |
typedef void(* | InfoCallback) (const struct tm *occur_time, const char *msg) |
Callback function for information messages in the ion.log file. More... | |
typedef void(* | WarningCallback) (const struct tm *occur_time, const char *msg) |
Callback function for warning messages in the ion.log file. More... | |
typedef void(* | DiagnosticCallback) (const struct tm *occur_time, const char *msg) |
Callback function for diagnostic messages in the ion.log file. More... | |
typedef void(* | BundleStatusReportCallback) (const struct tm *occur_time, const char *msg) |
Callback function for bundle status report messages in the ion.log file. More... | |
typedef void(* | CommunicationStatisticsCallback) (const struct tm *occur_time, const struct ion_comm_statistics *ion_stats) |
Callback function for communication statistics in the ion.log file. More... | |
typedef void(* | FreeFormCallback) (const struct tm *occur_time, const char *msg) |
Callback function for unclassified messages in the ion.log file. More... | |
typedef void(* | ReadErrorCallback) (const struct tm *occur_time, const char *msg) |
Callback function for read errors in the ion.log file. More... | |
typedef void(* | MissingProcessCallback) (const struct tm *occur_time, const char *process, unsigned int expected, unsigned int found) |
Callback function for detection of missing processes. More... | |
typedef void(* | IonNodeConnectionCallback) (unsigned int local_node_number, unsigned int remote_node_number, const char *ip_addr, unsigned short port, unsigned short connected) |
Callback function for change of state of an ION connection. More... | |
Functions | |
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.log file. More... | |
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.log file. More... | |
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.log file. More... | |
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.log file. More... | |
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.log file. More... | |
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.log file. More... | |
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.log file. More... | |
void EXPORT_THIS_IONIZER_C_FUNCTION | RegisterMissingProcessCallback (MissingProcessCallback function_ptr) |
Registers a function that will be called whenever a process is detected as missing. More... | |
void EXPORT_THIS_IONIZER_C_FUNCTION | RegisterIonNodeConnectionCallback (IonNodeConnectionCallback function_ptr) |
Registers a function that will be called whenever a process is detected as missing. More... | |
int EXPORT_THIS_IONIZER_C_FUNCTION | WatchIonLog (const char *ion_working_dir) |
Starts monitoring the ion.log file for messages. More... | |
int EXPORT_THIS_IONIZER_C_FUNCTION | StopIonLogWatch () |
Stops monitoring the ion.log file. More... | |
int EXPORT_THIS_IONIZER_C_FUNCTION | WatchIonProcesses (const char *ion_working_dir) |
Starts monitoring expected processes for ION. More... | |
int EXPORT_THIS_IONIZER_C_FUNCTION | StopIonProcessWatch () |
Stops monitoring expected processes for ION. More... | |
int EXPORT_THIS_IONIZER_C_FUNCTION | WatchIonConnection (const char *ion_working_dir) |
Starts monitoring connections for ION. More... | |
int EXPORT_THIS_IONIZER_C_FUNCTION | StopIonConnectionWatch () |
Stops monitoring for ION TCP connections. More... | |
The commonly shared macros, structures and functions.
typedef void(* BundleStatusReportCallback) (const struct tm *occur_time, const char *msg) |
Callback function for bundle status report messages in the ion.log file.
[in] | occur_time | The time stamp from the log file. |
[in] | msg | Message from the log file. |
typedef void(* CommunicationStatisticsCallback) (const struct tm *occur_time, const struct ion_comm_statistics *ion_stats) |
Callback function for communication statistics in the ion.log file.
The statistics span multiple lines in the log file and are collected into the structure
[in] | occur_time | The time stamp from the log file. |
[in] | ion_stats | The communcation statistics. |
typedef void(* DiagnosticCallback) (const struct tm *occur_time, const char *msg) |
Callback function for diagnostic messages in the ion.log file.
[in] | occur_time | The time stamp from the log file. |
[in] | msg | Message from the log file. |
typedef void(* FreeFormCallback) (const struct tm *occur_time, const char *msg) |
Callback function for unclassified messages in the ion.log file.
[in] | occur_time | The time stamp from the log file. |
[in] | msg | Message from the log file. |
typedef void(* InfoCallback) (const struct tm *occur_time, const char *msg) |
Callback function for information messages in the ion.log file.
[in] | occur_time | The time stamp from the log file. |
[in] | msg | Message from the log file. |
typedef void(* IonNodeConnectionCallback) (unsigned int local_node_number, unsigned int remote_node_number, const char *ip_addr, unsigned short port, unsigned short connected) |
Callback function for change of state of an ION connection.
TCP and STCP connections from ION to other nodes are monitored and change of states are reported through this callback. You can optionally register for an initial state callback for each connection.
[in] | local_node_number | The node number of the local computer. |
[in] | remote_node_number | The node number for the HOSC DTN gateway. |
[in] | ip_addr | The IP address of the remote node |
[in] | port | The port number of the remote node |
[in] | connected | Set to 1 if connected, otherwise will be zero |
typedef void(* MissingProcessCallback) (const struct tm *occur_time, const char *process, unsigned int expected, unsigned int found) |
Callback function for detection of missing processes.
This callback is generated for each missing process when the expected number of processes does not equal the amount found. It is possible for more processes to be found than is expected. This is most likely to occur if you run multiple instances of ION on the same computer.
[in] | occur_time | The time stamp from the operation system when the message occured. |
[in] | process | The name of the process that is missing. |
[in] | expected | The number of expected instances of the process. |
[in] | found | The number of instances of the process found. |
typedef void(* ReadErrorCallback) (const struct tm *occur_time, const char *msg) |
Callback function for read errors in the ion.log file.
Read errors occur when the format of the ion.log file is unreadable. This is most likely caused by two ION processes' messages being written to the file.
[in] | occur_time | The time stamp when the read error occurred obtained from the operation system. |
[in] | msg | Message from the log file. |
typedef void(* WarningCallback) (const struct tm *occur_time, const char *msg) |
Callback function for warning messages in the ion.log file.
[in] | occur_time | The time stamp from the log file. |
[in] | msg | Message from the log file. |
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.log file.
Registers the specified function which will be called whenever ION writes a bundle status report to the ion.log file. This callback will only be generated if WatchIonLog() has been called. The callback will continue to be triggered for each bundle status report until you call StopIonLogWatch() or unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
From the ION documentation:
A bundle status report (BSR) message informs the user of the arrival of a BSR.
[in] | function_ptr | The function to handle the callback. |
Example:
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.log file.
Registers the specified function which will be called whenever ION writes communication statistics to the ion.log file. This callback will only be generated if WatchIonLog() has been called. The callback will continue to be triggered for each information message until you call StopIonLogWatch() or unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
From the ION documentation:
Communication statistics messages are reports of network performance for each of eight different types of network activity.
[in] | function_ptr | The function to handle the callback. |
Example:
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.log file.
Registers the specified function which will be called whenever ION writes a diagnostic message to the ion.log file. This callback will only be generated if WatchIonLog() has been called. The callback will continue to be triggered for each diagnostic message until you call StopIonLogWatch() or unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
From the ION documentation:
Diagnostic messages are generated to inform the user of the occurrence of events that are off-nominal and might be due to errors in the software. The generated message will contain the source file and line number where the error was generated. If reporting this error, please include this information.
[in] | function_ptr | The function to handle the callback. |
Example:
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.log file.
Registers the specified function which will be called whenever ION writes a free form message to the ion.log file. This callback will only be generated if WatchIonLog() has been called. The callback will continue to be triggered for each free form message until you call StopIonLogWatch() or unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. |
Example:
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.log file.
Registers the specified function which will be called whenever ION writes an information message to the ion.log file. This callback will only be generated if WatchIonLog() has been called. The callback will continue to be triggered for each information message until you call StopIonLogWatch() or unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
From the ION documentation:
Information messages are generated for events that are nominal, but significant. The include the termination of a daemon or the production of a congestion forecast.
[in] | function_ptr | The function to handle the callback. |
Example:
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterIonNodeConnectionCallback | ( | IonNodeConnectionCallback | function_ptr | ) |
Registers a function that will be called whenever a process is detected as missing.
Registers the specified function which will be called whenever an ION process is not running as expected. For details on which processes are monitored see WatchIonProcesses(). The callback will include a process name as well as the number of expected processes and the number of processes with that name currently executing. The callback will continue to be triggered until the probem is solved or you unregister for the callback.
You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. |
Example:
void EXPORT_THIS_IONIZER_C_FUNCTION RegisterMissingProcessCallback | ( | MissingProcessCallback | function_ptr | ) |
Registers a function that will be called whenever a process is detected as missing.
Registers the specified function which will be called whenever an ION process is not running as expected. For details on which processes are monitored see WatchIonProcesses(). The callback will include a process name as well as the number of expected processes and the number of processes with that name currently executing. The callback will continue to be triggered until the probem is solved or you unregister for the callback.
You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. |
Example:
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.log file.
Registers the specified function which will be called whenever ION writes message to the ion.log file and the message is not properly formatted. This callback will only be generated if WatchIonLog() has been called. The callback will continue to be triggered for each read error message until you call StopIonLogWatch() or unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. |
Example:
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.log file.
Registers the specified function which will be called whenever ION writes a warning message to the ion.log file. This callback will only be generated if WatchIonLog() has been called. The callback will continue to be triggered for each warning message until you call StopIonLogWatch() or unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
From the ION documentation:
Warning messages inform the user of the occurrence of events that are off-nominal but are likely caused by configuration or operational errors rather than software failure.
[in] | function_ptr | The function to handle the callback. |
Example:
int EXPORT_THIS_IONIZER_C_FUNCTION StopIonConnectionWatch | ( | ) |
Stops monitoring for ION TCP connections.
Deletes the thread associated with monitoring the connections created by WatchIonConnection(). The functions registered for each log message type will no longer be called.
Example:
int EXPORT_THIS_IONIZER_C_FUNCTION StopIonLogWatch | ( | ) |
Stops monitoring the ion.log file.
Deletes the thread associated with monitoring the ion.log file created by WatchIonLog(). The functions registered for each log message type will no longer be called.
Example:
int EXPORT_THIS_IONIZER_C_FUNCTION StopIonProcessWatch | ( | ) |
Stops monitoring expected processes for ION.
Deletes the thread associated with monitoring ION processes created by WatchIonProcesses(). The function registered with RegisterMissingProcessCallback() will no longer be called.
Example:
int EXPORT_THIS_IONIZER_C_FUNCTION WatchIonConnection | ( | const char * | ion_working_dir | ) |
Starts monitoring connections for ION.
Starts a thread to monitor the connections that are part of the ION configuration. Only outgoing connections are monitored.
You can stop monitoring the exptected processes using StopIonConnectionWatch().
[in] | ion_working_dir | The directory contains ION files. |
Example:
int EXPORT_THIS_IONIZER_C_FUNCTION WatchIonLog | ( | const char * | ion_working_dir | ) |
Starts monitoring the ion.log file for messages.
Starts a thread to monitor the ion.log file. This function expects that the ion.log file is in the specified directory.
You can stop monitoring the ion.log using StopIonLogWatch().
[in] | ion_working_dir | The directory contains ION files including ion.log. |
Example:
int EXPORT_THIS_IONIZER_C_FUNCTION WatchIonProcesses | ( | const char * | ion_working_dir | ) |
Starts monitoring expected processes for ION.
Starts a thread to monitor the operating system for the expected processes related to ION. This function expects that a file named process.txt to be defined in the ION working directory. This file is automatically generated for you if you use IONconfig that is part of the install.
You can stop monitoring the exptected processes using StopIonProcessWatch().
[in] | ion_working_dir | The directory contains ION files including process.txt. |
Example: