Main Page | Modules | Data Structures | File List | Globals | Examples

/net/hp45/pmw/mware/cmrpc/cmrpc_internal.h

00001 #ifndef __CMRPC_INTERNAL_H__
00002 #define __CMRPC_INTERNAL_H__
00003 
00004 /*
00005  *
00006  *  $Id: cmrpc__internal_8h-source.html,v 1.3 2004/10/14 22:36:19 pmw Exp $
00007  *
00008  */
00009 #include <errno.h>
00010 
00011 #include "cmrpc.h"
00012 
00013 /*
00014  *  internal flag values (should be the upper two bytes of the flags unsigned long)
00015  */
00016 #define CMrpc_anon_call (0x10000)
00017 #define CMrpc_with_channel (0x20000)
00018 #define CMrpc_oneway (0x40000)
00019 
00020 /*
00021  * RPC stuff
00022  */
00023 typedef struct rpc_request_struct
00024 {
00025   char* rpc_name;
00026   int condition;
00027   int encoded_len;
00028   char* encoded_param_data;
00029   char* chan_id;
00030   unsigned long request_flags;
00031 } rpc_request, *rpc_request_ptr;
00032 
00033 typedef struct rpc_response_struct
00034 {
00035   int condition;
00036   int encoded_len;
00037   char* encoded_return_data;
00038   int status;
00039   int rpc_status;
00040 } rpc_response, *rpc_response_ptr;
00041 
00042 
00043 typedef struct rpc_call_info_struct
00044 {
00045   char* response_data_ptr;
00046   int response_data_len;
00047   int response_status;
00048   int rpc_status;
00049   IOContext iocontext;
00050   IOFormat out_format;
00051   CMConnection cmconn;
00052   unsigned long flags;
00053 } rpc_call_info, *rpc_call_info_ptr;
00054 
00055 
00056 typedef struct rpc_info_struct
00057 {
00058   CMrpc_HandlerFunc func;
00059   CMrpc_OnewayHandlerFunc oneway_func;
00060   CMrpc_HandlerCleanupFunc cleanup_func;
00061   IOFormat in_format;
00062   IOFormat out_format;
00063   IOContext iocontext;
00064   attr_list target_spec;
00065 #ifdef CMRPC_WITH_CHANNEL
00066   CMrpc_Chan_HandlerFunc channel_handler;
00067 #endif
00068 } rpc_info, *rpc_info_ptr;
00069 
00070 typedef struct _CMrpc_ticket_struct
00071 {
00072   int valid;
00073   int condition;
00074 } rpc_ticket_struct;
00075 
00076 extern IOField rpc_response_flds[];
00077 extern IOField rpc_request_flds[];
00078 
00079 extern void
00080 do_conversion_setup ARGS((IOContext iocontext, void* buffer, CManager cm,
00081                           CMConnection conn));
00082 
00083 extern void 
00084 rpc_info_init ARGS((CManager cm));
00085 
00086 extern rpc_info_ptr
00087 get_rpc_info ARGS((const char* rpc_name, int make_new));
00088 
00089 /*
00090  *
00091  *  $Log: cmrpc__internal_8h-source.html,v $
00091  *  Revision 1.3  2004/10/14 22:36:19  pmw
00091  *  last documentation tweaks for a while
00091  *
00092  *  Revision 1.15  2004/10/14 21:16:15  pmw
00093  *  Added doxygen documentation.
00094  *  Also changed prefix of everything from CM_RPC to CMrpc.  It looks better.
00095  *
00096  *  Revision 1.14  2004/05/06 17:55:04  eisen
00097  *  Tweak CMRPC so that it works with CMSelfFormats set.  This required some
00098  *  extensions to CM, and a bit of rearranging.
00099  *
00100  *  Revision 1.13  2002/08/15 03:55:13  pmw
00101  *  fixed MT problem where async calls had their connection whacked out
00102  *  from underneath them, causing their condition to be marked failed
00103  *  before any tickets corresponding to them were redeemed.
00104  *
00105  *  also cleaned up undeclared function warnings in tclHash.c.
00106  *
00107  *  also changed handling of attr_lists in request.c to eliminate
00108  *  attr_add_list call.
00109  *
00110  *  Revision 1.12  2002/05/27 07:44:55  pmw
00111  *  const correctness for C compilers sucks.  Especially when I use so much code from
00112  *  other people that isn't const correct :)
00113  *
00114  *  Revision 1.11  2000/10/16 03:45:36  pmw
00115  *  Added oneway RPC calls.  This has been tested somewhat.
00116  *
00117  *  Revision 1.10  2000/10/16 02:31:22  pmw
00118  *  1 - fixed gotcha-in-waiting concerning IOcontext management and anonymous
00119  *  calls.  The IOcontext allocated for anon calls was getting freed before the
00120  *  user ever saw the result structure from the call, and the underlying PBIO
00121  *  buffer was suspect.  This meant revising the anon-call interface back to
00122  *  where the user supplies his own IOcontext values.
00123  *  2 - Added rpc-with-channel functionality, not yet tested.
00124  *
00125  *  Revision 1.9  2000/09/29 20:52:07  pmw
00126  *  fixed lingering problems from subcontext changes.  hopefully this closes it.
00127  *  make check works correctly, so I'll believe it for the moment.
00128  *
00129  *  Revision 1.8  2000/04/10 20:28:33  pmw
00130  *  Added cleanup handler functionality
00131  *
00132  *  Revision 1.7  2000/04/10 18:10:15  pmw
00133  *  more rearrangement
00134  *
00135  *  Revision 1.6  2000/04/06 22:39:19  pmw
00136  *  Now does sane handling of IO conversions
00137  *
00138  *  Revision 1.5  2000/04/05 03:00:05  pmw
00139  *  added high-level convenience functions
00140  *
00141  *  Revision 1.4  2000/04/04 20:40:04  pmw
00142  *  Restructured for asyncronous calls
00143  *
00144  *  Revision 1.3  2000/04/04 19:04:51  pmw
00145  *  cosmetic changes, split into more source files
00146  *
00147  *  Revision 1.2  2000/04/04 18:35:30  pmw
00148  *  added RCS headers
00149  *
00150  *
00151  */
00152 
00153 #endif /* ifndef __CMRPC_INTERNAL_H__ */

Generated on Thu Oct 14 18:34:49 2004 for CMrpc by  doxygen 1.3.9.1