This directory contains the complete code for the OK banking application shown in Appendix E of "Guide to Writing DCE Applications," 2nd edition, by John Shirley, Wei Hu, and David Magid, published by O'Reilly & Associates, Inc. This program is a first, crude implementation of the application underlying for the discussion of object UUIDs and importing by resource in Chapter 7. A makefile is also included in this directory. You will probably have to change the libraries listed in the makefile, because the names and contents can vary from one vendor to another, and from one release to the next. The purpose of this application, and the RPC programming techniques that it illustrates, are covered in the book. The rest of this README file consists of directions for building and running the application, taken from the text of the appendix. The contents of this directory are: -rw-r--r-- 1 1359 Feb 15 14:46 Makefile -rw-r--r-- 1 5061 Mar 11 11:30 README -rw-r--r-- 1 291 Jan 19 13:21 banking.acf -rw-r--r-- 1 1231 Jan 19 13:21 banking.idl -rw-r--r-- 1 1524 Jan 19 13:21 check_status.h -rw-r--r-- 1 12036 Mar 11 11:25 ok_client.c -rw-r--r-- 1 5515 Mar 11 11:25 ok_import.c -rw-r--r-- 1 6032 Feb 15 14:49 ok_mgmt_auth.c -rw-r--r-- 1 6935 Mar 11 11:25 ok_mgr.c -rw-r--r-- 1 7642 Feb 15 14:48 ok_svr_main.c -rw-r--r-- 1 8699 Mar 11 11:25 svr_support.c -rw-r--r-- 1 449 Jan 19 13:21 svr_support.h E _________________________________________________________________ The OK Banking Application The banking application creates, deletes, and performs rudimentary transactions on bank accounts. The client requests a bank account through an object UUID. The two versions of the program, presented in this appendix and Appendix H, illustrate two different ways to use object UUIDs. The application in this chapter represents a relatively crude access to bank accounts. The UUID is used as an ID for each account. The new techniques shown in this appendix include: o Creating a UUID o Manipulating UUID lists o Exporting UUIDs to the name service and endpoint map o Importing an interface by UUID How to Run the Application To build and start the server, type the following: S> make interface server S> i_server To build and run the client, type the following: C> make interface client C> i_client The client displays a menu of operations and you can begin to create and manage accounts. Application Files Makefile contains descriptions of how the application is compiled. banking.idl contains the description of the constants, data types, and procedures for the interface. banking.acf customizes how you use an interface. In this application it ensures that communication errors are reported back as variables to the client. check_status.h is an expanded version of the CHECK_STATUS macro used in other chapters. In this file, two macros are defined, one for checking communication errors and the other for checking errors pertaining to access to bank accounts. svr_support.h contains extra definitions required by the server code. ok_svr_main.c contains the initialization for the server, including the preparation and display of the list of bank accounts. ok_mgr.c is the implementation of all the remote procedures defined in this interface. svr_support.c includes server functions called by the initialization file ok_svr_main.c and by the remote procedures in ok_mgr.c. ok_mgmt_auth.c contains the management authorization function that shuts down the server at the request of the client. ok_client.c is the client, which displays a menu of functions and invokes remote procedures on the server. The file includes the get_id_and_binding function, which queries the user for a UUID by which to access the bank account. ok_import.c contains two functions that choose a server. The client uses import_interface to find a server when creating a new account or shutting down servers. For other transactions it uses import_resource, called from get_id_and_binding.