TReK ANSI-C  5.3.3
All ANSI-C APIs
trek_cfdp_console.cpp
// ////////////////////////////////////////////////////////////////////////////
//
// The CFDP console application demonstrates how to use a variety CFDP and
// DS API functions.
//
// The default configuration path and file is ./toolkit_cfdp_config.txt.
//
// ////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include "ds_shared.h"
#include "trek_toolkit_common_api.h"
#include "bp_shared.h"
#include "trek.h"
#include <string>
#ifdef _WIN32
#include <windows.h>
#endif
using namespace std;
boolean_type display_console_help_menu_flag;
unsigned int message_mask;
bool suspend_flag;
device_mode_type device_mode;
// ////////////////////////////////////////////////////////////////////////////
//
// PrintTheMessage controls how messages are processed and displayed to
// the user.
//
// ////////////////////////////////////////////////////////////////////////////
void PrintTheMessage(message_struct_type *mess_struct_ptr)
{
if (mess_struct_ptr->category & message_mask)
{
printf("%s%s\n",
mess_struct_ptr->message);
}
}
// ////////////////////////////////////////////////////////////////////////////
//
// DeviceData's packet_buffer_ptr processes a cfdp_struct ptr defined as
// follows:
//
// char source_pathname[200];
// char destination_pathname[200];
// long long eid; (destination)
// char transaction_id[50];
// unsigned short percent_transferred;
// unsigned long bytes_transferred;
// unsigned long file_size;
// unsigned long cfdp_configuration; (e.g., DS_DEVICE_SENDING,
// DS_DEVICE_RECEIVING)
// unsigned long cfdp_status; (e.g., DS_PACKET_SENDING,
// DS_PACKET_RECEIVING,
// DS_SUSPEND, DS_RESUME,
// DS_REPORT,
// DS_CANCEL,
// DS_SUCCESS,
// DS_FAIL,
// DS_ABANDON,
// DS_UNKNOWN)
//
// The cfdp_struct can be used to determine each file's transactions ID as
// well as monitor a file's transfer status.
//
// ////////////////////////////////////////////////////////////////////////////
void DeviceData(const char *device_key,
int32_t packet_length,
uint8_t *packet_buffer_ptr)
{
unsigned int count;
cfdp_struct_type *cfdp_struct_ptr;
// Retrieve the individual cfdp structs from the packet_buffer;
for (count = 0; count*sizeof(cfdp_struct_type) < (unsigned int)packet_length; count++)
{
cfdp_struct_ptr = (cfdp_struct_type *)(packet_buffer_ptr + count*sizeof(cfdp_struct_type));
if (cfdp_struct_ptr->cfdp_status == DS_MESSAGE)
{
// Print user message
printf("Message %s\n",cfdp_struct_ptr->message);
}
else if (message_mask & MSG_CAT_PROGRESS)
{
// Only print the progress messages if the transaction is still sending or receiving packets
if (cfdp_struct_ptr->cfdp_status == DS_PACKET_SENDING || cfdp_struct_ptr->cfdp_status == DS_PACKET_RECEIVING || cfdp_struct_ptr->cfdp_status == DS_RESUME)
{
printf("Progress Transaction %s -> %s\t file size=%lld\t bytes trans=%lld\t percent trans=%u%%\n",
cfdp_struct_ptr->transaction_id,
cfdp_struct_ptr->destination_pathname,
cfdp_struct_ptr->file_size,
cfdp_struct_ptr->bytes_transferred,
cfdp_struct_ptr->percent_transferred);
}
}
}
}
// ////////////////////////////////////////////////////////////////////////////
//
// Find the individual arguments/tokens in a string. Arguments may be
// separated by one or more spaces
//
// ////////////////////////////////////////////////////////////////////////////
static void Argu( char *buffer,
uint32_t arg_size,
char *arg[],
uint32_t *arg_count)
{
char *token;
// Initialize the argument array
for (uint32_t i = 0; i < arg_size; i++)
{
arg[i] = NULL;
}
arg[0] = strtok(buffer," \r\n");
// Get the arguments
token = arg[0];
*arg_count=0;
while (token != NULL && *arg_count < arg_size)
{
arg[*arg_count] = token;
token = strtok(NULL," \r\n"); // NULL allows function to continue scanning
// where a previous call to function ended.
*arg_count += 1;
}
}
// ////////////////////////////////////////////////////////////////////////////
//
// Signal handler functions for windows and linux
//
// ////////////////////////////////////////////////////////////////////////////
#ifdef _WIN32
BOOL CtrlHandler( DWORD fdwCtrlType )
{
switch( fdwCtrlType )
{
case CTRL_BREAK_EVENT:
{
if (!suspend_flag)
{
suspend_flag = true;
}
printf("Info Suspend all CFDP transactions.\n");
return true;
}
default:
return FALSE;
}
}
#else
void SigHandler(int32_t sig)
{
if (!suspend_flag)
{
suspend_flag = true;
}
printf("\nInfo Suspend all CFDP transactions.\n");
}
#endif
// ////////////////////////////////////////////////////////////////////////////
//
// Help menu
//
// ////////////////////////////////////////////////////////////////////////////
static void HelpCfdp()
{
printf("**************************************************** Command Primitives For The CFDP Console Application ****************************************************\n\n");
if (device_mode == DM_NATIVE_CFDP)
{
/*
printf("\tTo put a file on another platform put <class1,class2> <\"source pathname\"> <destination entity id> <\"destination pathname\">\n");
printf("\t (e.g., put class2 \"D:/fileA.txt\" 2 \"D:/fileB.txt\")\n");
printf("\tTo put a directory of files on another platform put <class1,class2> <\"source pathname\"> <destination entity id> <\"destination pathname\">\n");
printf("\t (e.g., put class2 \"/home/user/\" 2 \"D:/\")\n");
printf("\tTo get a file from another platform get <class1,class2> <\"source pathname\"> <source entity id> <\"destination pathname\">\n");
printf("\t (e.g., get class2 \"/home/user/fileB.txt\" 2 \"D:/fileA.txt\")\n");
printf("\tTo get a directory of files from another platform get <class1,class2> <\"source pathname\"> <source entity id> <\"destination pathname\">\n");
printf("\t (e.g., get class2 \"D:/fileA.txt\" 2 \"/home/user/\")\n");
printf("\tTo add a put primitive to a list add put <class1,class2> <\"source pathname\"> <destination entity id> <\"destination pathname\">\n");
printf("\t (e.g., add put class2 \"D:/fileA.txt\" 2 \"D:/fileB.txt\")\n");
printf("\tTo add a get primitive to a list add get <class1,class2> <\"source pathname\"> <source entity id> <\"destination pathname\">\n");
printf("\t (e.g., add get class2 \"/home/user/fileA.txt\" 2 \"/home/user/fileB.txt\")\n");
*/
printf("\tTo execute a CFDP primitive <action> <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\t put file example: put <class1,class2> \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t put directory of files example: put <class1,class2> \"D:/test_dir/\" 100 \"D:/test_dir/\"\n");
printf("\t get file example: get <class1,class2> \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t get directory of files example: get <class1,class2> \"D:/test_dir/\" 100 \"D:/test_dir/\"\n");
printf("\t create file example: create_file <class1,class2> \"D:/test a\" 100 \n");
printf("\t rename file example: rename_file <class1,class2> \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t message example: message <class1,class2> \"Hello World\" 100 \n");
printf("\t bit rate example: bit_rate <class1,class1> 1000000 100 \n");
printf("\t close rec file example: close_rec_file <class1,class2> \"record library name\" 100 \"record file name\"\n");
printf("\t close rec file example: close_rec_file <class1,class2> \"record library name\" 100 \n"); // close all the record files in the record library
printf("\tTo add a CFDP primitive to a list add <action> <class1,class2> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\t add put example: add put <class1,class2> \"D:/test a/\" 100 \"D:/test b/\"\n");
printf("\t add get example: add get <class1,class2> \"D:/test a/\" 100 \"D:/test b/\"\n");
printf("\t add delete file example: add delete_file <class1,class2> \"D:/test a\" 100 \n");
printf("\t add append file example: add append_file <class1,class2> \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t add message example: add message <class1,class2> \"Goodbye World\" 100 \n");
printf("\t add bit rate example: add bit_rate <class1,class2> 1000000 100 \n");
printf("\t add close rec file example: add close_rec_file <class1,class2> \"record library name\" 100 \"record file name\"\n");
}
else if (device_mode == DM_ION_CFDP)
{
printf("\tTo execute a CFDP primitive <action> <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\t put example: put 86400/STD_PRIORITY/0/ASSURED/NOT_CRITICAL \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t put directory of files example: put 86400/STD_PRIORITY/0/ASSURED/NOT_CRITICAL \"D:/test_dir/\" 100 \"D:/test_dir/\"\n");
printf("\t get example: get / \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t get directory of files example: get / \"D:/test_dir/\" 100 \"D:/test_dir/\"\n");
printf("\t create file example: create_file /STD_PRIORITY/// \"D:/test a\" 100 \n");
printf("\t rename file example: rename_file //// \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t message example: message 3600////NOT_CRITICAL \"Hello World\" 100 \n");
printf("\t close rec file example: close_rec_file //// \"record library name\" 100 \"record file name\"\n");
printf("\t close rec file example: close_rec_file //// \"record library name\" 100 \n"); // close all the record files in the record library
printf("\tTo add a CFDP primitive to a list add <action> <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\t add put example: add put 86400/STD_PRIORITY/0/ASSURED/NOT_CRITICAL \"D:/test a/\" 100 \"D:/test b/\"\n");
printf("\t add get example: add get ///ASSURED_WITH_CUSTODY_TRANSFER/ \"D:/test a/\" 100 \"D:/test b/\"\n");
printf("\t add delete file example: add delete_file /STD_PRIORITY/// \"D:/test a\" 100 \n");
printf("\t add append file example: add append_file / \"D:/test a\" 100 \"D:/test b\"\n");
printf("\t add message example: add message 3600////NOT_CRITICAL \"Goodbye World\" 100 \n");
printf("\t add close rec file example: add close_rec_file //// \"record library name\" 100 \"record file name\"\n");
}
printf("\tTo display a list of CFDP primitive actions display actions\n");
printf("\tTo read a file of primitives and add to a list process <\"primitive pathname\">\n");
printf("\t (e.g., process \"./toolkit_cfdp_primitives.txt\")\n");
printf("\tTo remove all primitives from a list remove\n");
printf("\tTo send/execute all primitives in a list send\n");
printf("\tTo record all primitives in a list record prim <\"pathname\">\n");
printf("\t (e.g., record prim \"./cfdp_prim.txt\")\n");
printf("\tTo suspend all CFDP transactions windows os: ctrl-break or ctrl-fn-pause or ctrl-fn-right shift or suspend\n");
printf("\t linux os: ctrl-c or suspend\n");
printf("\tTo resume all CFDP transactions resume\n");
printf("\tTo cancel a CFDP transaction cancel <transaction id> (e.g., cancel 1_1)\n");
printf("\tTo cancel all CFDP transactions cancel all\n");
printf("\tTo report on a CFDP transaction report <transaction id> (e.g., report 1_1)\n");
printf("\tTo report on all CFDP transactions report all or r\n");
printf("\tTo display progress messages prog\n");
printf("\tTo stop displaying progress messages stop prog\n");
printf("\tTo log messages log <\"pathname\"> <log debug messages>\n" );
printf("\t (e.g., log \"./log.txt\" false)\n");
printf("\tTo stop logging messages stop log\n");
printf("\tTo record statistics snapshot stat <\"pathname\">\n");
printf("\t (e.g., stat \"./statistics.csv\")\n");
printf("\tTo stop recording statistics snapshot stop stat\n");
printf("\tTo reset statistics reset stat\n");
printf("\tTo record CFDP metrics snapshot metric <\"pathname\">\n");
printf("\t (e.g., metric \"./metrics.csv\")\n");
printf("\tTo stop recording CFDP metrics snapshot stop metric\n");
printf("\tTo reset CFDP metrics reset metric\n");
printf("\tTo reconfigure the CFDP console application reconfig <\"pathname\">\n");
printf("\t (e.g., reconfig \"./cfdp_config.txt\")\n");
printf("\tTo save the CFDP console configuration save <\"pathname\">\n");
printf("\t (e.g., save \"./cfdp_config.txt\")\n");
printf("\tTo display the CFDP console configuration display config\n");
printf("\tTo display CFDP console command primitives help\n");
printf("\tTo exit application exit or quit or q\n\n");
}
// ////////////////////////////////////////////////////////////////////////////
//
// CFDP action list
//
// ////////////////////////////////////////////////////////////////////////////
static void ActionCfdp()
{
if (device_mode == DM_NATIVE_CFDP)
{
printf("\n");
printf("\tput put <class1,class2> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\tget get <class1,class2> <\"source_pname\"> <source_node> <\"dest_pname\">\n");
printf("\tcreate_file create_file <class1,class2> <\"source_pname\"> <dest eid>\n");
printf("\tdelete_file delete_file <class1,class2> <\"source_pname\"> <dest eid>\n");
printf("\trename_file rename_file <class1,class2> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\tappend_file append_file <class1,class2> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\treplace_file replace_file <class1,class2> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\tcreate_dir create_dir <class1,class2> <\"source_pname\"> <dest eid>\n");
printf("\tremove_dir remove_dir <class1,class2> <\"source_pname\"> <dest eid>\n");
printf("\tdeny_file deny_file <class1,class2> <\"source_pname\"> <dest eid>\n");
printf("\tdeny_dir deny_dir <class1,class2> <\"source_pname\"> <dest eid>\n");
printf("\tmessage message <class1,class2> <\"message text\"> <dest eid>\n");
printf("\tbit_rate bit_rate <class1,class2> <bits per second> <dest eid>\n");
printf("\tclose_rec_file close_rec_file <class1,class2> <\"record library name\"> <dest eid> <\"record file name\">\n");
printf("\tclose_rec_file close_rec_file <class1,class2> <\"record library name\"> <dest eid> \n"); // close all the files in the record library
}
else if (device_mode == DM_ION_CFDP)
{
printf("\n");
printf("\tput put <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\tget get <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <source_node> <\"dest_pname\">\n");
printf("\tcreate_file create_file <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid>\n");
printf("\tdelete_file delete_file <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid>\n");
printf("\trename_file rename_file <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\tappend_file append_file <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\treplace_file replace_file <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid> <\"dest_pname\">\n");
printf("\tcreate_dir create_dir <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid>\n");
printf("\tremove_dir remove_dir <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid>\n");
printf("\tdeny_file deny_file <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid>\n");
printf("\tdeny_dir deny_dir <life>/<cos>/<ord>/<mode>/<criticality> <\"source_pname\"> <dest eid>\n");
printf("\tmessage message <life>/<cos>/<ord>/<mode>/<criticality> <\"message text\"> <dest eid>\n");
printf("\tclose_rec_file close_rec_file <life>/<cos>/<ord>/<mode>/<criticality> <\"record library name\"> <dest eid> <\"record file name\">\n");
printf("\tclose_rec_file close_rec_file <life>/<cos>/<ord>/<mode>/<criticality> <\"record library name\"> <dest eid> \n"); // close all the files in the record library
}
}
// ////////////////////////////////////////////////////////////////////////////
//
// Main with optional input defining pathname for the CFDP configuration file.
// The default CFDP configuration file pathname is "./toolkit_cfdp_config.txt".
//
// ////////////////////////////////////////////////////////////////////////////
int32_t main(int32_t argc, char *argv[])
{
bool exit_flag = false;
display_console_help_menu_flag = TRUE_OR_YES;
suspend_flag = false;
char config_pathname[1024];
string primitive_str;
string name;
string path_only;
string filename_only;
string pathname;
string path_name;
uint32_t primitive_count;
size_t found;
size_t next_found;
int return_code;
char command[1024];
char *arg[11];
uint32_t arg_count;
FILE *file_ptr = NULL;
string path;
string crypt_user_passphrase = "";
// Intialize message mask to print error messages.
message_mask = MSG_CAT_ERROR;
//
// How the payload is configured:
//
// 1. Pass path to configuration file on command line.
// 2. Look for toolkit_cfdp_config.txt in the executable's directory.
//
// Set default CFDP config_pathname
strcpy (config_pathname, "toolkit_cfdp_config.txt");
if (argc == 2)
{
if (strcmp(argv[1],"") != 0)
strcpy(config_pathname,argv[1]);
}
else if (argc == 3)
{
if (strcmp(argv[1], "") != 0)
strcpy(config_pathname, argv[1]);
if (strcmp(argv[2], "") != 0)
crypt_user_passphrase = argv[2];
}
else if (argc > 3)
{
//printf("Error Command line contains too many arguments.\n");
//return 0;
if (strcmp(argv[1], "") != 0)
strcpy(config_pathname, argv[1]);
if (strcmp(argv[2], "") != 0)
crypt_user_passphrase = argv[2];
printf("Warning Command line contains too many arguments.\n");
}
else
{
// Attempt to open a local config file
file_ptr = fopen(config_pathname,"r");
if (file_ptr != NULL)
{
// Local config file exists so use default config file path
fclose(file_ptr);
}
}
// Block SIGINT (ctrl-c); other threads created by main()
// will inherit a copy of the signal mask.
#ifndef _WIN32
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGINT);
if (pthread_sigmask(SIG_BLOCK, &set, NULL) != 0)
{
printf("Error Failed to block SIGINT.\n");
}
#endif
// Register the PrintMessage callback function prior to
// InitToolkitCfdp to process error messages that may be generated during
// CFDP initialization
RegisterMessage(&PrintTheMessage);
// Initialize CFDP. This funcition creates, connects and configures the
// socket and CFDP library
if ((return_code = InitToolkitCfdpAndCryptPassphrase(config_pathname, crypt_user_passphrase.c_str())) == SUCCESS)
{
if (GetDeviceMode(&device_mode) != SUCCESS)
{
printf("Error Failed to GetDisplayConsoleMenuFlag.\n");
}
if (GetDisplayConsoleMenuFlag(&display_console_help_menu_flag) != SUCCESS)
{
printf("Error Failed to GetDisplayConsoleMenuFlag.\n");
}
if (GetDisplayMessageMask(&message_mask) != SUCCESS)
{
printf("Error Failed to GetDisplayMessageMask.\n");
}
// Register the CFDPDeviceData callback function after initialization
// since the CFDPDevice does not exist prior to initialization and this
// function would fail.
if (RegisterCFDPDeviceData(&DeviceData) != SUCCESS)
{
printf("Error Failed to RegisterCFDPDeviceData.\n");
}
// Register signal handler functions
#ifdef _WIN32
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, TRUE );
#else
struct sigaction int_handler;
// Unblock SIGINT;
sigemptyset(&set);
sigaddset(&set, SIGINT);
if (pthread_sigmask(SIG_UNBLOCK, &set, NULL) != 0)
{
printf("Error Failed to unblock SIGINT.\n");
}
// Register signal handler functions (ctrl-c)
int_handler.sa_handler = SigHandler;
sigemptyset(&int_handler.sa_mask);
int_handler.sa_flags = 0;
if (sigaction(SIGINT, &int_handler, NULL) == -1)
{
printf("Error Failed to set SIGINT.\n");
}
#endif
// Print command primitives
if (display_console_help_menu_flag == TRUE_OR_YES)
{
HelpCfdp();
printf("Enter command primitive:\n");
}
while (!exit_flag)
{
cin.clear(); // reset the failbit for cin
getline (cin,name);
memset(command,'\0',1024);
strcpy(command,name.c_str());
// Initialize the argument array
Argu(command,11,arg,&arg_count);
if (arg[0] != NULL)
{
if (strcasecmp(arg[0],"put") == 0)
{
if (arg_count < 5)
{
printf("Error The number of arguments in the primitive should be >= 5 but the current argument count is %d.\n", arg_count);
}
else
{
if (suspend_flag)
{
PutCFDP(name.c_str());
}
else
{
PutCFDP(name.c_str());
}
}
}
else if (strcasecmp(arg[0],"add") == 0)
{
if (arg_count < 5)
{
printf("Error The number of arguments in the primitive should be >= 5 but the current argument count is %d.\n", arg_count);
}
else
{
found = name.find("add");
primitive_str = name.substr(found+4);
AddRequest(primitive_str.c_str());
}
}
else if (strcasecmp(arg[0],"get") == 0)
{
if (arg_count < 5)
{
printf("Error The number of arguments in the primitive should be >= 5 but the current argument count is %d.\n", arg_count);
}
else
{
if (suspend_flag)
{
GetCFDP(name.c_str());
}
else
{
GetCFDP(name.c_str());
}
}
}
else if ((strcasecmp(arg[0],"create_file") == 0) || (strcasecmp(arg[0],"delete_file") == 0) ||
(strcasecmp(arg[0],"rename_file") == 0) || (strcasecmp(arg[0],"append_file") == 0) ||
(strcasecmp(arg[0],"replace_file") == 0) || (strcasecmp(arg[0],"create_dir") == 0) ||
(strcasecmp(arg[0],"remove_dir") == 0) || (strcasecmp(arg[0],"deny_file") == 0) ||
(strcasecmp(arg[0],"deny_dir") == 0) || (strcasecmp(arg[0], "close_rec_file") == 0))
{
if (arg_count < 4)
{
printf("Error The number of arguments in the primitive should be >= 4 but the current argument count is %d.\n", arg_count);
}
else
{
if (suspend_flag)
{
FilestoreCFDP(name.c_str());
}
else
{
FilestoreCFDP(name.c_str());
}
}
}
else if (strcasecmp(arg[0],"message") == 0)
{
if (suspend_flag)
{
MessageCFDP(name.c_str());
}
else
{
MessageCFDP(name.c_str());
}
}
else if (strcasecmp(arg[0], "bit_rate") == 0)
{
if (arg_count == 4)
{
if (suspend_flag)
{
// Use the generic SendRequest
SendRequest(name.c_str());
}
else
{
// Use the generic SendRequest
SendRequest(name.c_str());
}
}
else
{
printf("Error The number of arguments in the primitive should be 4 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"remove") == 0)
{
}
else if (strcasecmp(arg[0],"send") == 0)
{
if (suspend_flag)
{
}
else
{
}
}
else if (strcasecmp(arg[0],"record") == 0)
{
if (arg_count > 2)
{
if (strcasecmp(arg[1],"prim") == 0)
{
// Allow spaces in config file path and name
found = name.find_first_not_of(" ",sizeof("record prim"));
pathname = name.substr(found);
// Check to see if pathname contains ""
if ((found = pathname.find("\"")) != string::npos)
{
// Retrieve the pathname from the primitive string containing ""
if ((next_found = pathname.find("\"",found + 1)) != string::npos)
{
path_name = pathname.substr(found+1,next_found-found-1);
SaveAllRequestsToFile(path_name.c_str());
}
else
{
printf("Error Invalid record prim primitive.\n");
}
}
else
{
printf("Error Invalid record prim primitive.\n");
}
}
else
{
printf("Error Undefined primitive.\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be greater than 2 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"process") == 0)
{
if (arg_count > 1)
{
// Allow spaces in file path and name
found = name.find_first_not_of(" ",sizeof("process"));
pathname = name.substr(found);
// Check to see if pathname contains ""
if ((found = pathname.find("\"")) != string::npos)
{
// Retrieve the pathname from the primitive string containing ""
if ((next_found = pathname.find("\"",found + 1)) != string::npos)
{
path_name = pathname.substr(found+1,next_found-found-1);
if (suspend_flag)
{
ProcessFileOfCFDPPrimitives(path_name.c_str(),&primitive_count);
}
else
{
ProcessFileOfCFDPPrimitives(path_name.c_str(),&primitive_count);
}
}
else
{
printf("Error Invalid process prim primitive.\n");
}
}
else
{
printf("Error Invalid process prim primitive.\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be greater than 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"suspend") == 0)
{
if (!suspend_flag)
{
suspend_flag = true;
}
printf("Info Suspend all CFDP transactions.\n");
}
else if (strcasecmp(arg[0],"resume") == 0)
{
if (suspend_flag)
{
suspend_flag = false;
}
printf("Info Resume all CFDP transactions.\n");
}
else if (strcasecmp(arg[0],"cancel") == 0)
{
if (arg_count == 2)
{
if (strcasecmp(arg[1],"all") == 0)
{
if (suspend_flag)
{
suspend_flag = false;
}
}
else
{
if (suspend_flag)
{
}
else
{
}
}
}
else
{
printf("Error The number of arguments in the primitive should be 2 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"report") == 0)
{
if (arg_count == 2)
{
// Reports will be generated even if transactions are
// suspended so ignore suspend_flag
if (strcasecmp(arg[1],"all") == 0)
{
}
else
{
}
}
else
{
printf("Error The number of arguments in the primitive should be 2 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"r") == 0)
{
if (arg_count == 1)
{
// Reports will be generated even if transactions are
// suspended so ignore suspend_flag
}
else
{
printf("Error The number of arguments in the primitive should be 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"prog") == 0)
{
if (arg_count == 1)
{
message_mask = message_mask | MSG_CAT_PROGRESS;
}
else
{
printf("Error The number of arguments in the primitive should be 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"log") == 0)
{
if (arg_count > 2)
{
// Check to see if pathname contains ""
if ((found = name.find("\"")) != string::npos)
{
// Retrieve the pathname from the primitive string containing ""
if ((next_found = name.find("\"",found + 1)) != string::npos)
{
path_name = name.substr(found+1,next_found-found-1);
name = "log " + path_name;
// Allow spaces in file path and name
found = name.find_first_not_of(" ",sizeof("log"));
next_found = name.find_last_of("/\\");
if (next_found != string::npos)
{
path_only = name.substr(found,next_found - found + 1);
found = name.find_last_of(" ");
// assume a single " " separates the pathname and the boolean
filename_only = name.substr(next_found + 1,found - next_found - 1);
// Reports will be generated even if transactions are
// suspended so ignore suspend_flag
if (strcasecmp(arg[arg_count - 1],"false") == 0)
{
StartLoggingCFDPMessages(path_only.c_str(),filename_only.c_str(),FALSE_OR_NO);
}
else if (strcasecmp(arg[arg_count - 1],"true") == 0)
{
StartLoggingCFDPMessages(path_only.c_str(),filename_only.c_str(),TRUE_OR_YES);
}
else
{
printf("Error The last argument in the primitive should be true or false.\n");
}
}
else
{
printf("Error The path must end in / or \\.\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be greater than 2 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"stop") == 0)
{
if (arg_count == 2)
{
if (strcasecmp(arg[1],"log") == 0)
{
}
else if (strcasecmp(arg[1],"stat") == 0)
{
}
else if (strcasecmp(arg[1],"metric") == 0)
{
}
else if (strcasecmp(arg[1],"prog") == 0)
{
message_mask = message_mask & (~MSG_CAT_PROGRESS);
}
else
{
printf("Error Undefined primitive.\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be 2 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"stat") == 0)
{
if (arg_count > 1)
{
// Check to see if pathname contains ""
if ((found = name.find("\"")) != string::npos)
{
// Retrieve the pathname from the primitive string containing ""
if ((next_found = name.find("\"",found + 1)) != string::npos)
{
path_name = name.substr(found+1,next_found-found-1);
name = "stat " + path_name;
// Allow spaces in file path and name
found = name.find_first_not_of(" ",sizeof("stat"));
next_found = name.find_last_of("/\\");
if (next_found != string::npos)
{
path_only = name.substr(found,next_found - found + 1);
filename_only = name.substr(next_found + 1);
// Do not need to record packet statistics
StartRecordingCFDPStatSnapshot(path_only.c_str(),filename_only.c_str(),FALSE_OR_NO);
}
else
{
printf("Error The path must end in / or \\.\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be greater than 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"metric") == 0)
{
if (arg_count > 1)
{
// Check to see if pathname contains ""
if ((found = name.find("\"")) != string::npos)
{
// Retrieve the pathname from the primitive string containing ""
if ((next_found = name.find("\"",found + 1)) != string::npos)
{
path_name = name.substr(found+1,next_found-found-1);
name = "metric " + path_name;
// Allow spaces in file path and name
found = name.find_first_not_of(" ",sizeof("metric"));
next_found = name.find_last_of("/\\");
if (next_found != string::npos)
{
path_only = name.substr(found,next_found - found + 1);
filename_only = name.substr(next_found + 1);
StartRecordingCFDPMetricsSnapshot(path_only.c_str(),filename_only.c_str());
}
else
{
printf("Error The path must end in / or \\.\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be greater than 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"reset") == 0)
{
if (arg_count == 2)
{
if (strcasecmp(arg[1],"stat") == 0)
{
}
else if (strcasecmp(arg[1],"metric") == 0)
{
}
else
{
printf("Error Undefined primitive.\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"exit") == 0 ||
strcasecmp(arg[0],"quit") == 0 ||
strcasecmp(arg[0],"q") == 0)
{
if (arg_count == 1)
{
if (suspend_flag)
{
suspend_flag = false;
}
exit_flag = true;
message_mask = 0;
if (device_mode == DM_NATIVE_CFDP)
{
}
}
else
{
printf("Error The number of arguments in the primitive should be 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"reconfig") == 0)
{
if (arg_count > 1)
{
message_mask = MSG_CAT_ERROR ;
// Allow spaces in file path and name
found = name.find_first_not_of(" ",sizeof("reconfig"));
pathname = name.substr(found);
// Check to see if pathname contains ""
if ((found = pathname.find("\"")) != string::npos)
{
// Retrieve the pathname from the primitive string containing ""
if ((next_found = pathname.find("\"",found + 1)) != string::npos)
{
path_name = pathname.substr(found+1,next_found-found-1);
// Initialize CFDP. This funcition creates, connects
// and configures the CFDP library
if (InitToolkitCfdp(path_name.c_str()) == SUCCESS)
{
if (GetDisplayConsoleMenuFlag(&display_console_help_menu_flag) != SUCCESS)
{
printf("Error Failed to GetDisplayConsoleMenuFlag.\n");
}
if (GetDisplayMessageMask(&message_mask) != SUCCESS)
{
printf("Error Failed to GetDisplayMessageMask.\n");
}
// Register the CFDPDeviceData callback function
// after initialization since the CFDPDevice does
// not exist prior to initialization and this
// function would fail.
if (RegisterCFDPDeviceData(&DeviceData) != SUCCESS)
{
printf("Error Failed to RegisterCFDPDeviceData.\n");
}
printf("Info Successfully reconfigured CFDP console app.\n");
}
else
{
printf("Error Failed to Initilize CFDP console app.\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be greater than 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"save") == 0)
{
if (arg_count > 1)
{
// Allow spaces in file path and name
found = name.find_first_not_of(" ",sizeof("save"));
pathname = name.substr(found);
// Check to see if pathname contains ""
if ((found = pathname.find("\"")) != string::npos)
{
// Retrieve the pathname from the primitive string containing ""
if ((next_found = pathname.find("\"",found + 1)) != string::npos)
{
path_name = pathname.substr(found+1,next_found-found-1);
if (SaveToolkitCfdp(path_name.c_str()) != SUCCESS)
{
printf("Error Failed to save configuration in file.\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The pathname must contain \"\".\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be greater than 1 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"display") == 0)
{
if (arg_count == 2)
{
if (strcasecmp(arg[1],"config") == 0)
{
char config_buffer [10000];
if (GetConfigurationAsString(sizeof(config_buffer),
config_buffer) == SUCCESS)
{
printf("\n");
printf(config_buffer);
printf("\n");
}
}
else if (strcasecmp(arg[1],"actions") == 0)
{
ActionCfdp();
}
else
{
printf("Error Undefined primitive.\n");
}
}
else
{
printf("Error The number of arguments in the primitive should be 2 but the current argument count is %d.\n", arg_count);
}
}
else if (strcasecmp(arg[0],"help") == 0)
{
printf("\n");
HelpCfdp();
}
else if (strcasecmp(arg[0],"") == 0)
{
// do nothing
}
else
{
printf("Error Undefined primitive.\n");
}
}
}
}
else
{
printf("Error Failed to Initilize CFDP console app with error code: %d\n", return_code);
}
return 0;
}
Enumerated types for the BP device library.
device_mode_type
Definition: bp_shared.h:19
@ DM_NATIVE_CFDP
Native CFDP device mode.
Definition: bp_shared.h:23
@ DM_ION_CFDP
ION CFDP device mode.
Definition: bp_shared.h:22
Message codes and structure definition for the Device Service library.
#define DS_PACKET_RECEIVING
26 DS message code for Packet Receiving
Definition: ds_shared.h:51
boolean_type
Boolean enumeration.
Definition: ds_shared.h:104
@ FALSE_OR_NO
False.
Definition: ds_shared.h:105
@ TRUE_OR_YES
True.
Definition: ds_shared.h:106
#define DS_PACKET_SENDING
29 DS message code for Packet Sending
Definition: ds_shared.h:54
#define DS_RESUME
10 DS message code for Resume
Definition: ds_shared.h:35
#define DS_MESSAGE
45 DS message code for Message
Definition: ds_shared.h:70
Structure of parameters needed for CFDP transaction status.
Definition: ds_shared.h:145
char destination_pathname[256]
Destination path and filename.
Definition: ds_shared.h:147
unsigned long cfdp_status
(e.g., DS_PACKET_SENDING, DS_PACKET_RECEIVING, DS_SUSPEND, DS_RESUME, DS_CANCEL, DS_SUCCESS,...
Definition: ds_shared.h:164
unsigned short percent_transferred
Bytes transferred divided by file size. Will reset with packet/PDU retransmissions.
Definition: ds_shared.h:150
char message[256]
A message received in a DTN metadata or finished PDU.
Definition: ds_shared.h:160
long long bytes_transferred
The current number of bytes transmitted or received.
Definition: ds_shared.h:151
char transaction_id[50]
The transaction ID string is a combination of the decimal dotted notation EID (NATIVE) or decimal EID...
Definition: ds_shared.h:149
long long file_size
The size of the file being transferred.
Definition: ds_shared.h:152
Structure of parameters needed for message support.
Definition: trek_toolkit_common_api_ansi_c.h:74
char message[MAX_MESSAGE_SIZE]
Message.
Definition: trek_toolkit_common_api_ansi_c.h:77
enum message_category category
Message category (e.g., MSG_CAT_ERROR, MSG_CAT_ERROR_ALERT, MSG_CAT_WARNING, MSG_CAT_WARNING_ALERT,...
Definition: trek_toolkit_common_api_ansi_c.h:76
An ANSI C CFDP API.
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SaveAllRequestsToFile(const char *pathname)
Saves all "put" and "get" file requests and all filestore and message requests in a file....
Definition: toolkit_cfdp_api_ansi_c.cpp:5580
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ReportCFDPTransaction(const char *transaction_id)
Report the status of a CFDP file transaction including its current state, the transaction as a string...
Definition: toolkit_cfdp_api_ansi_c.cpp:6261
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetConfigurationAsString(unsigned int config_buffer_size, char *config_buffer)
Returns the content of the CFDP configuration file in a character string. Supports both NATIVE and IO...
Definition: toolkit_cfdp_api_ansi_c.cpp:6700
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StopRecordingCFDPStatSnapshot()
Stops recording statisitics to a file, closes the record file and renames the record file by concaten...
Definition: toolkit_cfdp_api_ansi_c.cpp:6964
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StopRecordingCFDPMetricsSnapshot()
Stops recording CFDP metrics to a file, closes the record file and renames the record file by concate...
Definition: toolkit_cfdp_api_ansi_c.cpp:7114
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RegisterCFDPDeviceData(void(*function_ptr)(const char *device_key, int packet_length, unsigned char *packet_buffer_ptr))
Register a callback function to receive cfdp_struct status messages for all transactions currently be...
Definition: toolkit_cfdp_api_ansi_c.cpp:7904
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddRequest(const char *primitive)
Adds a CFDP transaction, using a CFDP primitive string, to the appropriate list of similar CFDP trans...
Definition: toolkit_cfdp_api_ansi_c.cpp:5440
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SaveToolkitCfdp(const char *config_pathname)
Saves the CFDP configuration parameters in an ASCII file. Supports both Native and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:542
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PutCFDP(const char *put_primitive)
Initiates a "put" file transfer using a CFDP primitive string. Supports both Native and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:693
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ReportAllCFDPTransactions()
Report the status of all CFDP file transaction including their current state, the transaction as a st...
Definition: toolkit_cfdp_api_ansi_c.cpp:6385
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllRequests()
Initiates all "put" and "get" file requests and all filestore and message requests in the lists of CF...
Definition: toolkit_cfdp_api_ansi_c.cpp:5497
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MessageCFDP(const char *message_primitive)
Initiates a message transfer using a CFDP primitive string. Supports both Native and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:4427
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendRequest(const char *primitive)
Initiates a CFDP transaction using a CFDP primitive string. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:5359
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StartRecordingCFDPStatSnapshot(const char *record_file_path, const char *record_filename, boolean_type record_packet_statistics_flag)
Starts recording a snapshot of the current statistics to a file. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:6914
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FilestoreCFDP(const char *filestore_primitive)
Initiates a filestore action (e.g., create_file, delete_file, rename_file ...) using a CFDP primitive...
Definition: toolkit_cfdp_api_ansi_c.cpp:2949
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetDeviceMode(device_mode_type *device_mode_ptr)
Returns a device_mode_type variable providing information on the configuration of the CFDP device lib...
Definition: toolkit_cfdp_api_ansi_c.cpp:6640
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION InitToolkitCfdp(const char *config_pathname)
Intializes the CFDP library using parameters read from a configuration file. Supports both Native and...
Definition: toolkit_cfdp_api_ansi_c.cpp:98
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllRequests()
Removes all "put" and "get" file request and all filestore and message requests in the lists....
Definition: toolkit_cfdp_api_ansi_c.cpp:5529
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendAllCFDPTransactions()
Suspend all CFDP file transactions. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:5932
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetDisplayMessageMask(unsigned int *display_mask_ptr)
Populates an unsigned integer with a mask value using the display message parameters in the configura...
Definition: toolkit_cfdp_api_ansi_c.cpp:6597
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetCFDP(const char *get_primitive)
Initiates a "get" file transfer using a CFDP primitive string. Supports both Native and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:1783
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResetCFDPMetrics()
Resets or zero's the device and packet statistics. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:7151
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StartRecordingCFDPMetricsSnapshot(const char *record_file_path, const char *record_filename)
Starts recording a snapshot of the current CFDP metrics to a file. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:7026
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION InitToolkitCfdpAndCryptPassphrase(const char *config_pathname, const char *crypt_user_passphrase)
Intializes the CFDP library using parameters read from a configuration file. Supports both Native and...
Definition: toolkit_cfdp_api_ansi_c.cpp:142
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResetCFDPStatistics()
Resets or zero's the device and packet statistics. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:6991
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeAllCFDPTransactions()
Resume all previously suspended CFDP file transactions. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:6082
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StartLoggingCFDPMessages(const char *log_file_path, const char *log_filename, boolean_type log_debug_messages)
Starts logging messages to a file. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:6804
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StopLoggingCFDPMessages()
Stops logging messages to a file, closes the log file and renames the log file by concatenating the l...
Definition: toolkit_cfdp_api_ansi_c.cpp:6854
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ProcessFileOfCFDPPrimitives(const char *pathname, unsigned int *primitive_count_ptr)
Reads a a text file of CFDP "put", "get", "filestore" and "message" primitives and adds them to the a...
Definition: toolkit_cfdp_api_ansi_c.cpp:5747
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetDisplayConsoleMenuFlag(boolean_type *display_console_menu_flag_ptr)
Returns a boolean_type variable providing information on displaying the console application menu of c...
Definition: toolkit_cfdp_api_ansi_c.cpp:6515
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION CancelCFDPTransaction(const char *transaction_id)
Cancel a CFDP file transaction using a transaction ID. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:6111
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION CancelAllCFDPTransactions()
Cancel all CFDP file transactions. Supports both NATIVE and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:6231
Error codes for the CFDP API (starts at 51001)
An ANSI C Data Service API.
int EXPORT_THIS_TOOLKIT_DS_C_FUNCTION DSCleanUp()
Initiates a graceful shutdown of the Device Service library and all supporting device libraries,...
Definition: toolkit_ds_api_ansi_c.cpp:3843
int EXPORT_THIS_TOOLKIT_DS_C_FUNCTION RegisterMessage(void(*function_ptr)(message_struct_type *message_struct_ptr))
Register a callback function to receive and process messages issued by the DS library.
Definition: toolkit_ds_api_ansi_c.cpp:3951
Error codes for the DS API (starts at 50001)
#define SUCCESS
The function completed successfully.
Definition: trek_error.h:8
@ MSG_CAT_PROGRESS
Progress message.
Definition: trek_toolkit_common_api_ansi_c.h:62
@ MSG_CAT_ERROR
Error message.
Definition: trek_toolkit_common_api_ansi_c.h:56
const char EXPORT_THIS_TREK_TOOLKIT_COMMON_API_FUNCTION * GetMessageCategoryAsPaddedString(enum message_category input)
Converts an enumerated message category value into its equivalent character string with padded spaces...
Definition: trek_toolkit_common_api_ansi_c.cpp:90