User Exits
Using user exits, you can build additional processes for advanced file transfer capabilities.
You can have direct access to transfer parameters in a C/C++ program, so that command-line arguments are not required.
The ExitPrgm parameter in the $CFROOT/config/config.txt file is defined to the path to the exit program on the local machine. For more information, see ExitPrgm in Server Configuration Parameters.
In the $CFROOT/samples directory, you can find an example exit program named exitprg.cpp, and a compiled exitprg.exe file based on the exitprg.cpp file.
All exit programs are compiled with the CfXitData.h file, which is located in the $CFROOT/samples directory. This file contains the data structure with all the information to be passed to your exit program.
For more information, see CfXitData Structure.
All user exit programs are called when a transfer attempt is completed.
- CF_INIT_POST_TRANSFER is called by an initiator.
- CF_RESP_POST_TRANSFER is called by a responder.
Both functions take a pointer to a CfXitData structure as an argument, which contains all parameters. The function prototype is:
int CF_INIT_POST_TRANSFER(CfXitData* control); int CF_RESP_POST_TRANSFER(CfXitData* control);
To compile your code, navigate to the directory where your source code is placed, and then use the following command:
gcc -c output_file source_code