00001 /* SVN FILE INFO 00002 * $Revision: 174 $ : Last Committed Revision 00003 * $Date: 2008年06月24日 10:50:29 -0700 (2008年6月24日) $ : Last Committed Date */ 00004 #ifndef _ASM_H_ 00005 #define _ASM_H_ 00006 00007 #include "config.h" 00008 #include "../include/ap_queue_template.h" 00009 #include "../include/data_structures.h" 00010 #include "../mc_list/list.h" 00011 #include "asm_node.h" 00012 00013 #ifdef MC_SECURITY 00014 00015 AP_QUEUE_DECL_TEMPLATE 00016 ( 00017 asm_queue, 00018 asm_node 00019 ); 00020 00021 AP_QUEUE_GENERIC_DECL_TEMPLATE 00022 ( 00023 asm_queue, 00024 SearchAddr, 00025 asm_node_p, 00026 struct sockaddr_in* 00027 ); 00028 00029 AP_QUEUE_GENERIC_DECL_TEMPLATE 00030 ( 00031 asm_queue, 00032 RemoveAddr, 00033 int, 00034 struct sockaddr_in* 00035 ); 00036 00037 typedef struct mc_asm_s 00038 { 00039 struct mc_platform_s* mc_platform; 00040 THREAD_T thread; 00041 asm_node_p home_encryption_info; 00042 00043 /* Waiting Flag */ 00044 int waiting; 00045 MUTEX_T* waiting_lock; 00046 COND_T* waiting_cond; 00047 00048 /* The following queue is used to hold messages that have arrived 00049 * encrypted, but no information about the encryption could be attained. 00050 * The messages are checked when new encryption data arrives, to 00051 * see if they can be decrypted. */ 00052 message_queue_p lost_message_queue; 00053 } mc_asm_t; 00054 typedef mc_asm_t* mc_asm_p; 00055 00056 struct mc_platform_s; 00057 int 00058 asm_Destroy 00059 ( 00060 mc_asm_p mc_asm 00061 ); 00062 00063 mc_asm_p 00064 asm_Initialize 00065 ( 00066 struct mc_platform_s* mc_platform 00067 ); 00068 00069 struct message_s; 00070 int 00071 asm_SendEncryptionData 00072 ( 00073 mc_asm_p security_manager, 00074 const char* address 00075 ); 00076 00077 void 00078 asm_Start(struct mc_platform_s* mc_platform); 00079 00080 #ifndef _WIN32 00081 void* 00082 asm_Thread(void* arg); 00083 #else 00084 DWORD WINAPI 00085 asm_Thread(LPVOID arg); 00086 #endif 00087 00088 #endif /*MC_SECURITY*/ 00089 #endif