00001 /* SVN FILE INFO 00002 * $Revision: 560 $ : Last Committed Revision 00003 * $Date: 2010-08-30 15:09:20 -0700 (Mon, 30 Aug 2010) $ : Last Committed Date */ 00004 /*[ 00005 * Copyright (c) 2007 Integration Engineering Laboratory 00006 University of California, Davis 00007 * 00008 * Permission to use, copy, and distribute this software and its 00009 * documentation for any purpose with or without fee is hereby granted, 00010 * provided that the above copyright notice appear in all copies and 00011 * that both that copyright notice and this permission notice appear 00012 * in supporting documentation. 00013 * 00014 * Permission to modify the software is granted, but not the right to 00015 * distribute the complete modified source code. Modifications are to 00016 * be distributed as patches to the released version. Permission to 00017 * distribute binaries produced by compiling modified sources is granted, 00018 * provided you 00019 * 1. distribute the corresponding source modifications from the 00020 * released version in the form of a patch file along with the binaries, 00021 * 2. add special version identification to distinguish your version 00022 * in addition to the base release version number, 00023 * 3. provide your name and address as the primary contact for the 00024 * support of your modified version, and 00025 * 4. retain our contact information in regard to use of the base 00026 * software. 00027 * Permission to distribute the released version of the source code along 00028 * with corresponding source modifications in the form of a patch file is 00029 * granted with same provisions 2 through 4 for binary distributions. 00030 * 00031 * This software is provided "as is" without express or implied warranty 00032 * to the extent permitted by applicable law. 00033 ]*/ 00034 00035 #ifndef _MC_PLATFORM_H_ 00036 #define _MC_PLATFORM_H_ 00037 #include "acc.h" 00038 #include "ams.h" 00039 #include "barrier.h" 00040 #include "cmd_prompt.h" 00041 #include "config.h" 00042 #include "connection.h" 00043 #include "data_structures.h" 00044 #include "df.h" 00045 #include "libmc.h" 00046 #include "../mc_sync/sync_list.h" 00047 #include "../security/asm.h" 00048 00049 struct mc_platform_s{ 00050 #ifdef _WIN32 00051 WSADATA wsaData; 00052 #endif 00053 int err; 00054 #ifdef MC_SECURITY 00055 int enable_security; 00056 #endif 00057 00058 char* hostname; 00059 unsigned short port; 00060 int initInterps; 00061 00062 /* These are the standard agency data structs. */ 00063 message_queue_p asm_message_queue; 00064 #ifdef MC_SECURITY 00065 asm_queue_p asm_queue; /* Holds encryption info for each remote hoste */ 00066 #endif 00067 message_queue_p message_queue; 00068 agent_queue_p agent_queue; 00069 connection_queue_p connection_queue; 00070 00071 df_p df; 00072 ams_p ams; 00073 acc_p acc; 00074 cmd_prompt_p cmd_prompt; 00075 #ifdef MC_SECURITY 00076 mc_asm_p security_manager; 00077 #endif 00078 00079 syncList_p syncList; 00080 barrier_queue_p barrier_queue; 00081 00082 listen_thread_arg_p listen_thread_arg; 00083 listen_thread_arg_p client_thread_arg; 00084 00085 int default_agentstatus; 00086 00087 int stack_size[MC_THREAD_ALL]; 00088 00089 ChOptions_t *interp_options; 00090 00091 /* MC Cond Signal System */ 00092 COND_T *MC_signal_cond; 00093 COND_T *MC_sync_cond; 00094 MUTEX_T *MC_signal_lock; 00095 MUTEX_T *MC_sync_lock; 00096 enum MC_Signal_e MC_signal; 00097 00098 /* MC Steer System */ 00099 enum MC_SteerCommand_e MC_steer_command; 00100 MUTEX_T *MC_steer_lock; 00101 COND_T *MC_steer_cond; 00102 00103 /* giant lock : Threads will pause if giant==0. 00104 * giant_lock and giant_cond protect giant. */ 00105 int giant; 00106 MUTEX_T *giant_lock; 00107 COND_T *giant_cond; 00108 00109 int quit; 00110 MUTEX_T *quit_lock; 00111 COND_T *quit_cond; 00112 int sockfd; /* File Descriptor for listen socket */ 00113 char private_key[1210]; // private key of agency 00114 00115 MCAgency_t agency; /* A pointer to the platform's agency structure */ 00116 00117 /* Need a linked list of Ch interpreters. */ 00118 interpreter_queue_p interpreter_queue; 00119 00120 /* Are we using bluetooth? */ 00121 int bluetooth; 00122 }; 00123 typedef struct mc_platform_s mc_platform_t; 00124 typedef mc_platform_t* mc_platform_p; 00125 00126 mc_platform_p 00127 mc_platform_Initialize(MCAgency_t agency, ChOptions_t* ch_options); 00128 00129 int 00130 mc_platform_Destroy(mc_platform_p mc_platform); 00131 #endif