As described in What are DPCL callbacks?, most DPCL callbacks are initiated by analysis tool requests. Acknowledgment callbacks, for example, respond to the success/failure of an asynchronous function. These success/failure messages are sent from one or more DPCL communication daemons running on one or more hosts. Similarly, data callbacks respond to message data sent by the DPCL communication daemon(s) -- either messages forwarded from installed probes, or diagnostic messages. In all of these cases, however, the messages sent from the DPCL communication daemon to the analysis tool are the result of a direct request from the analysis tool -- either an asynchronous request, a request to install a probe, or a request to turn diagnostic logging on. Furthermore, in all these cases, the analysis tool code will have specified, upon making the request, the name of a callback routine to handle the messages from the DPCL communication daemon(s).
System callbacks, on the other hand, are different than these user-initiated requests. They are not the result of a request from the analysis tool, but are instead used to respond to unexpected events (possibly due to system error) such as the DPCL communication daemon exiting. The default system callbacks respond to these unexpected events simply by printing an error or information message describing the event. However, if you would like your analysis tool to respond to any of these events in another way, you can use the Ais_override_default_callback function to override the default system callback and call your own callback instead.
To override a default system callback using the Ais_override_default_callback function, you supply a message key that indicates the type of system message you want to handle in your callback routine. The message types are:
The following example code overrides the default system callback for handling termination of the DPCL daemon. In this example, the new callback is my_exit_cb.
Ais_override_default_callback(AIS_EXIT_MSG, my_exit_cb, (GCBTagType) 0, &prev_cb, &prev_tag);
For more information about the Ais_override_default_callback function, refer to its UNIX man page or its entry in the DPCL Class Reference.