IBM Webcam 4J User Manual

Page of 98
Chapter 5. Writing User Exits
User Exit Programs
The user exit API functions allow you to write custom programs to use with
Sterling Connect:Direct. The user exit programs are used by Sterling Connect:Direct
to invoke user-specific logic at strategic points within Sterling Connect:Direct
execution. User exit programs must be C or C++ language programs and cannot be
shell scripts. The PMGR invokes the Statistics user exit program when you start
Sterling Connect:Direct and the exit runs as long as Sterling Connect:Direct runs.
The SMGR invokes the File Open and Security user exits for each session and
stops them when the particular session terminates.
Note:
exit_skeleton.c and exit_skeleton.C contain working examples of all three
exits and can be made with the make_exit_c and make_exit_C make files.
The user exit programs are described in the following:
Program
Description
File Open Exit
Sterling Connect:Direct sends a message to
this user exit program to open the source or
destination file during processing of the
copy statement. The File Open Exit opens
the source file and identifies the file
descriptor. This exit can perform any sort of
processing to file names or directory names.
It can also redirect the open request to other
files as needed.
The File Open Exit program (named
“exit_skeleton” in this example) must be
owned by root and the setuid bit must be
set. Use the following commands:
% chown root exit_skeleton
% chmod u+s exit_skeleton
Security Exit
The Security Exit enables you to implement
your own security system or provide access
to a third-party security system.
Statistics Exit
The Security Exit enables you to implement
your own security system or provide access
to a third-party security system.
User Exit Functions
A connection between the user exit and Sterling Connect:Direct is established when
the user exit program calls the exit_child_init() or exit_child_init_c() function. The
connection is terminated through a specially designated stop message. The types of
messages are defined in the include file user_exit.h. The following functions
facilitate communications between the user exit and Sterling Connect:Direct:
© Copyright IBM Corp. 1999, 2013
75