TReK ANSI-C  5.3.3
All ANSI-C APIs
toolkit_cfdp_api_ansi_c.h File Reference

An ANSI C CFDP API. More...

#include "ds_shared.h"
#include "cfdp_shared.h"
#include "trek_toolkit_common_api_ansi_c.h"
#include "bp_shared.h"

Functions

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 ION CFDP. More...
 
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 ION CFDP. More...
 
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. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Put (const char *source_pathname, const char *destination_pathname, long long destination_eid)
 Initiates a "put" file transfer using the common components of a "put" primitive string. Supports both Native and ION CFDP. More...
 
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. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PutComponentCFDP (const char *source_pathname, const char *destination_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Initiates a "put" file transfer using the components of a CFDP primitive string. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PutComponentION (const char *source_pathname, const char *destination_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Initiates a "put" file transfer using the components of a CFDP primitive string. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPut (const char *source_pathname, const char *destination_pathname, long long destination_eid)
 Adds a "put" file request, using the common components of a "put" primitive string, to the list of CFDP "put" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutRequest (const char *put_primitive)
 Adds a "put" file request, using a "put" primitive string, to the list of CFDP "put" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutComponentRequest (const char *source_pathname, const char *destination_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Adds a "put" file request, using "put" components, to the list of CFDP "put" requests. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutComponentRequestION (const char *source_pathname, const char *destination_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Adds a "put" file request, using "put" components, to the list of CFDP "put" requests. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllPutRequests ()
 Initiates all "put" file requests in the list of CFDP "put" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemovePutRequest (const char *put_primitive)
 Removes a "put" file request, using a "put" primitive string, from the list of CFDP "put" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemovePutComponentRequest (const char *source_pathname, const char *destination_pathname, long long destination_eid)
 Removes a "put" file request, using "put" components, from the list of CFDP "put" requests. Supports both Native and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllPutRequests ()
 Removes all "put" file request in the list of CFDP "put" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Get (const char *source_pathname, const char *destination_pathname, long long source_eid)
 Initiates a "get" file transfer using the common components of a "get" primitive string. Supports both Native and ION CFDP. More...
 
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. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetComponentCFDP (const char *source_pathname, const char *destination_pathname, long long source_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Initiates a "get" file transfer using the components of a CFDP primitive string. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetComponentION (const char *source_pathname, const char *destination_pathname, long long source_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Initiates a "get" file transfer using the components of a CFDP primitive string. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGet (const char *source_pathname, const char *destination_pathname, long long source_eid)
 Adds a "get" file request, using the common components of a "get" primitive string, to the list of CFDP "get" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetRequest (const char *get_primitive)
 Adds a "get" file request, using a "get" primitive string, to the list of CFDP "get" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetComponentRequest (const char *source_pathname, const char *destination_pathname, long long source_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Adds a "get" file request, using "get" components, to the list of CFDP "get" requests. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetComponentRequestION (const char *source_pathname, const char *destination_pathname, long long source_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Adds a "get" file request, using "get" components, to the list of CFDP "get" requests. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllGetRequests ()
 Initiates all "get" file requests in the list of CFDP "get" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveGetRequest (const char *get_primitive)
 Removes a "get" file request, using a "get" primitive string, from the list of CFDP "get" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveGetComponentRequest (const char *source_pathname, const char *destination_pathname, long long source_eid)
 Removes a "get" file request, using "get" components, from the list of CFDP "get" requests. Supports both Native and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllGetRequests ()
 Removes all "get" file request in the list of CFDP "get" requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Filestore (cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid)
 Initiates a filestore action using the common components of a filestore primitive string. Supports both Native and ION CFDP. More...
 
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 string. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FilestoreComponent (cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Initiates a filestore action (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using the components of a CFDP primitive string. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FilestoreComponentION (cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Initiates a filestore action (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using the components of a CFDP primitive string. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestore (cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid)
 Adds a filestore request, using the common components of a filestore primitive string, to the list of CFDP filestore requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreRequest (const char *filestore_primitive)
 Adds a filestore request (e.g., create_file, delete_file, rename_file ...) using a CFDP primitive string. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreComponentRequest (cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Adds a filestore request (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using filestore components, to the list of CFDP filestore actions. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreComponentRequestION (cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Adds a filestore request (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using filestore components, to the list of CFDP filestore actions. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllFilestoreRequests ()
 Initiates all filestore requests in the list of CFDP filestore requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveFilestoreRequest (const char *filestore_primitive)
 Removes a filestore request (e.g., create_file, delete_file, rename_file ...) using a filestore primitive string, from the list of CFDP filestore requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveFilestoreComponentRequest (cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid)
 Removes a filestore request, using the common components of a filestore primitive string, from the list of CFDP filestore requests. Supports both Native and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllFilestoreRequests ()
 Removes all filestore request from the list of CFDP filestore requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Message (const char *message, long long destination_eid)
 Initiates a message transfer. Supports both Native and ION CFDP. More...
 
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. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MessageComponent (const char *message, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Initiates a "message" transfer using the components of a CFDP primitive string. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MessageComponentION (const char *message, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Initiates a message transfer using the components of a CFDP primitive string. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessage (const char *message, long long destination_eid)
 Adds a message transfer request to the list of CFDP message requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageRequest (const char *message_primitive)
 Adds a message transfer request, using a CFDP primitive string, to the list of CFDP message requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageComponentRequest (const char *message, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
 Adds a "message" request, using "message" components, to the list of CFDP "message" requests. Supports Native CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageComponentRequestION (const char *message, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
 Adds a message transfer request, using the components of a CFDP primitive string, to the list of CFDP message requests. Supports ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllMessageRequests ()
 Initiates all message transfer requests in the list of CFDP message requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveMessageRequest (const char *message_primitive)
 Removes a message transfer request, using a message primitive string, from the list of CFDP message requests. Supports both Native and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveMessageComponentRequest (const char *message, long long destination_eid)
 Removes a message transfer request, using message components, from the list of CFDP message requests. Supports both Native and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllMessageRequests ()
 Removes all message transfer requests in the list of CFDP filestore requests. Supports both Native and ION CFDP. More...
 
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. More...
 
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 transactions. Supports both NATIVE and ION CFDP. More...
 
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 CFDP requests. Executes FIFO ordering. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllRequests ()
 Removes all "put" and "get" file request and all filestore and message requests in the lists. Supports both NATIVE and ION CFDP. More...
 
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. Maintains FIFO ordering. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION BitRate (unsigned int bit_rate, long long destination_eid)
 Changes the current aggregate bit rate of files being transferred by the targeted eid. Supports Native CFDP. More...
 
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 appropriate transaction lists. All valid primitive files must begin with the text string "primitve_version" followed by a verision number and the TReK device mode (e.g., NATIVE_CFDP of ION_CFDP).
Files that do not contain the "primitve_version" text string are considered invalid and will not be read. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendCFDPTransaction (const char *transaction_id)
 Suspend a CFDP file transaction using a transaction ID. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendTheCFDPTransaction (const char *destination_pathname, long long destination_eid)
 Suspend a CFDP file transaction using a destination pathname and destination entity ID. This function will not suspend a CFDP file transaction if the suspend call is made immediately after submitting the CFDP file transaction and prior to the CFDP file transaction creating a transaction ID. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendAllCFDPTransactions ()
 Suspend all CFDP file transactions. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeCFDPTransaction (const char *transaction_id)
 Resume a previously suspended CFDP file transaction using a transaction ID. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeTheCFDPTransaction (const char *destination_pathname, long long destination_eid)
 Resume a previously suspended CFDP file transaction using a destination pathname and destination entity ID. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeAllCFDPTransactions ()
 Resume all previously suspended CFDP file transactions. Supports both NATIVE and ION CFDP. More...
 
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. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION CancelTheCFDPTransaction (const char *destination_pathname, long long destination_eid)
 Cancel a CFDP file transaction using a destination pathname and destination entity ID. This function will not cancel a CFDP file transaction if the cancel call is made immediately after submitting the CFDP file transaction and prior to the CFDP file transaction creating a transaction ID. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION CancelAllCFDPTransactions ()
 Cancel all CFDP file transactions. Supports both NATIVE and ION CFDP. More...
 
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, the size of the file being transferred and the number of bytes that have been sent. The status report is provided by the callback function associated with RegisterPrintMessage. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ReportTheCFDPTransaction (const char *destination_pathname, long long destination_eid)
 Report the status of a CFDP file transaction including its current state, the transaction as a string, the size of the file being transferred and the number of bytes that have been sent. The status report is provided by the callback function associated with RegisterPrintMessage. This function will not report on a CFDP file transaction if the report call is made immediately after submitting the CFDP file transaction and prior to the CFDP file transaction creating a transaction ID. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ReportAllCFDPTransactions ()
 Report the status of all CFDP file transaction including their current state, the transaction as a string, the size of the file being transferred and the number of bytes that have been sent. The status report is provided by the callback function associated with RegisterPrintMessage. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddDestinationEID (long long destination_eid, const char *ip_address, unsigned short port)
 Associate an entity ID with an IP address and port number of a remote site. Only supported by the native CFDP implemetation. More...
 
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 command primitives. Supports both NATIVE and ION CFDP. More...
 
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 configuration file. The mask may be used to determine if a message should be displayed. Supports both NATIVE and ION CFDP. More...
 
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 library (DM_ION_CFDP or DM_NATIVE_CFDP CFDP). Supports both NATIVE and ION CFDP. More...
 
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 ION CFDP. More...
 
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. More...
 
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 log file name with a GMT time string. Supports both NATIVE and ION CFDP. More...
 
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. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StopRecordingCFDPStatSnapshot ()
 Stops recording statisitics to a file, closes the record file and renames the record file by concatenating the record file name with a GMT time string. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResetCFDPStatistics ()
 Resets or zero's the device and packet statistics. Supports both NATIVE and ION CFDP. More...
 
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.
More...
 
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 concatenating the record file name with a GMT time string. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResetCFDPMetrics ()
 Resets or zero's the device and packet statistics. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PopulateCFDPStructArray (unsigned int *number_of_cfdp_structs_ptr, cfdp_struct_type *cfdp_struct_array_ptr)
 Populates an array with cfdp structs describing current CFDP transactions. Supports both NATIVE and ION CFDP. More...
 
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MonitorAllCFDPTransactions (unsigned int monitor_timeout, unsigned int *transaction_count_ptr, cfdp_struct_type **cfdp_struct_array_ptr)
 Monitors the status of all CFDP transactions and returns when all the transactions have completed or the monitor time, in seconds, expires. Supports both NATIVE and ION CFDP. More...
 
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FreeCFDPStructArrayMemoryAlloc (cfdp_struct_type *cfdp_struct_array_ptr)
 Frees the memory associated with the cfdp_struct_array that was returned by MonitorAllCFDPTransactions. Supports both NATIVE and ION CFDP. More...
 
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 being processed by the CFDP library. Supports both NATIVE and ION CFDP. More...
 

Detailed Description

An ANSI C CFDP API.

Function Documentation

◆ AddDestinationEID()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddDestinationEID ( long long  destination_eid,
const char *  ip_address,
unsigned short  port 
)

Associate an entity ID with an IP address and port number of a remote site. Only supported by the native CFDP implemetation.

Parameters
[in]destination_eidThe entity ID of the remote site.
[in]ip_addressThe IP address of the remote site.
[in]portThe port number of the remote site.
Returns
SUCCESS
FAIL
CFDP_INVALID_DEVICE_MODE
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
RegisterPrintMessage(&PrintTheMessage);
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddDestinationEID(100,"127.0.0.1",4560);
}
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
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddDestinationEID(long long destination_eid, const char *ip_address, unsigned short port)
Associate an entity ID with an IP address and port number of a remote site. Only supported by the nat...
Definition: toolkit_cfdp_api_ansi_c.cpp:6424
#define SUCCESS
The function completed successfully.
Definition: trek_error.h:8

◆ AddFilestore()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestore ( cfdp_filestore_action_type  filestore_action,
const char *  first_pathname,
const char *  second_pathname,
long long  destination_eid 
)

Adds a filestore request, using the common components of a filestore primitive string, to the list of CFDP filestore requests. Supports both Native and ION CFDP.

Parameters
[in]filestore_actionThe filestore action for the CFDP transaction. The cfdp_filestore_action_type is defined in the file "cfdp_shared.h".
Not all filestore actions require two pathnames. The second pathname is ignored if it is not required. The following table identifies the cfdp_filestore_action_type and defines its required pathname parameter(s):
Filestore Action cfdp_filestore_action_type

Pathname Parameter(s)

Create File CFDP_CREATE_FILE

(1) Pathname of new file

Delete File CFDP_DELETE_FILE

(1) Pathname of file to be deleted

Rename File CFDP_RENAME_FILE

(1) Pathname of old file
(2) Pathname of new file

Append File CFDP_APPEND_FILE

(1) Pathname whose name and content forms first part of new file
(2) Pathname whose content forms second part of new file

Replace File CFDP_REPLACE_FILE

(1) Pathname of file to be replaced
(2) Pathname of file whose content will replace the first file's content

Create Directory CFDP_CREATE_DIR

(1) Path of new directory

Remove Directory CFDP_REMOVE_DIR

(1) Path of directory to be removed

Delete File (does not fail if file does not exist) CFDP_DENY_FILE

(1) Pathname of file to be deleted (does not fail if file does not exist)

Delete Directory (does not fail if directory does not exist) CFDP_DENY_DIR (1) Path of directory to be removed (does not fail if directory does not exist)
[in]first_pathnameThe full pathname of the first parameter in a filestore action.
[in]second_pathnameThe full pathname of the second parameter (if any) in a filestore action.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_ACTION
Note
The filestore action will use the transmission parameters in the source library's configuration file when executing the filestore transaction. The transmission parameters include priority, mode and criticality.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddFilestore(cfdp_filestore_action,
"D:/first_pathname",
"D:/second_pathname",100);
}
cfdp_filestore_action_type
CFDP filestore enumerations.
Definition: cfdp_shared.h:28
@ CFDP_RENAME_FILE
CFDP rename file.
Definition: cfdp_shared.h:32
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestore(cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid)
Adds a filestore request, using the common components of a filestore primitive string,...
Definition: toolkit_cfdp_api_ansi_c.cpp:3516
Examples
cfdp_bp_filestore_example/main.c, and cfdp_filestore_example/main.c.

◆ AddFilestoreComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreComponentRequest ( cfdp_filestore_action_type  filestore_action,
const char *  first_pathname,
const char *  second_pathname,
long long  destination_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Adds a filestore request (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using filestore components, to the list of CFDP filestore actions. Supports Native CFDP.

Parameters
[in]filestore_actionThe filestore action for the CFDP transaction. The cfdp_filestore_action_type is defined in the file "cfdp_shared.h".
Not all filestore actions require two pathnames. The second pathname is ignored if it is not required. The following table identifies the cfdp_filestore_action_type and defines its required pathname parameter(s):
Filestore Action cfdp_filestore_action_type

Pathname Parameter(s)

Create File CFDP_CREATE_FILE

(1) Pathname of new file

Delete File CFDP_DELETE_FILE

(1) Pathname of file to be deleted

Rename File CFDP_RENAME_FILE

(1) Pathname of old file
(2) Pathname of new file

Append File CFDP_APPEND_FILE

(1) Pathname whose name and content forms first part of new file
(2) Pathname whose content forms second part of new file

Replace File CFDP_REPLACE_FILE

(1) Pathname of file to be replaced
(2) Pathname of file whose content will replace the first file's content

Create Directory CFDP_CREATE_DIR

(1) Path of new directory

Remove Directory CFDP_REMOVE_DIR

(1) Path of directory to be removed

Delete File (does not fail if file does not exist) CFDP_DENY_FILE

(1) Pathname of file to be deleted (does not fail if file does not exist)

Delete Directory (does not fail if directory does not exist) CFDP_DENY_DIR (1) Path of directory to be removed (does not fail if directory does not exist)
[in]first_pathnameThe full pathname of the first parameter in a filestore action.
[in]second_pathnameThe full pathname of the second parameter (if any) in a filestore action.
[in]destination_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
cfdp_filestore_action_type cfdp_filestore_action;
cfdp_filestore_action = CFDP_RENAME_FILE;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddFilestoreComponentRequest(cfdp_filestore_action,
"D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreComponentRequest(cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
Adds a filestore request (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using filestore components,...
Definition: toolkit_cfdp_api_ansi_c.cpp:3743
Examples
cfdp_filestore_example/main.c.

◆ AddFilestoreComponentRequestION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreComponentRequestION ( cfdp_filestore_action_type  filestore_action,
const char *  first_pathname,
const char *  second_pathname,
long long  destination_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Adds a filestore request (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using filestore components, to the list of CFDP filestore actions. Supports ION CFDP.

Parameters
[in]filestore_actionThe filestore action for the CFDP transaction. The cfdp_filestore_action_type is defined in the file "cfdp_shared.h".
Not all filestore actions require two pathnames. The second pathname is ignored if it is not required. The following table identifies the cfdp_filestore_action_type and defines its required pathname parameter(s):
Filestore Action cfdp_filestore_action_type

Pathname Parameter(s)

Create File CFDP_CREATE_FILE

(1) Pathname of new file

Delete File CFDP_DELETE_FILE

(1) Pathname of file to be deleted

Rename File CFDP_RENAME_FILE

(1) Pathname of old file
(2) Pathname of new file

Append File CFDP_APPEND_FILE

(1) Pathname whose name and content forms first part of new file
(2) Pathname whose content forms second part of new file

Replace File CFDP_REPLACE_FILE

(1) Pathname of file to be replaced
(2) Pathname of file whose content will replace the first file's content

Create Directory CFDP_CREATE_DIR

(1) Path of new directory

Remove Directory CFDP_REMOVE_DIR

(1) Path of directory to be removed

Delete File (does not fail if file does not exist) CFDP_DENY_FILE

(1) Pathname of file to be deleted (does not fail if file does not exist)

Delete Directory (does not fail if directory does not exist) CFDP_DENY_DIR (1) Path of directory to be removed (does not fail if directory does not exist)
[in]first_pathnameThe full pathname of the first parameter in a filestore action.
[in]second_pathnameThe full pathname of the second parameter (if any) in a filestore action.
[in]destination_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
cfdp_filestore_action_type cfdp_filestore_action;
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
cfdp_filestore_action = CFDP_RENAME_FILE;
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddFilestoreComponentRequestION(cfdp_filestore_action,
"D:/source_pathname",
"D:/destination_pathname",
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
bp_class_of_service_type
Definition: bp_shared.h:44
@ BPD_STD_PRIORITY
Standard priority BP class of service.
Definition: bp_shared.h:47
bp_transmission_mode_type
Definition: bp_shared.h:29
@ BPD_ASSURED
Assured BP transmission mode.
Definition: bp_shared.h:32
bp_criticality_type
Definition: bp_shared.h:37
@ BPD_NOT_CRITICAL
Not critical BP criticality.
Definition: bp_shared.h:39
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreComponentRequestION(cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Adds a filestore request (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using filestore components,...
Definition: toolkit_cfdp_api_ansi_c.cpp:3969
Examples
cfdp_bp_filestore_example/main.c.

◆ AddFilestoreRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreRequest ( const char *  filestore_primitive)

Adds a filestore request (e.g., create_file, delete_file, rename_file ...) using a CFDP primitive string. Supports both Native and ION CFDP.

Parameters
[in]filestore_primitiveCFDP primitive (e.g., rename_file 86400/STD_PRIORITY/0/BEST_EFFORT/NO_CUSTODY_REQUIRED "old_pathname" 2 "new_pathname").
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_PRIMITIVE
CFDP_FILESTORE_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
char primitive[256];
sprintf(primitive, "rename_file //// %s 100 %s\r\n",
"\"D:/old_pathname\"",
"\"D:/new_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddFilestoreRequest(primitive);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddFilestoreRequest(const char *filestore_primitive)
Adds a filestore request (e.g., create_file, delete_file, rename_file ...) using a CFDP primitive str...
Definition: toolkit_cfdp_api_ansi_c.cpp:3589

◆ AddGet()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGet ( const char *  source_pathname,
const char *  destination_pathname,
long long  source_eid 
)

Adds a "get" file request, using the common components of a "get" primitive string, to the list of CFDP "get" requests. Supports both Native and ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]source_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
Note
Get will use the transmission parameters in the source library's configuration file when executing the file transfer. The transmission parameters include class1 or class2 for GSFC's native CFDP implementation or priority, mode and criticality for ION's BP CFDP implementation.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddGet("D:/source_pathname",
"D:/destination_pathname",
100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGet(const char *source_pathname, const char *destination_pathname, long long source_eid)
Adds a "get" file request, using the common components of a "get" primitive string,...
Definition: toolkit_cfdp_api_ansi_c.cpp:2128
Examples
cfdp_bp_get_example/main.c.

◆ AddGetComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetComponentRequest ( const char *  source_pathname,
const char *  destination_pathname,
long long  source_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Adds a "get" file request, using "get" components, to the list of CFDP "get" requests. Supports Native CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]source_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
AddGetComponentRequest does not initiate the file transfer. SendAllGetRequests or SendAllRequests initiates the transfer of files in the "get" list. CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
{
}
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetComponentRequest(const char *source_pathname, const char *destination_pathname, long long source_eid, cfdp_class_of_service_type cfdp_class_of_service)
Adds a "get" file request, using "get" components, to the list of CFDP "get" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:2316
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllGetRequests()
Removes all "get" file request in the list of CFDP "get" requests. Supports both Native and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:2741
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllGetRequests()
Initiates all "get" file requests in the list of CFDP "get" requests. Supports both Native and ION CF...
Definition: toolkit_cfdp_api_ansi_c.cpp:2561
Examples
cfdp_get_example_2/main.c.

◆ AddGetComponentRequestION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetComponentRequestION ( const char *  source_pathname,
const char *  destination_pathname,
long long  source_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Adds a "get" file request, using "get" components, to the list of CFDP "get" requests. Supports ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]source_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddGetComponentRequestION("D:/source_pathname",
"D:/destination_pathname",
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetComponentRequestION(const char *source_pathname, const char *destination_pathname, long long source_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Adds a "get" file request, using "get" components, to the list of CFDP "get" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:2481
Examples
cfdp_bp_get_example/main.c.

◆ AddGetRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetRequest ( const char *  get_primitive)

Adds a "get" file request, using a "get" primitive string, to the list of CFDP "get" requests. Supports both Native and ION CFDP.

Parameters
[in]get_primitiveCFDP primitive (e.g., get class2 "source_file_pathname" 2 "destination_file_pathname", get //// "source_file_pathname" 2 "destination_file_pathname").
Note
AddGetRequest does not initiate the file transfer. SendAllGetRequests or SendAllRequests initiates the transfer of files in the "get" list.
Returns
SUCCESS
FAIL
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_GET_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
CFDP_INVALID_GET_PRIMITIVE

Example:

char primitive[256];
sprintf(primitive, "get class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"\"D:/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetRequest(primitive) == SUCCESS)
{
{
}
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddGetRequest(const char *get_primitive)
Adds a "get" file request, using a "get" primitive string, to the list of CFDP "get" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:2216

◆ AddMessage()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessage ( const char *  message,
long long  destination_eid 
)

Adds a message transfer request to the list of CFDP message requests. Supports both Native and ION CFDP.

Parameters
[in]messageA string no greater than 256 characters in length including the NULL terminator.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_ACTION
Note
The message will use the transmission parameters in the source library's configuration file when transmitting the message. The transmission parameters include priority, mode and criticality.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddMessage("Hello world",100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessage(const char *message, long long destination_eid)
Adds a message transfer request to the list of CFDP message requests. Supports both Native and ION CF...
Definition: toolkit_cfdp_api_ansi_c.cpp:4761

◆ AddMessageComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageComponentRequest ( const char *  message,
long long  destination_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Adds a "message" request, using "message" components, to the list of CFDP "message" requests. Supports Native CFDP.

Parameters
[in]messageA string no greater than 256 characters in length including the NULL terminator.
[in]destination_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
AddMessageComponentRequest does not initiate the message transfer. SendAllMessageRequests or SendAllMessages initiates the transfer of the "message" list. CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddMessageComponentRequest("Hello world",
100,
CFDP_CLASS2) == SUCCESS)
{
{
}
}
}
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllMessageRequests()
Removes all message transfer requests in the list of CFDP filestore requests. Supports both Native an...
Definition: toolkit_cfdp_api_ansi_c.cpp:5301
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllMessageRequests()
Initiates all message transfer requests in the list of CFDP message requests. Supports both Native an...
Definition: toolkit_cfdp_api_ansi_c.cpp:5129
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageComponentRequest(const char *message, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
Adds a "message" request, using "message" components, to the list of CFDP "message" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:4905

◆ AddMessageComponentRequestION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageComponentRequestION ( const char *  message,
long long  destination_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Adds a message transfer request, using the components of a CFDP primitive string, to the list of CFDP message requests. Supports ION CFDP.

Parameters
[in]messageA string no greater than 256 characters in length including the NULL terminator.
[in]destination_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
char message[256];
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
strcpy(message,"Hello world");
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddMessageComponentRequestION(message,
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageComponentRequestION(const char *message, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Adds a message transfer request, using the components of a CFDP primitive string, to the list of CFDP...
Definition: toolkit_cfdp_api_ansi_c.cpp:5068

◆ AddMessageRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageRequest ( const char *  message_primitive)

Adds a message transfer request, using a CFDP primitive string, to the list of CFDP message requests. Supports both Native and ION CFDP.

Parameters
[in]message_primitiveCFDP primitive (e.g., message class2 "Hello world" 100, message 86400/STD_PRIORITY/0/BEST_EFFORT/NO_CUSTODY_REQUIRED "Hello world" 100).
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
char primitive[256];
sprintf(primitive, "message //// %s 100\r\n",
"\"Hello world\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddMessageRequest(primitive);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddMessageRequest(const char *message_primitive)
Adds a message transfer request, using a CFDP primitive string, to the list of CFDP message requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:4820

◆ AddPut()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPut ( const char *  source_pathname,
const char *  destination_pathname,
long long  destination_eid 
)

Adds a "put" file request, using the common components of a "put" primitive string, to the list of CFDP "put" requests. Supports both Native and ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
Note
Put will use the transmission parameters in the source library's configuration file when executing the file transfer. The transmission parameters include class1 or class2 for GSFC's native CFDP implementation or priority, mode and criticality for ION's CFDP BP implementation.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddPut("D:/source_pathname",
"D:/destination_pathname",
100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPut(const char *source_pathname, const char *destination_pathname, long long destination_eid)
Adds a "put" file request, using the common components of a "put" primitive string,...
Definition: toolkit_cfdp_api_ansi_c.cpp:1038
Examples
cfdp_bp_put_example/main.c.

◆ AddPutComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutComponentRequest ( const char *  source_pathname,
const char *  destination_pathname,
long long  destination_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Adds a "put" file request, using "put" components, to the list of CFDP "put" requests. Supports Native CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]destination_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
AddPutComponentRequest does not initiate the file transfer. SendAllPutRequests or SendAllRequests initiates the transfer of files in the "put" list. CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddPutComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
{
}
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutComponentRequest(const char *source_pathname, const char *destination_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
Adds a "put" file request, using "put" components, to the list of CFDP "put" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:1225
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllPutRequests()
Initiates all "put" file requests in the list of CFDP "put" requests. Supports both Native and ION CF...
Definition: toolkit_cfdp_api_ansi_c.cpp:1469
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllPutRequests()
Removes all "put" file request in the list of CFDP "put" requests. Supports both Native and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:1650
Examples
cfdp_put_example_2/main.c.

◆ AddPutComponentRequestION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutComponentRequestION ( const char *  source_pathname,
const char *  destination_pathname,
long long  destination_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Adds a "put" file request, using "put" components, to the list of CFDP "put" requests. Supports ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]destination_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddPutComponentRequestION("D:/source_pathname",
"D:/destination_pathname",
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutComponentRequestION(const char *source_pathname, const char *destination_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Adds a "put" file request, using "put" components, to the list of CFDP "put" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:1389
Examples
cfdp_bp_put_example/main.c.

◆ AddPutRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutRequest ( const char *  put_primitive)

Adds a "put" file request, using a "put" primitive string, to the list of CFDP "put" requests. Supports both Native and ION CFDP.

Parameters
[in]put_primitiveCFDP primitive (e.g., put class2 "source_file_pathname" 2 "destination_file_pathname", put //// "source_file_pathname" 2 "destination_file_pathname").
Note
AddPutRequest does not initiate the file transfer. SendAllPutRequests or SendAllRequests initiates the transfer of files in the "put" list.
Returns
SUCCESS
FAIL
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_PUT_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
CFDP_INVALID_PUT_PRIMITIVE

Example:

char primitive[256];
sprintf(primitive, "put class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"\"D:/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddPutRequest(primitive) == SUCCESS)
{
{
}
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION AddPutRequest(const char *put_primitive)
Adds a "put" file request, using a "put" primitive string, to the list of CFDP "put" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:1125

◆ AddRequest()

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 transactions. Supports both NATIVE and ION CFDP.

Parameters
[in]primitiveCFDP primitive (e.g., put class2 "source_file_pathname" 2 "destination_file_pathname",
get class2 "source_file_pathname" 2 "destination_file_pathname"
or
put //// "source_file_pathname" 2 "destination_file_pathname",
get //// "source_file_pathname" 2 "destination_file_pathname").
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_PUT_PRIMITIVE
CFDP_PUT_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
char primitive[256];
sprintf(primitive, "put class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"\"D:/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddRequest(primitive);
}
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
Examples
trek_cfdp_console.cpp.

◆ BitRate()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION BitRate ( unsigned int  bit_rate,
long long  destination_eid 
)

Changes the current aggregate bit rate of files being transferred by the targeted eid. Supports Native CFDP.

Parameters
[in]bit_rateThe aggregate file transfer rate in bits per second.
[in]destination_eidThe integer value of the local or remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
CFDP_INVALID_AGGREGATE_FILE_TRANSFER_RATE
CFDP_INVALID_FILESTORE_ACTION
Note
The bit rate function uses a TReK CFDP message to send the bit rate change request to a remote eid. The destination eid must be hosting the TReK CFDP software for this function to succeed. The CFDP Blue Book standard does not support bit rate change requests. The destination entity ID may be set to the host's entity ID. A TReK CFDP message is not generated if the destination entity ID is set to the host's entity ID.

Example:

int return_value;
unsigned int bit_rate;
bit_rate = 1000000;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
BitRate = Message(bit_rate,100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION BitRate(unsigned int bit_rate, long long destination_eid)
Changes the current aggregate bit rate of files being transferred by the targeted eid....
Definition: toolkit_cfdp_api_ansi_c.cpp:5668
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Message(const char *message, long long destination_eid)
Initiates a message transfer. Supports both Native and ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:4355

◆ CancelAllCFDPTransactions()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION CancelAllCFDPTransactions ( )

Cancel all CFDP file transactions. Supports both NATIVE and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PutComponentCFDP(const char *source_pathname, const char *destination_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
Initiates a "put" file transfer using the components of a CFDP primitive string. Supports Native CFDP...
Definition: toolkit_cfdp_api_ansi_c.cpp:789
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
Examples
trek_cfdp_console.cpp.

◆ CancelCFDPTransaction()

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.

Parameters
[in]transaction_idThe CFDP transaction ID
Returns
SUCCESS
DS_NULL_POINTER_ERROR
Note
The transaction ID string is a combination of the decimal dotted notation EID and transaction number (e.g., 1_1, 255.255_2...) for native CFDP or the node number/EID and transaction number (e.g., 1_1, 3210_2...) for ION CFDP and can be found in some of the messages generated by the CFDP library and in the cfdp_struct that is returned by the RegisterDeviceData callback function.
Examples
trek_cfdp_console.cpp.

◆ CancelTheCFDPTransaction()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION CancelTheCFDPTransaction ( const char *  destination_pathname,
long long  destination_eid 
)

Cancel a CFDP file transaction using a destination pathname and destination entity ID. This function will not cancel a CFDP file transaction if the cancel call is made immediately after submitting the CFDP file transaction and prior to the CFDP file transaction creating a transaction ID. Supports both NATIVE and ION CFDP.

Parameters
[in]destination_pathnameThe full path and filename of the CFDP transaction.
[in]destination_eidThe destination entity ID of the CFDP transaction.
Returns
SUCCESS
DS_NULL_POINTER_ERROR
Note
Because the transaction ID may not be known, this method provides an alternative mechanism for identifying a CFDP file transaction.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
CancelTheCFDPTransaction("D:/destination_pathname",100);
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION CancelTheCFDPTransaction(const char *destination_pathname, long long destination_eid)
Cancel a CFDP file transaction using a destination pathname and destination entity ID....
Definition: toolkit_cfdp_api_ansi_c.cpp:6172

◆ Filestore()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Filestore ( cfdp_filestore_action_type  filestore_action,
const char *  first_pathname,
const char *  second_pathname,
long long  destination_eid 
)

Initiates a filestore action using the common components of a filestore primitive string. Supports both Native and ION CFDP.

Parameters
[in]filestore_actionThe filestore action for the CFDP transaction. The cfdp_filestore_action_type is defined in the file "cfdp_shared.h".
Not all filestore actions require two pathnames. The second pathname is ignored if it is not required. The following table identifies the cfdp_filestore_action_type and defines its required pathname parameter(s):
Filestore Action cfdp_filestore_action_type

Pathname Parameter(s)

Create File CFDP_CREATE_FILE

(1) Pathname of new file

Delete File CFDP_DELETE_FILE

(1) Pathname of file to be deleted

Rename File CFDP_RENAME_FILE

(1) Pathname of old file
(2) Pathname of new file

Append File CFDP_APPEND_FILE

(1) Pathname whose name and content forms first part of new file
(2) Pathname whose content forms second part of new file

Replace File CFDP_REPLACE_FILE

(1) Pathname of file to be replaced
(2) Pathname of file whose content will replace the first file's content

Create Directory CFDP_CREATE_DIR

(1) Path of new directory

Remove Directory CFDP_REMOVE_DIR

(1) Path of directory to be removed

Delete File (does not fail if file does not exist) CFDP_DENY_FILE

(1) Pathname of file to be deleted (does not fail if file does not exist)

Delete Directory (does not fail if directory does not exist) CFDP_DENY_DIR (1) Path of directory to be removed (does not fail if directory does not exist)
[in]first_pathnameThe full pathname of the first parameter in a filestore action.
[in]second_pathnameThe full pathname of the second parameter (if any) in a filestore action.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_ACTION
Note
The filestore action will use the transmission parameters in the source library's configuration file when executing the filestore transaction. The transmission parameters include priority, mode and criticality.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = Filestore(cfdp_filestore_action,
"D:/first_pathname",
"D:/second_pathname",100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Filestore(cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid)
Initiates a filestore action using the common components of a filestore primitive string....
Definition: toolkit_cfdp_api_ansi_c.cpp:2864
Examples
cfdp_bp_filestore_example/main.c, and cfdp_filestore_example/main.c.

◆ FilestoreCFDP()

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 string. Supports both Native and ION CFDP.

Parameters
[in]filestore_primitiveCFDP primitive (e.g., rename_file 86400/STD_PRIORITY/0/BEST_EFFORT/NO_CUSTODY_REQUIRED "old_pathname" 2 "new_pathname").
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_PRIMITIVE
CFDP_FILESTORE_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
char primitive[256];
sprintf(primitive, "rename_file //// %s 100 %s\r\n",
"\"D:/old_pathname\"",
"\"D:/new_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = FilestoreCFDP(primitive);
}
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
Examples
trek_cfdp_console.cpp.

◆ FilestoreComponent()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FilestoreComponent ( cfdp_filestore_action_type  filestore_action,
const char *  first_pathname,
const char *  second_pathname,
long long  destination_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Initiates a filestore action (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using the components of a CFDP primitive string. Supports Native CFDP.

Parameters
[in]filestore_actionThe filestore action for the CFDP transaction. The cfdp_filestore_action_type is defined in the file "cfdp_shared.h".
Not all filestore actions require two pathnames. The second pathname is ignored if it is not required. The following table identifies the cfdp_filestore_action_type and defines its required pathname parameter(s):
Filestore Action cfdp_filestore_action_type

Pathname Parameter(s)

Create File CFDP_CREATE_FILE

(1) Pathname of new file

Delete File CFDP_DELETE_FILE

(1) Pathname of file to be deleted

Rename File CFDP_RENAME_FILE

(1) Pathname of old file
(2) Pathname of new file

Append File CFDP_APPEND_FILE

(1) Pathname whose name and content forms first part of new file
(2) Pathname whose content forms second part of new file

Replace File CFDP_REPLACE_FILE

(1) Pathname of file to be replaced
(2) Pathname of file whose content will replace the first file's content

Create Directory CFDP_CREATE_DIR

(1) Path of new directory

Remove Directory CFDP_REMOVE_DIR

(1) Path of directory to be removed

Delete File (does not fail if file does not exist) CFDP_DENY_FILE

(1) Pathname of file to be deleted (does not fail if file does not exist)

Delete Directory (does not fail if directory does not exist) CFDP_DENY_DIR (1) Path of directory to be removed (does not fail if directory does not exist)
[in]first_pathnameThe full pathname of the first parameter in a filestore action.
[in]second_pathnameThe full pathname of the second parameter (if any) in a filestore action.
[in]destination_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
cfdp_filestore_action_type cfdp_filestore_action;
cfdp_filestore_action = CFDP_RENAME_FILE;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = FilestoreComponent(cfdp_filestore_action,
"D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FilestoreComponent(cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
Initiates a filestore action (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using the components of a...
Definition: toolkit_cfdp_api_ansi_c.cpp:3116
Examples
cfdp_filestore_example/main.c.

◆ FilestoreComponentION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FilestoreComponentION ( cfdp_filestore_action_type  filestore_action,
const char *  first_pathname,
const char *  second_pathname,
long long  destination_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Initiates a filestore action (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using the components of a CFDP primitive string. Supports ION CFDP.

Parameters
[in]filestore_actionThe filestore action for the CFDP transaction. The cfdp_filestore_action_type is defined in the file "cfdp_shared.h".
Not all filestore actions require two pathnames. The second pathname is ignored if it is not required. The following table identifies the cfdp_filestore_action_type and defines its required pathname parameter(s):
Filestore Action cfdp_filestore_action_type

Pathname Parameter(s)

Create File CFDP_CREATE_FILE

(1) Pathname of new file

Delete File CFDP_DELETE_FILE

(1) Pathname of file to be deleted

Rename File CFDP_RENAME_FILE

(1) Pathname of old file
(2) Pathname of new file

Append File CFDP_APPEND_FILE

(1) Pathname whose name and content forms first part of new file
(2) Pathname whose content forms second part of new file

Replace File CFDP_REPLACE_FILE

(1) Pathname of file to be replaced
(2) Pathname of file whose content will replace the first file's content

Create Directory CFDP_CREATE_DIR

(1) Path of new directory

Remove Directory CFDP_REMOVE_DIR

(1) Path of directory to be removed

Delete File (does not fail if file does not exist) CFDP_DENY_FILE

(1) Pathname of file to be deleted (does not fail if file does not exist)

Delete Directory (does not fail if directory does not exist) CFDP_DENY_DIR (1) Path of directory to be removed (does not fail if directory does not exist)
[in]first_pathnameThe full pathname of the first parameter in a filestore action.
[in]second_pathnameThe full pathname of the second parameter (if any) in a filestore action.
[in]destination_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
cfdp_filestore_action_type cfdp_filestore_action;
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
cfdp_filestore_action = CFDP_RENAME_FILE;
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = FilestoreComponentION(cfdp_filestore_action,
"D:/source_pathname",
"D:/destination_pathname",
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FilestoreComponentION(cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Initiates a filestore action (e.g., CFDP_CREATE_FILE, CFDP_DELETE_FILE ...) using the components of a...
Definition: toolkit_cfdp_api_ansi_c.cpp:3357
Examples
cfdp_bp_filestore_example/main.c.

◆ FreeCFDPStructArrayMemoryAlloc()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FreeCFDPStructArrayMemoryAlloc ( cfdp_struct_type cfdp_struct_array_ptr)

Frees the memory associated with the cfdp_struct_array that was returned by MonitorAllCFDPTransactions. Supports both NATIVE and ION CFDP.

Problems may develop when freeing the memory associated with the cfdp_struct_array if the CFDP library's compiler or run time environment does not match the application code's compiler or run time environment. This method is provided to avoid those problems by freeing the memory in the same library that allocated it.

Example:

int return_value;
unsigned int transaction_count = 1;
unsigned int time_out_in_sec = 10;
// Allocate memory for the cfdp_struct_array
cfdp_struct_array_ptr = (cfdp_struct_type *)malloc(transaction_count *
sizeof(cfdp_struct_type));
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
return_value = MonitorAllCFDPTransactions(timeout_in_sec,
&transaction_count,
cfdp_struct_array_ptr);
}
}
// Free memory
FreeCFDPStructArrayMemoryAlloc(cfdp_struct_array_ptr);
Structure of parameters needed for CFDP transaction status.
Definition: ds_shared.h:145
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MonitorAllCFDPTransactions(unsigned int monitor_timeout, unsigned int *transaction_count_ptr, cfdp_struct_type **cfdp_struct_array_ptr)
Monitors the status of all CFDP transactions and returns when all the transactions have completed or ...
Definition: toolkit_cfdp_api_ansi_c.cpp:7577
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION FreeCFDPStructArrayMemoryAlloc(cfdp_struct_type *cfdp_struct_array_ptr)
Frees the memory associated with the cfdp_struct_array that was returned by MonitorAllCFDPTransaction...
Definition: toolkit_cfdp_api_ansi_c.cpp:7753
Examples
cfdp_bp_filestore_example/main.c, cfdp_bp_get_example/main.c, cfdp_bp_process_primitive_file/main.c, cfdp_bp_put_example/main.c, cfdp_filestore_example/main.c, cfdp_get_example_2/main.c, cfdp_process_primitive_file/main.c, and cfdp_put_example_2/main.c.

◆ Get()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Get ( const char *  source_pathname,
const char *  destination_pathname,
long long  source_eid 
)

Initiates a "get" file transfer using the common components of a "get" primitive string. Supports both Native and ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]source_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
Note
Get will use the transmission parameters in the source library's configuration file when executing the file transfer. The transmission parameters include class1 or class2 for GSFC's native CFDP implementation or priority, mode and criticality for ION's CFDP BP implementation.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = Get("D:/source_pathname",
"D:/destination_pathname",100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Get(const char *source_pathname, const char *destination_pathname, long long source_eid)
Initiates a "get" file transfer using the common components of a "get" primitive string....
Definition: toolkit_cfdp_api_ansi_c.cpp:1705
Examples
cfdp_bp_get_example/main.c.

◆ GetCFDP()

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.

Parameters
[in]get_primitiveCFDP primitive (e.g., get class2 "source_file_pathname" 2 "destination_file_pathname", get //// "source_file_pathname" 2 "destination_file_pathname").
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_GET_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
CFDP_INVALID_GET_PRIMITIVE

Example:

int return_value;
char primitive[256];
sprintf(primitive, "get class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"\"D:/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = GetCFDP(primitive);
}
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
Examples
trek_cfdp_console.cpp.

◆ GetComponentCFDP()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetComponentCFDP ( const char *  source_pathname,
const char *  destination_pathname,
long long  source_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Initiates a "get" file transfer using the components of a CFDP primitive string. Supports Native CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]source_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = GetComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetComponentCFDP(const char *source_pathname, const char *destination_pathname, long long source_eid, cfdp_class_of_service_type cfdp_class_of_service)
Initiates a "get" file transfer using the components of a CFDP primitive string. Supports Native CFDP...
Definition: toolkit_cfdp_api_ansi_c.cpp:1878
Examples
cfdp_get_example_1/main.c.

◆ GetComponentION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetComponentION ( const char *  source_pathname,
const char *  destination_pathname,
long long  source_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Initiates a "get" file transfer using the components of a CFDP primitive string. Supports ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]source_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = GetComponentION("D:/source_pathname",
"D:/destination_pathname",
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION GetComponentION(const char *source_pathname, const char *destination_pathname, long long source_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Initiates a "get" file transfer using the components of a CFDP primitive string. Supports ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:2042

◆ GetConfigurationAsString()

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 ION CFDP.

Parameters
[in]config_buffer_sizeThe size of the buffer that will store the configuration file as a string.
[out]config_bufferThe buffer that will store the configuration file as a string.
Returns
SUCCESS
CFDP_ARRAY_SIZE_ERROR
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
boolean_type display_flag;
char config_buffer[10000];
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
GetConfigurationAsString(10000,config_buffer);
}
boolean_type
Boolean enumeration.
Definition: ds_shared.h:104
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
Examples
trek_cfdp_console.cpp.

◆ GetDeviceMode()

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 library (DM_ION_CFDP or DM_NATIVE_CFDP CFDP). Supports both NATIVE and ION CFDP.

Parameters
[out]device_mode_ptrA pointer to a device_mode_type variable (DM_ION_CFDP or DM_NATIVE_CFDP CFDP).
Examples
trek_cfdp_console.cpp.

◆ GetDisplayConsoleMenuFlag()

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 command primitives. Supports both NATIVE and ION CFDP.

Parameters
[out]display_console_menu_flag_ptrDisplay variable of boolean type. The boolean_type is defined in the file "ds_shared.h" as follows:
boolean_type

Value

FALSE_OR_NO

0

TRUE_OR_YES 1
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
boolean_type display_flag;
RegisterPrintMessage(&PrintTheMessage);
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = GetDisplayConsoleMenuFlag(display_console_menu_flag_ptr);
}
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
Examples
trek_cfdp_console.cpp.

◆ GetDisplayMessageMask()

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 configuration file. The mask may be used to determine if a message should be displayed. Supports both NATIVE and ION CFDP.

An arithmetic "and" of the mask and the message category associated with a message will produce a value greater than zero if a message should be displayed.

Parameters
[out]display_mask_ptrA mask with bit locations representing the various enum message categories found in the file "trek_toolkit_common_api_ansi_c.h".
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
unsigned int mask;
// ////////////////////////////////////////////////////////////////////////////
//
// PrintTheMessage controls how messages are processed and displayed to
// the user.
//
// ////////////////////////////////////////////////////////////////////////////
void PrintTheMessage(message_struct_type *mess_struct_ptr)
{
if (mess_struct_ptr->category & mask)
{
printf("%s %s\n",GetMessageCategoryAsPaddedString(mess_struct_ptr->category),
}
}
RegisterPrintMessage(&PrintTheMessage);
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = GetDisplayMessageMask(&mask);
}
Structure of parameters needed for message support.
Definition: trek_toolkit_common_api_ansi_c.h:74
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
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
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
Examples
cfdp_bp_destination/main.c, cfdp_bp_filestore_example/main.c, cfdp_bp_get_example/main.c, cfdp_bp_process_primitive_file/main.c, cfdp_bp_put_example/main.c, cfdp_destination/main.c, cfdp_filestore_example/main.c, cfdp_get_example_1/main.c, cfdp_get_example_2/main.c, cfdp_process_primitive_file/main.c, cfdp_put_example_1/main.c, cfdp_put_example_2/main.c, and trek_cfdp_console.cpp.

◆ InitToolkitCfdp()

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 ION CFDP.

Parameters
[in]config_pathnameThe full path and filename of the CFDP configuration file.
Note
If the CFDP library's device mode is configured to use the GSFC's native CFDP, InitToolkitCfdp creates the UDP socket that communicates with the network and the CFDP library.
Returns
SUCCESS
CFDP_OPEN_FILE_ERROR
CFDP_INVALID_EID
DS_LIBRARY_LOAD_ERROR
DS_LIBRARY_ADDRESS_ERROR
DS_THREAD_START_ERROR
DS_THREAD_TIMEOUT
CFDP_FAILED_TO_POPULATE_COLLECTION
CFDP_INVALID_ACK_TIMEOUT
CFDP_INVALID_NAK_TIMEOUT
CFDP_INVALID_INACTIVITY_TIMEOUT
CFDP_INVALID_FILE_CHUNK_SIZE
CFDP_INVALID_CONFIG_FILE
DS_NULL_POINTER_ERROR
DS_NAMED_PIPE_CREATION_ERROR
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP

Example:

int return_value;
char pathname[50];
strcpy(pathname,"./cfdp_config.txt");
return_value = InitToolkitCfdp(pathname);
Examples
cfdp_bp_destination/main.c, cfdp_bp_filestore_example/main.c, cfdp_bp_get_example/main.c, cfdp_bp_process_primitive_file/main.c, cfdp_bp_put_example/main.c, cfdp_destination/main.c, cfdp_filestore_example/main.c, cfdp_get_example_1/main.c, cfdp_get_example_2/main.c, cfdp_process_primitive_file/main.c, cfdp_put_example_1/main.c, cfdp_put_example_2/main.c, and trek_cfdp_console.cpp.

◆ InitToolkitCfdpAndCryptPassphrase()

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 ION CFDP.

Parameters
[in]config_pathnameThe full path and filename of the CFDP configuration file.
[in]crypt_user_passphraseThe passphrase used to unwrap/decrypt the Elliptic Curve Cryptography (ECC) private key.
Note
If the CFDP library's device mode is configured to use the GSFC's native CFDP, InitToolkitCfdp creates the UDP socket that communicates with the network and the CFDP library.
Returns
SUCCESS
CFDP_OPEN_FILE_ERROR
CFDP_INVALID_EID
DS_LIBRARY_LOAD_ERROR
DS_LIBRARY_ADDRESS_ERROR
DS_THREAD_START_ERROR
DS_THREAD_TIMEOUT
CFDP_FAILED_TO_POPULATE_COLLECTION
CFDP_INVALID_ACK_TIMEOUT
CFDP_INVALID_NAK_TIMEOUT
CFDP_INVALID_INACTIVITY_TIMEOUT
CFDP_INVALID_FILE_CHUNK_SIZE
CFDP_INVALID_CONFIG_FILE
DS_NULL_POINTER_ERROR
DS_NAMED_PIPE_CREATION_ERROR
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP

Example:

int return_value;
char pathname[50];
char crypt_kek_passphrase[64];
strcpy(pathname,"./cfdp_config.txt");
strcpy(crypt_kek_passphrase,"123456!@#$%^QWERTasdfg");
return_value = InitToolkitCfdpAndCryptPassphrase(pathname,crypt_kek_passphrase);
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
Examples
trek_cfdp_console.cpp.

◆ Message()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Message ( const char *  message,
long long  destination_eid 
)

Initiates a message transfer. Supports both Native and ION CFDP.

Parameters
[in]messageA string no greater than 256 characters in length including the NULL terminator.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_ACTION
Note
The message will use the transmission parameters in the source library's configuration file when transmitting the message. The transmission parameters include priority, mode and criticality.

Example:

int return_value;
char message[256];
strcpy(message,"Hello world");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = Message(message,100);
}

◆ MessageCFDP()

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.

Parameters
[in]message_primitiveCFDP primitive (e.g., message class2 "Hello world" 100, message 86400/STD_PRIORITY/0/BEST_EFFORT/NO_CUSTODY_REQUIRED "Hello world" 100).
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
char primitive[256];
sprintf(primitive, "message //// %s 100\r\n",
"\"Hello world\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = MessageCFDP(primitive);
}
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
Examples
trek_cfdp_console.cpp.

◆ MessageComponent()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MessageComponent ( const char *  message,
long long  destination_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Initiates a "message" transfer using the components of a CFDP primitive string. Supports Native CFDP.

Parameters
[in]messageA string no greater than 256 characters in length including the NULL terminator.
[in]destination_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = MessageComponent("Hello world",
100,
CFDP_CLASS2);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MessageComponent(const char *message, long long destination_eid, cfdp_class_of_service_type cfdp_class_of_service)
Initiates a "message" transfer using the components of a CFDP primitive string. Supports Native CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:4520

◆ MessageComponentION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MessageComponentION ( const char *  message,
long long  destination_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Initiates a message transfer using the components of a CFDP primitive string. Supports ION CFDP.

Parameters
[in]messageA string no greater than 256 characters in length including the NULL terminator.
[in]destination_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
char message[256];
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
strcpy(message,"Hello world");
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = MessageComponentION(message,
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MessageComponentION(const char *message, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Initiates a message transfer using the components of a CFDP primitive string. Supports ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:4682

◆ MonitorAllCFDPTransactions()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION MonitorAllCFDPTransactions ( unsigned int  monitor_timeout,
unsigned int *  transaction_count_ptr,
cfdp_struct_type **  cfdp_structure_array_ptr 
)

Monitors the status of all CFDP transactions and returns when all the transactions have completed or the monitor time, in seconds, expires. Supports both NATIVE and ION CFDP.

The monitor time value should be set to the length of time in seconds needed to complete all the transactions. A cfdp_struct_array is returned with the transaction_count and status of all the transactions. The user is responsible for providing the current number of transaction as an input parameter and deallocating or freeing the memory associated with the cfdp_struct_array (i.e, free cfdp_struct_array_ptr) upon successful return of the function. Problems may develop when freeing the memory associated with the cfdp_struct_array if the CFDP library's compiler or run time environment does not match the application code's compiler or run time environment. The FreeCFDPStructArrayMemoryAlloc function is provided to avoid those problems by freeing the memory in the same library that allocated it. The cfdp_struct's cfdp_status variable may be used to determine the final status of each transaction.

Parameters
[in]monitor_timeoutThe maximum time, in seconds, the function should monitor the completion status of transactions.
[in,out]transaction_count_ptrA pointer to the number of cfdp_structs that the array can hold (maximum value is 204800). The pointer's value is reset to the actual number of transactions/cfdp_structs upon SUCCESS or DS_ARRAY_SIZE_ERROR.
[out]cfdp_structure_array_ptrThe array containing the cfdp_structs defined in the file "ds_shared.h" as follows:
Data Type

Member Variable Name

char

source_pathname

char

destination_pathname

long long

eid

char

transaction_id

unsigned short

percent_transferred

unsigned long

bytes_transferred

unsigned long

file_size

time_t

start_time

time_t

finish_time

time_t

suspend_time

time_t

resume_time

double

transaction_timespan

unsigned short

nak_count

char [256]

message

unsigned long

cfdp_filestore_action (e.g., CFDP_UNDEFINED_FILESTORE_ACTION_TYPE, CFDP_CREATE_FILE, CFDP_DELETE_FILE, CFDP_RENAME_FILE,...).

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_CANCEL, DS_SUCCESS, DS_FAIL, DS_ABANDON, DS_UNKNOWN)
Note
The CFDP configuration parameter "support_cfdp_status_requests" must be "true" for MonitorAllCFDPTransactions to operate correctly. If "support_cfdp_status_requests" is "false", MonitorAllCFDPTransactions returns CFDP_STATUS_REQUEST_ERROR and transaction_count is set to zero. MonitorAllCFDPTransactions does not return the status of user messages or CFDP user operations (i.e., proxy messages) and they are not included in the transaction_count.
Returns
SUCCESS
CFDP_STATUS_REQUEST_ERROR
DS_DEVICE_NOT_FOUND
DS_ARRAY_SIZE_ERROR
CFDP_TIMEOUT
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_TRANSACTION_COUNT

Example:

int return_value;
unsigned int transaction_count = 1;
unsigned int time_out_in_sec = 10;
cfdp_struct_type *cfdp_struct_array_ptr = NULL;
unsigned int i;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
return_value = MonitorAllCFDPTransactions(timeout_in_sec,
&transaction_count,
cfdp_struct_array_ptr);
if (return_value == SUCCESS || return_value == CFDP_TIMEOUT)
{
// Loop through the array of cfdp structs to determine the final
// status of each CFDP transaction
for (i=0; i<transaction_count;i++)
{
// Check for unsuccessful file transfer status (e.g.,DS_CANCEL,
// DS_FAIL, DS_ABANDON, DS_UNKNOWN)
if (cfdp_struct_array_ptr[i].cfdp_status == DS_SUCCESS)
{
// Take appropriate action
}
else
{
// Take appropriate action
printf("Info Failed to execute put file for destination pathname: %s and eid: %d.\n",
cfdp_struct_array_ptr[i].destination_pathname,
(int)cfdp_struct_array_ptr[i].eid);
}
}
// NOTE: Problems may develop when freeing the memory associated
// with the cfdp_struct_array if the CFDP library's compiler or
// run time environment does not match the application code's
// compiler or run time environment. This method is provided to
// avoid those problems. The code, "free(cfdp_struct_array_ptr)"
// will work if the library and application code's compilers
// are the same.
FreeCFDPStructArrayMemoryAlloc(cfdp_struct_array_ptr);
}
}
}
#define DS_SUCCESS
40 DS message code for Success
Definition: ds_shared.h:65
#define CFDP_TIMEOUT
The timer associated with the request expired.
Definition: toolkit_cfdp_api_error_codes.h:13
Examples
cfdp_bp_filestore_example/main.c, cfdp_bp_get_example/main.c, cfdp_bp_process_primitive_file/main.c, cfdp_bp_put_example/main.c, cfdp_filestore_example/main.c, cfdp_get_example_2/main.c, cfdp_process_primitive_file/main.c, and cfdp_put_example_2/main.c.

◆ PopulateCFDPStructArray()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PopulateCFDPStructArray ( unsigned int *  number_of_cfdp_structs_ptr,
cfdp_struct_type cfdp_struct_array_ptr 
)

Populates an array with cfdp structs describing current CFDP transactions. Supports both NATIVE and ION CFDP.

The cfdp_struct may be used to determine each file's transactions ID as well as monitor a file's transfer status. To enhance performance, the user must preallocate the cfdp_struct_array and provide the number_of_cfdp_structs that the cfdp_struct_array may populate. If this value is not large enough to hold the total number of cfdp_structs then DS_ARRAY_SIZE_ERROR is returned and number_of_cfdp_structs is updated with correct value for the cfdp_struct_array. The user may use the updated number_of_cfdp_structs value to preallocate the additional cfdp_structs in the cfdp_struct_array prior to calling PopulateCFDPStructArray a second time. The user is responsible for deallocating or freeing the memory associated with the cfdp_struct_array (i.e, free cfdp_struct_array_ptr) upon successful return of the function.

Parameters
[in,out]number_of_cfdp_structs_ptrA pointer to the number of cfdp_structs that the array can hold. The pointer's value is reset to the actual number of transactions/cfdp_structs upon SUCCESS or DS_ARRAY_SIZE_ERROR.
[out]cfdp_struct_array_ptrThe array containing the cfdp_structs. The cfdp_struct_type is defined in the file "ds_shared.h" as follows:
Data Type

Member Variable Name

char

source_pathname

char

destination_pathname

long long

eid

char

transaction_id

unsigned short

percent_transferred

unsigned long

bytes_transferred

unsigned long

file_size

time_t

start_time

time_t

finish_time

time_t

suspend_time

time_t

resume_time

double

transaction_timespan

unsigned short

nak_count

char [256]

message

unsigned long

cfdp_filestore_action (e.g., CFDP_UNDEFINED_FILESTORE_ACTION_TYPE, CFDP_CREATE_FILE, CFDP_DELETE_FILE, CFDP_RENAME_FILE,...).

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_CANCEL, DS_SUCCESS, DS_FAIL, DS_ABANDON, DS_UNKNOWN)
Note
The CFDP configuration parameter "support_cfdp_status_requests" must be "true" for PopulateCFDPStructArray to return the final transaction status (e.g.,DS_CANCEL, DS_SUCCESS, DS_FAIL, DS_ABANDON, DS_UNKNOWN) for a transaction. If "support_cfdp_status_requests" is "false", PopulateCFDPStructArray will only return the status of transactions that are currently sending or receiving packets (e.g., DS_PACKET_SENDING, DS_PACKET_RECEIVING, DS_SUSPEND, DS_RESUME). It does not return the status of user messages or CFDP user operations (i.e., proxy messages) and they are not included in the transaction_count.
Returns
SUCCESS
FAIL
CFDP_OPEN_FILE_ERROR
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_OPEN_FILE_ERROR
CFDP_INVALID_PRIMITIVE_FILE
CFDP_INVALID_PRIMITIVE_FILE_VERSION

Example:

int return_value;
cfdp_struct_type *cfdp_struct_array_ptr = NULL;
unsigned int transaction_count = 1;
unsigned int current_transaction_count = 0;
unsigned int final_transaction_count = transaction_count;
unsigned int number_of_cfdp_structs = 0;
unsigned int i;
// Allocate memory for the cfdp_struct_array
cfdp_struct_array_ptr = (cfdp_struct_type *)malloc(transaction_count *
sizeof(cfdp_struct_type));
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
// Wait for transaction to complete by checking to see if the transaction
// is still being processed using PopulateCFDPStructArray.
while (current_transaction_count != final_transaction_count)
{
// Set the number_of_cfdp_structs equal to the number of structs
// availiable in the array (i.e., every transaction will have a
// corresponding cfdp_struct in the array)
number_of_cfdp_structs = final_transaction_count;
// Get an array of the current CFDP transactions
if ((return_value = PopulateCFDPStructArray(&number_of_cfdp_structs,
cfdp_struct_array_ptr)) == DS_ARRAY_SIZE_ERROR)
{
// The cfdp_struct_array is not large enough to hold the current
// number of cfdp structs so allocate additional memory using the
// correct number_of_cfdp_structs returned by the
// GetCFDPStructArray function.
free(cfdp_struct_array_ptr);
cfdp_struct_array_ptr=(cfdp_struct_type *)malloc(number_of_cfdp_structs *
sizeof(cfdp_struct_type));
// Reset the final_transaction_count
final_transaction_count = number_of_cfdp_structs;
return_value = PopulateCFDPStructArray(&number_of_cfdp_structs,
cfdp_struct_array_ptr);
}
if (return_value == SUCCESS)
{
// Loop through the array
for (i=0; i<number_of_cfdp_structs;i++)
{
// Check to see if the transaction has completed the file
// transfer attempt
if (cfdp_struct_array_ptr[i].cfdp_status == DS_CANCEL ||
cfdp_struct_array_ptr[i].cfdp_status == DS_SUCCESS ||
cfdp_struct_array_ptr[i].cfdp_status == DS_FAIL ||
cfdp_struct_array_ptr[i].cfdp_status == DS_ABANDON ||
cfdp_struct_array_ptr[i].cfdp_status == DS_UNKNOWN)
{
// Check for unsuccessful file transfer status
//(e.g.,DS_CANCEL, DS_FAIL, DS_ABANDON, DS_UNKNOWN)
if (cfdp_struct_array_ptr[i].cfdp_status != DS_SUCCESS)
{
// Take appropriate action
printf("Info Failed to execute put file for destination pathname: %s and eid: %d.\n",
cfdp_struct_array_ptr[i].destination_pathname,
(int)cfdp_struct_array_ptr[i].eid);
}
// Increment count of completed transactions
current_transaction_count += 1;
}
}
// Sleep 1 second prior to checking status
#ifdef __linux__
sleep(1);
#else
Sleep(1000);
#endi
}
else
{
// Error getting CFDP status
return_value = FAIL;
printf("Error Failed to GetCFDPStructArray.\n");
current_transaction_count = final_transaction_count;
}
}
free(cfdp_struct_array_ptr);
}
}
#define DS_FAIL
41 DS message code for Fail
Definition: ds_shared.h:66
#define DS_UNKNOWN
43 DS message code for Unknown
Definition: ds_shared.h:68
#define DS_ABANDON
42 DS message code for Abandon
Definition: ds_shared.h:67
#define DS_CANCEL
39 DS message code for Cancel
Definition: ds_shared.h:64
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PopulateCFDPStructArray(unsigned int *number_of_cfdp_structs_ptr, cfdp_struct_type *cfdp_struct_array_ptr)
Populates an array with cfdp structs describing current CFDP transactions. Supports both NATIVE and I...
Definition: toolkit_cfdp_api_ansi_c.cpp:7379
#define DS_ARRAY_SIZE_ERROR
The size of the array is not large enough to hold the requested values.
Definition: toolkit_ds_api_error_codes.h:38
#define FAIL
The function failed for an unknown reason.
Definition: trek_error.h:9
Examples
cfdp_get_example_1/main.c, and cfdp_put_example_1/main.c.

◆ ProcessFileOfCFDPPrimitives()

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 appropriate transaction lists. All valid primitive files must begin with the text string "primitve_version" followed by a verision number and the TReK device mode (e.g., NATIVE_CFDP of ION_CFDP).
Files that do not contain the "primitve_version" text string are considered invalid and will not be read. Supports both NATIVE and ION CFDP.

Parameters
[in]pathnameThe full path and filename of the file of CFDP primitives.
[out]primitive_count_ptrThe count of CFDP primitives read from the file(s).
Note
In addition to reading the CFDP "put" and "get" primitives, ProcessFileOfCFDPPrimitives also supports a "process" primitive that references another file of CFDP primitives. The "process" primitive format is "process source_pathname".
Returns
SUCCESS
FAIL
CFDP_OPEN_FILE_ERROR
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

unsigned int primitive_count;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (ProcessFileOfCFDPPrimitives("D:/source_pathname",
&primitive_count) == SUCCESS)
{
}
}
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
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
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
Examples
cfdp_bp_process_primitive_file/main.c, cfdp_process_primitive_file/main.c, and trek_cfdp_console.cpp.

◆ Put()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Put ( const char *  source_pathname,
const char *  destination_pathname,
long long  destination_eid 
)

Initiates a "put" file transfer using the common components of a "put" primitive string. Supports both Native and ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
Note
Put will use the transmission parameters in the source library's configuration file when executing the file transfer. The transmission parameters include class1 or class2 for GSFC's native CFDP implementation or priority, mode and criticality for ION's CFDP BP implementation.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = Put("D:/source_pathname",
"D:/destination_pathname",100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION Put(const char *source_pathname, const char *destination_pathname, long long destination_eid)
Initiates a "put" file transfer using the common components of a "put" primitive string....
Definition: toolkit_cfdp_api_ansi_c.cpp:616
Examples
cfdp_bp_put_example/main.c.

◆ PutCFDP()

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.

Parameters
[in]put_primitiveCFDP primitive (e.g., put class2 "source_file_pathname" 2 "destination_file_pathname", put //// "source_file_pathname" 2 "destination_file_pathname").
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_PUT_PRIMITIVE
CFDP_PUT_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
char primitive[256];
sprintf(primitive, "put class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"\"D:/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = PutCFDP(primitive);
}
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
Examples
trek_cfdp_console.cpp.

◆ PutComponentCFDP()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PutComponentCFDP ( const char *  source_pathname,
const char *  destination_pathname,
long long  destination_eid,
cfdp_class_of_service_type  cfdp_class_of_service 
)

Initiates a "put" file transfer using the components of a CFDP primitive string. Supports Native CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]destination_eidThe integer value of remote entity ID.
[in]cfdp_class_of_serviceThe class of service for the CFDP transaction. The cfdp_class_of_service_type is defined in the file "cfdp_shared.h" as follows:
CFDP Service Class

cfdp_class_of_service_type

Class 1 Unreliable Transfer

CFDP_CLASS1

Class 2 Reliable Transfer CFDP_CLASS2
Note
CFDP_CLASS2 requires two way communication to support PDU/packet retransmission.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2);
}
Examples
cfdp_put_example_1/main.c.

◆ PutComponentION()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PutComponentION ( const char *  source_pathname,
const char *  destination_pathname,
long long  destination_eid,
unsigned int  lifespan,
bp_class_of_service_type  cos,
unsigned int  ordinal,
bp_transmission_mode_type  mode,
bp_criticality_type  criticality 
)

Initiates a "put" file transfer using the components of a CFDP primitive string. Supports ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]destination_eidThe integer value of remote entity ID.
[in]lifespanThe bundle's time to live.
[in]cosThe BP class of service priority. The bp_class_of_service_type is defined in the file "bp_shared.h" as follows:
BP Service Class

bp_class_of_service_type

Lowest Priority Bundle Transfer

BPD_BULK_PRIORITY

Standard Priority Bundle Transfer

BPD_STD_PRIORITY

Highest Priority Bundle Transfer BPD_EXPEDITED_PRIORITY
[in]ordinalOnly valid for expedited priority bundle transfer. Range from 0-254 with 254 as highest priority
[in]modeThe BP transmission mode.
The bp_transmission_mode_type is defined in the file "bp_shared.h" as follows:
BP Transmission Mode

bp_transmission_mode_type

Delivery Guaranteed by Convergence Layer Protocol

BPD_BEST_EFFORT

Delivery Guaranteed by BP Layer Protocol

BPD_ASSURED

Delivery Guaranteed by BP Custody Transfer BPD_ASSURED_WITH_CUSTODY_TRANSFER
[in]criticalityThe BP cricality. The bp_criticality_type is defined in the file "bp_shared.h" as follows:
BP Criticality

bp_criticality_type

Not Critical

BPD_NOT_CRITICAL

Critical BPD_CRITICAL
Note
Critical or minimum latency requires contact graph routing and no custody transfer.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
unsigned int lifespan;
unsigned int ordinal;
bp_criticality_type criticality;
lifespan = 86400;
ordinal = 0;
mode = BPD_ASSURED;
criticality = BPD_NOT_CRITICAL;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = PutComponentION("D:/source_pathname",
"D:/destination_pathname",
100,
lifespan,
cos,
ordinal,
mode,
criticality);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION PutComponentION(const char *source_pathname, const char *destination_pathname, long long destination_eid, unsigned int lifespan, bp_class_of_service_type cos, unsigned int ordinal, bp_transmission_mode_type mode, bp_criticality_type criticality)
Initiates a "put" file transfer using the components of a CFDP primitive string. Supports ION CFDP.
Definition: toolkit_cfdp_api_ansi_c.cpp:953

◆ RegisterCFDPDeviceData()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RegisterCFDPDeviceData ( void(*)(const char *device_key, int packet_length, unsigned char *packet_buffer_ptr)  function_ptr)

Register a callback function to receive cfdp_struct status messages for all transactions currently being processed by the CFDP library. Supports both NATIVE and ION CFDP.

Parameters
[in]function_ptrA pointer to the callback function.


Callback function:

Parameters
[out]device_keyA character string that uniquely identifies the CFDP "device" library.
[out]packet_lengthThe length of a cfdp_struct.
[out]packet_buffer_ptrA pointer to the cfdp_struct defined in the file "ds_shared.h" as follows:
Data Type

Member Variable Name

char

source_pathname

char

destination_pathname

long long

eid

char

transaction_id

unsigned short

percent_transferred

unsigned long

bytes_transferred

unsigned long

file_size

time_t

start_time

time_t

finish_time

time_t

suspend_time

time_t

resume_time

double

transaction_timespan

unsigned short

nak_count

char [256]

message

unsigned long

cfdp_filestore_action (e.g., CFDP_UNDEFINED_FILESTORE_ACTION_TYPE, CFDP_CREATE_FILE, CFDP_DELETE_FILE, CFDP_RENAME_FILE,...).

unsigned long

cfdp_configuration

unsigned long cfdp_status
Note
The CFDPDeviceData function may be used to monitor the progress of a CFDP transaction.
Returns
SUCCESS
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

void DeviceData(const char *device_key,
int packet_length,
unsigned char *packet_buffer_ptr)
{
cfdp_struct_type *cfdp_struct_ptr;
cfdp_struct_ptr = (cfdp_struct_type *)packet_buffer_ptr;
printf("Transaction_id %s -> %s\t file size=%lu\t bytes trans=%lu\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);
}
int main(int argc, char *argv[])
{
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (RegisterCFDPDeviceData(&DeviceData) != SUCCESS)
{
printf("Error\tFailed to RegisterCFDPDeviceData.\n");
}
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}
}
char destination_pathname[256]
Destination path and filename.
Definition: ds_shared.h:147
unsigned short percent_transferred
Bytes transferred divided by file size. Will reset with packet/PDU retransmissions.
Definition: ds_shared.h:150
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
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
Examples
cfdp_bp_destination/main.c, cfdp_bp_filestore_example/main.c, cfdp_bp_get_example/main.c, cfdp_bp_process_primitive_file/main.c, cfdp_bp_put_example/main.c, cfdp_destination/main.c, cfdp_filestore_example/main.c, cfdp_get_example_1/main.c, cfdp_get_example_2/main.c, cfdp_process_primitive_file/main.c, cfdp_put_example_1/main.c, cfdp_put_example_2/main.c, and trek_cfdp_console.cpp.

◆ RemoveAllFilestoreRequests()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllFilestoreRequests ( )

Removes all filestore request from the list of CFDP filestore requests. Supports both Native and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddFilestore(cfdp_filestore_action,
"D:/first_pathname",
"D:/second_pathname",100);
}
void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllFilestoreRequests()
Removes all filestore request from the list of CFDP filestore requests. Supports both Native and ION ...
Definition: toolkit_cfdp_api_ansi_c.cpp:4301

◆ RemoveAllGetRequests()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllGetRequests ( )

Removes all "get" file request in the list of CFDP "get" requests. Supports both Native and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}

◆ RemoveAllMessageRequests()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllMessageRequests ( )

Removes all message transfer requests in the list of CFDP filestore requests. Supports both Native and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddMessage("Hello world",100) == SUCCESS)
{
}
}

◆ RemoveAllPutRequests()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllPutRequests ( )

Removes all "put" file request in the list of CFDP "put" requests. Supports both Native and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddPutComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}

◆ RemoveAllRequests()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveAllRequests ( )

Removes all "put" and "get" file request and all filestore and message requests in the lists. Supports both NATIVE and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}
Examples
cfdp_bp_process_primitive_file/main.c, cfdp_process_primitive_file/main.c, and trek_cfdp_console.cpp.

◆ RemoveFilestoreComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveFilestoreComponentRequest ( cfdp_filestore_action_type  filestore_action,
const char *  first_pathname,
const char *  second_pathname,
long long  destination_eid 
)

Removes a filestore request, using the common components of a filestore primitive string, from the list of CFDP filestore requests. Supports both Native and ION CFDP.

Parameters
[in]filestore_actionThe filestore action for the CFDP transaction. The cfdp_filestore_action_type is defined in the file "cfdp_shared.h".
Not all filestore actions require two pathnames. The second pathname is ignored if it is not required. The following table identifies the cfdp_filestore_action_type and defines its required pathname parameter(s):
Filestore Action cfdp_filestore_action_type

Pathname Parameter(s)

Create File CFDP_CREATE_FILE

(1) Pathname of new file

Delete File CFDP_DELETE_FILE

(1) Pathname of file to be deleted

Rename File CFDP_RENAME_FILE

(1) Pathname of old file
(2) Pathname of new file

Append File CFDP_APPEND_FILE

(1) Pathname whose name and content forms first part of new file
(2) Pathname whose content forms second part of new file

Replace File CFDP_REPLACE_FILE

(1) Pathname of file to be replaced
(2) Pathname of file whose content will replace the first file's content

Create Directory CFDP_CREATE_DIR

(1) Path of new directory

Remove Directory CFDP_REMOVE_DIR

(1) Path of directory to be removed

Delete File (does not fail if file does not exist) CFDP_DENY_FILE

(1) Pathname of file to be deleted (does not fail if file does not exist)

Delete Directory (does not fail if directory does not exist) CFDP_DENY_DIR (1) Path of directory to be removed (does not fail if directory does not exist)
[in]first_pathnameThe full pathname of the first parameter in a filestore action.
[in]second_pathnameThe full pathname of the second parameter (if any) in a filestore action.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_ACTION
Note
The filestore action will use the transmission values in the source library's configuration file when executing the filestore transaction. The transmission values include priority, mode and criticality.

Example:

int return_value;
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddFilestore(cfdp_filestore_action,
"D:/first_pathname",
"D:/second_pathname",100);
return_value = RemoveFilestoreComponentRequest(cfdp_filestore_action,
"D:/first_pathname",
"D:/second_pathname",100);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveFilestoreComponentRequest(cfdp_filestore_action_type filestore_action, const char *first_pathname, const char *second_pathname, long long destination_eid)
Removes a filestore request, using the common components of a filestore primitive string,...
Definition: toolkit_cfdp_api_ansi_c.cpp:4243
Examples
cfdp_bp_filestore_example/main.c, and cfdp_filestore_example/main.c.

◆ RemoveFilestoreRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveFilestoreRequest ( const char *  filestore_primitive)

Removes a filestore request (e.g., create_file, delete_file, rename_file ...) using a filestore primitive string, from the list of CFDP filestore requests. Supports both Native and ION CFDP.

Parameters
[in]filestore_primitiveCFDP primitive (e.g., rename_file 86400/STD_PRIORITY/0/BEST_EFFORT/NO_CUSTODY_REQUIRED "old_pathname" 2 "new_pathname").
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_FILESTORE_PRIMITIVE
CFDP_FILESTORE_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE
CFDP_INVALID_FILESTORE_ACTION

Example:

int return_value;
char primitive[256];
sprintf(primitive, "rename_file //// %s 100 %s\r\n",
"\"D:/old_pathname\"",
"\"D:/new_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = AddFilestoreRequest(primitive);
return_value = RemoveFilestoreRequest(primitive);
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveFilestoreRequest(const char *filestore_primitive)
Removes a filestore request (e.g., create_file, delete_file, rename_file ...) using a filestore primi...
Definition: toolkit_cfdp_api_ansi_c.cpp:4103

◆ RemoveGetComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveGetComponentRequest ( const char *  source_pathname,
const char *  destination_pathname,
long long  source_eid 
)

Removes a "get" file request, using "get" components, from the list of CFDP "get" requests. Supports both Native and ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]source_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,CFDP_CLASS2) == SUCCESS)
{
RemoveGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100);
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveGetComponentRequest(const char *source_pathname, const char *destination_pathname, long long source_eid)
Removes a "get" file request, using "get" components, from the list of CFDP "get" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:2683
Examples
cfdp_bp_get_example/main.c, and cfdp_get_example_2/main.c.

◆ RemoveGetRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveGetRequest ( const char *  get_primitive)

Removes a "get" file request, using a "get" primitive string, from the list of CFDP "get" requests. Supports both Native and ION CFDP.

Parameters
[in]get_primitiveCFDP primitive (e.g., get class2 "source_pathname" remote_entity_id "destination_pathname").
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

char primitive[256];
sprintf(primitive, "get class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"D\":/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetRequest(primitive) == SUCCESS)
{
RemoveGetRequest(primitive);
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveGetRequest(const char *get_primitive)
Removes a "get" file request, using a "get" primitive string, from the list of CFDP "get" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:2618

◆ RemoveMessageComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveMessageComponentRequest ( const char *  message,
long long  destination_eid 
)

Removes a message transfer request, using message components, from the list of CFDP message requests. Supports both Native and ION CFDP.

Parameters
[in]messageA string no greater than 256 characters in length including the NULL terminator.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

char message[256];
strcpy(message,"Hello world");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddMessage(message,100) == SUCCESS)
{
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveMessageComponentRequest(const char *message, long long destination_eid)
Removes a message transfer request, using message components, from the list of CFDP message requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:5248

◆ RemoveMessageRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveMessageRequest ( const char *  message_primitive)

Removes a message transfer request, using a message primitive string, from the list of CFDP message requests. Supports both Native and ION CFDP.

Parameters
[in]message_primitiveCFDP primitive (e.g., message class2 "Hello world" 100, message 86400/STD_PRIORITY/0/BEST_EFFORT/NO_CUSTODY_REQUIRED "Hello world" 100).
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

char primitive[256];
sprintf(primitive, "message //// %s 100\r\n",
"\"Hello world\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddMessageRequest(primitive) == SUCCESS)
{
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemoveMessageRequest(const char *message_primitive)
Removes a message transfer request, using a message primitive string, from the list of CFDP message r...
Definition: toolkit_cfdp_api_ansi_c.cpp:5186

◆ RemovePutComponentRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemovePutComponentRequest ( const char *  source_pathname,
const char *  destination_pathname,
long long  destination_eid 
)

Removes a "put" file request, using "put" components, from the list of CFDP "put" requests. Supports both Native and ION CFDP.

Parameters
[in]source_pathnameThe full path and filename of the source file.
[in]destination_pathnameThe full path and filename of the destination file.
[in]destination_eidThe integer value of remote entity ID.
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddPutComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
RemovePutComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100);
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemovePutComponentRequest(const char *source_pathname, const char *destination_pathname, long long destination_eid)
Removes a "put" file request, using "put" components, from the list of CFDP "put" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:1592
Examples
cfdp_bp_put_example/main.c, and cfdp_put_example_2/main.c.

◆ RemovePutRequest()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemovePutRequest ( const char *  put_primitive)

Removes a "put" file request, using a "put" primitive string, from the list of CFDP "put" requests. Supports both Native and ION CFDP.

Parameters
[in]put_primitiveCFDP primitive (e.g., put class2 "source_pathname" remote_entity_id "destination_pathname").
Returns
SUCCESS
FAIL
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

char primitive[256];
sprintf(primitive, "put class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"\"D:/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddPutRequest(primitive) == SUCCESS)
{
RemovePutRequest(primitive);
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION RemovePutRequest(const char *put_primitive)
Removes a "put" file request, using a "put" primitive string, from the list of CFDP "put" requests....
Definition: toolkit_cfdp_api_ansi_c.cpp:1526

◆ ReportAllCFDPTransactions()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ReportAllCFDPTransactions ( )

Report the status of all CFDP file transaction including their current state, the transaction as a string, the size of the file being transferred and the number of bytes that have been sent. The status report is provided by the callback function associated with RegisterPrintMessage. Supports both NATIVE and ION CFDP.

Example:

RegisterPrintMessage(&PrintTheMessage);
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}
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
Examples
trek_cfdp_console.cpp.

◆ ReportCFDPTransaction()

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, the size of the file being transferred and the number of bytes that have been sent. The status report is provided by the callback function associated with RegisterPrintMessage. Supports both NATIVE and ION CFDP.

Parameters
[in]transaction_idThe CFDP transaction ID
Returns
SUCCESS
DS_NULL_POINTER_ERROR
Note
The transaction ID string is a combination of the decimal dotted notation EID and transaction number (e.g., 1_1, 255.255_2...) for native CFDP or the node number/EID and transaction number (e.g., 1_1, 3210_2...) for ION CFDP and can be found in some of the messages generated by the CFDP library and in the cfdp_struct that is returned by the RegisterDeviceData callback function.
Examples
trek_cfdp_console.cpp.

◆ ReportTheCFDPTransaction()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ReportTheCFDPTransaction ( const char *  destination_pathname,
long long  destination_eid 
)

Report the status of a CFDP file transaction including its current state, the transaction as a string, the size of the file being transferred and the number of bytes that have been sent. The status report is provided by the callback function associated with RegisterPrintMessage. This function will not report on a CFDP file transaction if the report call is made immediately after submitting the CFDP file transaction and prior to the CFDP file transaction creating a transaction ID. Supports both NATIVE and ION CFDP.

Parameters
[in]destination_pathnameThe full path and filename of the CFDP transaction.
[in]destination_eidThe destination entity ID of the CFDP transaction.
Returns
SUCCESS
DS_NULL_POINTER_ERROR
Note
Because the transaction ID may not be known, this method provides an alternative mechanism for identifying a CFDP file transaction.

Example:

RegisterPrintMessage(&PrintTheMessage);
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
ReportTheCFDPTransaction("D:/destination_pathname",100);
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ReportTheCFDPTransaction(const char *destination_pathname, long long destination_eid)
Report the status of a CFDP file transaction including its current state, the transaction as a string...
Definition: toolkit_cfdp_api_ansi_c.cpp:6324

◆ ResetCFDPMetrics()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResetCFDPMetrics ( )

Resets or zero's the device and packet statistics. Supports both NATIVE and ION CFDP.

Example:

char record_file_path[50];
char record_filename[50];
strcpy(record_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(record_filename,"cfdp_metrics.csv");
// Record CFDP metrics
if (StartRecordingCFDPMetricsSnapshot(record_file_path,
record_filename) != SUCCESS)
{
return 0;
}
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
Examples
trek_cfdp_console.cpp.

◆ ResetCFDPStatistics()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResetCFDPStatistics ( )

Resets or zero's the device and packet statistics. Supports both NATIVE and ION CFDP.

Example:

char record_file_path[50];
char record_file_name[50];
strcpy(record_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(record_file_name,"statistics.csv");
// Record only device statistics
if (StartRecordingCFDPStatSnapshot(record_file_path,
record_file_name,
{
return 0;
}
@ FALSE_OR_NO
False.
Definition: ds_shared.h:105
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
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
Examples
trek_cfdp_console.cpp.

◆ ResumeAllCFDPTransactions()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeAllCFDPTransactions ( )

Resume all previously suspended CFDP file transactions. Supports both NATIVE and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}
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
Examples
trek_cfdp_console.cpp.

◆ ResumeCFDPTransaction()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeCFDPTransaction ( const char *  transaction_id)

Resume a previously suspended CFDP file transaction using a transaction ID. Supports both NATIVE and ION CFDP.

Parameters
[in]transaction_idThe CFDP transaction ID
Returns
SUCCESS
DS_NULL_POINTER_ERROR
Note
The transaction ID string is a combination of the decimal dotted notation EID and transaction number (e.g., 1_1, 255.255_2...) for native CFDP or the node number/EID and transaction number (e.g., 1_1, 3210_2...) for ION CFDP and can be found in some of the messages generated by the CFDP library and in the cfdp_struct that is returned by the RegisterDeviceData callback function.

◆ ResumeTheCFDPTransaction()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeTheCFDPTransaction ( const char *  destination_pathname,
long long  destination_eid 
)

Resume a previously suspended CFDP file transaction using a destination pathname and destination entity ID. Supports both NATIVE and ION CFDP.

Parameters
[in]destination_pathnameThe full path and filename of the CFDP transaction.
[in]destination_eidThe destination entity ID of the CFDP transaction.
Returns
SUCCESS
DS_NULL_POINTER_ERROR
CFDP_TRANSACTION_DOES_NOT_CURRENTLY_EXIST
Note
Because the transaction ID may not be known, this method provides an alternative mechanism for identifying a CFDP file transaction.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
SuspendTheCFDPTransaction("D:/destination_pathname",100);
ResumeTheCFDPTransaction("D:/destination_pathname",100);
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION ResumeTheCFDPTransaction(const char *destination_pathname, long long destination_eid)
Resume a previously suspended CFDP file transaction using a destination pathname and destination enti...
Definition: toolkit_cfdp_api_ansi_c.cpp:6023
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendTheCFDPTransaction(const char *destination_pathname, long long destination_eid)
Suspend a CFDP file transaction using a destination pathname and destination entity ID....
Definition: toolkit_cfdp_api_ansi_c.cpp:5873

◆ SaveAllRequestsToFile()

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. Maintains FIFO ordering. Supports both NATIVE and ION CFDP.

Returns
SUCCESS
CFDP_OPEN_FILE_ERROR
CFDP_WRITE_FILE_ERROR
DS_NULL_POINTER_ERROR

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
{
SaveAllRequestsToFile("D:/cfdp_prim.txt");
}
}
}
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
Examples
trek_cfdp_console.cpp.

◆ SaveToolkitCfdp()

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.

Parameters
[in]config_pathnameThe full path and filename of the CFDP configuration file.
Note
SaveToolkitCfdp also saves all “put” and “get” transaction requests in the "put" and "get" lists.
Returns
SUCCESS
CFDP_OPEN_FILE_ERROR
CFDP_WRITE_FILE_ERROR
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

int return_value;
char pathname[50];
strcpy(pathname,"./cfdp_config.txt");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = SaveToolkitCfdp(pathname);
}
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
Examples
trek_cfdp_console.cpp.

◆ SendAllFilestoreRequests()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllFilestoreRequests ( )

Initiates all filestore requests in the list of CFDP filestore requests. Supports both Native and ION CFDP.

Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddFilestore(cfdp_filestore_action,
"D:/old_pathname",
"D:/new_pathname",
100) == SUCCESS)
{
{
}
}
}
int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllFilestoreRequests()
Initiates all filestore requests in the list of CFDP filestore requests. Supports both Native and ION...
Definition: toolkit_cfdp_api_ansi_c.cpp:4042

◆ SendAllGetRequests()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllGetRequests ( )

Initiates all "get" file requests in the list of CFDP "get" requests. Supports both Native and ION CFDP.

Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
{
}
}
}
Examples
cfdp_bp_get_example/main.c, and cfdp_get_example_2/main.c.

◆ SendAllMessageRequests()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllMessageRequests ( )

Initiates all message transfer requests in the list of CFDP message requests. Supports both Native and ION CFDP.

Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddMessage("Hello world",100) == SUCCESS)
{
{
}
}
}

◆ SendAllPutRequests()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SendAllPutRequests ( )

Initiates all "put" file requests in the list of CFDP "put" requests. Supports both Native and ION CFDP.

Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddPutComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
{
}
}
}
Examples
cfdp_bp_put_example/main.c, and cfdp_put_example_2/main.c.

◆ SendAllRequests()

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 CFDP requests. Executes FIFO ordering. Supports both NATIVE and ION CFDP.

Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (AddGetComponentRequest("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
{
}
}
}
Examples
cfdp_bp_filestore_example/main.c, cfdp_bp_process_primitive_file/main.c, cfdp_filestore_example/main.c, cfdp_process_primitive_file/main.c, and trek_cfdp_console.cpp.

◆ SendRequest()

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.

Parameters
[in]primitiveCFDP primitive (e.g., put class2 "source_file_pathname" 2 "destination_file_pathname",
get class2 "source_file_pathname" 2 "destination_file_pathname"
or
put //// "source_file_pathname" 2 "destination_file_pathname",
get //// "source_file_pathname" 2 "destination_file_pathname").
Returns
SUCCESS
FAIL
DS_DEVICE_NOT_FOUND
CFDP_INVALID_CLASS_OF_SERVICE
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR
CFDP_INVALID_PUT_PRIMITIVE
CFDP_PUT_PRIMITIVE_DEVICE_MODE_INCOMPATIBILITY
DS_INVALID_BP_CLASS_OF_SERVICE
DS_INVALID_BP_TRANSMISSION_MODE

Example:

int return_value;
char primitive[256];
sprintf(primitive, "put class2 %s 100 %s\r\n",
"\"D:/source_pathname\"",
"\"D:/destination_pathname\"");
if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
return_value = SendRequest(primitive);
}
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
Examples
trek_cfdp_console.cpp.

◆ StartLoggingCFDPMessages()

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.

Parameters
[in]log_file_pathThe path of the log file. If an empty string is provided, the default path is the user's home directory.
[in]log_filenameThe base file name of the log file. When logging is stopped, this name will be concatenated with a GMT time string.
[in]log_debug_messagesSet this boolean_type variable to TRUE_OR_YES to log debug messages. The boolean_type is defined in the file "ds_shared.h" as follows:
boolean_type

Value

FALSE_OR_NO

0

TRUE_OR_YES 1
Returns
SUCCESS
DS_FILE_OPEN_ERROR
DS_NULL_POINTER_ERROR
DS_RECORDING_CURRENTLY_ACTIVATED

Example:

char log_file_path[50];
char log_filename[50];
strcpy(log_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(log_filename,"logger");
// Log only error, warning, info and progress messages
if (StartLoggingCFDPMessages(log_file_path,
log_filename,
{
return 1;
}
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
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
Examples
cfdp_bp_filestore_example/main.c, cfdp_bp_get_example/main.c, cfdp_bp_process_primitive_file/main.c, cfdp_bp_put_example/main.c, cfdp_filestore_example/main.c, cfdp_get_example_1/main.c, cfdp_get_example_2/main.c, cfdp_process_primitive_file/main.c, cfdp_put_example_1/main.c, cfdp_put_example_2/main.c, and trek_cfdp_console.cpp.

◆ StartRecordingCFDPMetricsSnapshot()

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.

The snapshot is updated when new CFDP metrics are available. The previous CFDP metrics snapshot is overwritten.

Parameters
[in]record_file_pathThe path of the record file. If an empty string is provided, the default path is the user's home directory.
[in]record_filenameThe base filename of the log file. When recording is stopped, this name will be concatenated with a GMT time string.
Returns
SUCCESS
DS_BUFFER_SIZE_ERROR
CFDP_FAILED_TO_INIT_TOOLKIT_CFDP
DS_NULL_POINTER_ERROR

Example:

char record_file_path[50];
char record_filename[50];
strcpy(record_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(record_filename,"cfdp_metrics.csv");
// Record CFDP metrics
if (StartRecordingCFDPMetricsSnapshot(record_file_path,
record_filename) != SUCCESS)
{
return 1;
}
Examples
cfdp_bp_destination/main.c, cfdp_bp_filestore_example/main.c, cfdp_bp_get_example/main.c, cfdp_bp_put_example/main.c, cfdp_destination/main.c, cfdp_filestore_example/main.c, cfdp_put_example_2/main.c, and trek_cfdp_console.cpp.

◆ StartRecordingCFDPStatSnapshot()

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.

The snapshot is updated once a second with the latest statistics. Previous statistic snapshots are overwritten.

Parameters
[in]record_file_pathThe path of the record file. If an empty string is provided, the default path is the user's home directory.
[in]record_filenameThe base filename of the log file. When recording is stopped, this name will be concatenated with a GMT time string.
[in]record_packet_statistics_flagSet this boolean_type variable to TRUE_OR_YES to log both device and packet statistics messages. The boolean_type is defined in the file "ds_shared.h" as follows:
boolean_type

Value

FALSE_OR_NO

0

TRUE_OR_YES 1
Note
A packet header processor should be associated with a device if packets statistics are required.
Returns
SUCCESS
DS_THREAD_START_ERROR
DS_THREAD_TIMEOUT
DS_NULL_POINTER_ERROR
DS_RECORDING_CURRENTLY_ACTIVATED

Example:

char record_file_path[50];
char record_filename[50];
strcpy(record_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(record_filename,"statistics.csv");
// Record only device statistics
if (StartRecordingCFDPStatSnapshot(record_file_path,
record_filename,
{
return 1;
}
Examples
trek_cfdp_console.cpp.

◆ StopLoggingCFDPMessages()

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 log file name with a GMT time string. Supports both NATIVE and ION CFDP.

Example:

char log_file_path[50];
char log_file_name[50];
strcpy(log_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(log_file_name,"logger.txt");
if (StartLoggingCFDPMessages(log_file_path,
log_file_name,
{
// Log file name concatenated with the GMT time stamp
// (e.g., GMT_2015-01-01_01~01~01~001_logger.txt)
return 0;
}
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
Examples
trek_cfdp_console.cpp.

◆ StopRecordingCFDPMetricsSnapshot()

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 concatenating the record file name with a GMT time string. Supports both NATIVE and ION CFDP.

Example:

char record_file_path[50];
char record_file_name[50];
strcpy(record_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(record_file_name,"cfdp_metrics.csv");
// Record only device CFDP metrics
if (StartRecordingCFDPMetricsSnapshot(record_file_path,
record_file_name) == SUCCESS)
{
// Record file name concatenated with the GMT time stamp
// (e.g., GMT_2015-01-01 01~01~01~001_cfdp_metrics.csv)
return 0;
}
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
Examples
trek_cfdp_console.cpp.

◆ StopRecordingCFDPStatSnapshot()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION StopRecordingCFDPStatSnapshot ( )

Stops recording statisitics to a file, closes the record file and renames the record file by concatenating the record file name with a GMT time string. Supports both NATIVE and ION CFDP.

Example:

char record_file_path[50];
char record_file_name[50];
strcpy(record_file_path,""); // Empty string so use the home directory
// (e.g.,"C:/Users/<username>" or
// "/home/<username>")
strcpy(record_file_name,"statistics.csv");
// Record only device statistics
if (StartRecordingCFDPStatSnapshot(record_file_path,
record_file_name,
{
// Record file name concatenated with the GMT time stamp
// (e.g., GMT_2015-01-01 01~01~01~001_statistics.csv)
return 0;
}
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
Examples
trek_cfdp_console.cpp.

◆ SuspendAllCFDPTransactions()

void EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendAllCFDPTransactions ( )

Suspend all CFDP file transactions. Supports both NATIVE and ION CFDP.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
}
}
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
Examples
trek_cfdp_console.cpp.

◆ SuspendCFDPTransaction()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendCFDPTransaction ( const char *  transaction_id)

Suspend a CFDP file transaction using a transaction ID. Supports both NATIVE and ION CFDP.

Parameters
[in]transaction_idThe CFDP transaction ID
Returns
SUCCESS
DS_NULL_POINTER_ERROR
Note
The transaction ID string is a combination of the decimal dotted notation EID and transaction number (e.g., 1_1, 255.255_2...) for native CFDP or the node number/EID and transaction number (e.g., 1_1, 3210_2...) for ION CFDP and can be found in some of the messages generated by the CFDP library and in the cfdp_struct that is returned by the RegisterDeviceData callback function. Supports both NATIVE and ION CFDP.

◆ SuspendTheCFDPTransaction()

int EXPORT_THIS_TOOLKIT_CFDP_C_FUNCTION SuspendTheCFDPTransaction ( const char *  destination_pathname,
long long  destination_eid 
)

Suspend a CFDP file transaction using a destination pathname and destination entity ID. This function will not suspend a CFDP file transaction if the suspend call is made immediately after submitting the CFDP file transaction and prior to the CFDP file transaction creating a transaction ID. Supports both NATIVE and ION CFDP.

Parameters
[in]destination_pathnameThe full path and filename of the CFDP transaction.
[in]destination_eidThe destination entity ID of the CFDP transaction.
Returns
SUCCESS
DS_NULL_POINTER_ERROR
CFDP_TRANSACTION_DOES_NOT_CURRENTLY_EXIST
Note
Because the transaction ID may not be known, this method provides an alternative mechanism for identifying a CFDP file transaction.

Example:

if (InitToolkitCfdp( "./cfdp_config.txt") == SUCCESS)
{
if (PutComponentCFDP("D:/source_pathname",
"D:/destination_pathname",
100,
CFDP_CLASS2) == SUCCESS)
{
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
SuspendTheCFDPTransaction("D:/destination_pathname",100);
}
}