25 #ifndef __RPC_CLSERVER_H__
26 #define __RPC_CLSERVER_H__
36 #define ID_TIMEOUT_IDLE 0
37 #define ID_TIMEOUT_RESEND 1
38 #define NB_SERVER_TIMER 2
39 APP_WORD rpc_tmIdle (APP_LPVOID lpData, APP_WORD wDummy);
40 APP_WORD rpc_tmResend (APP_LPVOID lpData, APP_WORD wDummy);
50 ST_CLR_RPC_UUID uuidActivityId;
51 ST_CLR_RPC_UUID uuidObjId;
52 ST_CLR_RPC_UUID uuidIfId;
53 ST_CLR_RPC_UUID uuidClientExContext;
55 APP_DWORD dwIfVersion;
57 APP_LPBYTE pbyInParams;
58 APP_LPBYTE pbyOutParams;
59 APP_LPBYTE pbyOutFrag;
64 APP_WORD wContInFragNum;
65 APP_WORD wLastInFragNum;
66 APP_WORD wInSerialNum;
70 APP_BYTE byLittleEndian;
71 }PACK_ALIGNEMENT(ST_CL_SERVER_MACHINE_RT),APP_FAR *LPST_CL_SERVER_MACHINE_RT;
77 ST_CLR_RPC_UUID uuidActivityId;
78 ST_CLR_RPC_UUID uuidObjId;
79 ST_CLR_RPC_UUID uuidIfId;
80 APP_DWORD dwIfVersion;
83 APP_DWORD dwFaultStatus;
84 APP_DWORD dwRejectStatus;
85 APP_LPBYTE pbyOutParams;
92 }PACK_ALIGNEMENT(ST_CL_SERVER_MACHINE_SND),APP_FAR* LPST_CL_SERVER_MACHINE_SND;
100 APP_DWORD bBroadcast;
102 APP_DWORD bContextRequest;
103 APP_DWORD bIdempotent;
104 APP_DWORD bLastInFrag;
105 APP_DWORD bLastOutFrag;
107 APP_DWORD bReturnPendingCancel;
109 APP_DWORD bSndLastFrag;
110 APP_DWORD bSndPendingCancel;
111 }PACK_ALIGNEMENT(ST_CL_SERVER_COND),*PST_CL_SERVER_COND;
114 #define TR_COND_BROADCAST(machine) ((machine)->stCondition.bBroadcast=1)
115 #define TR_COND_BURST(machine) ((machine)->stCondition.bBurst=1)
116 #define TR_COND_CONTEXT_REQUEST(machine) ((machine)->stCondition.bContextRequest=1)
117 #define TR_COND_IDEMPOTENT(machine) ((machine)->stCondition.bIdempotent=1)
118 #define TR_COND_LAST_IN_FRAG(machine) ((machine)->stCondition.bLastInFrag=1)
119 #define TR_COND_LAST_OUT_FRAG(machine) ((machine)->stCondition.bLastOutFrag=1)
120 #define TR_COND_MAYBE(machine) ((machine)->stCondition.bMaybe=1)
121 #define TR_COND_RETURN_PENDING_CANCEL(machine) ((machine)->stCondition.bReturnPendingCancel=1)
122 #define TR_COND_SND_FRAG(machine) ((machine)->stCondition.bSndFrag=1)
123 #define TR_COND_SND_LAST_FRAG(machine) ((machine)->stCondition.bSndLastFrag=1)
124 #define TR_COND_SND_PENDING_CANCEL(machine) ((machine)->stCondition.bSndPendingCancel=1)
128 #define FS_COND_BROADCAST(machine) ((machine)->stCondition.bBroadcast=0)
129 #define FS_COND_BURST(machine) ((machine)->stCondition.bBurst=0)
130 #define FS_COND_CONTEXT_REQUEST(machine) ((machine)->stCondition.bContextRequest=0)
131 #define FS_COND_IDEMPOTENT(machine) ((machine)->stCondition.bIdempotent=0)
132 #define FS_COND_LAST_IN_FRAG(machine) ((machine)->stCondition.bLastInFrag=0)
133 #define FS_COND_LAST_OUT_FRAG(machine) ((machine)->stCondition.bLastOutFrag=0)
134 #define FS_COND_MAYBE(machine) ((machine)->stCondition.bMaybe=0)
135 #define FS_COND_NO_FACK(machine) ((machine)->stCondition.bNoFack=0)
136 #define FS_COND_RETURN_PENDING_CANCEL(machine) ((machine)->stCondition.bReturnPendingCancel=0)
137 #define FS_COND_SND_FRAG(machine) ((machine)->stCondition.bSndFrag=0)
138 #define FS_COND_SND_LAST_FRAG(machine) ((machine)->stCondition.bSndLastFrag=0)
139 #define FS_COND_SND_PENDING_CANCEL(machine) ((machine)->stCondition.bSndPendingCancel=0)
143 #define COND_BROADCAST(machine) ((machine)->stCondition.bBroadcast)
144 #define COND_BURST(machine) ((machine)->stCondition.bBurst)
145 #define COND_CONTEXT_REQUEST(machine) ((machine)->stCondition.bContextRequest)
146 #define COND_IDEMPOTENT(machine) ((machine)->stCondition.bIdempotent)
147 #define COND_LAST_IN_FRAG(machine) ((machine)->stCondition.bLastInFrag)
148 #define COND_LAST_OUT_FRAG(machine) ((machine)->stCondition.bLastOutFrag)
149 #define COND_MAYBE(machine) ((machine)->stCondition.bMaybe)
150 #define COND_RETURN_PENDING_CANCEL(machine) ((machine)->stCondition.bReturnPendingCancel)
151 #define COND_SND_FRAG(machine) ((machine)->stCondition.bSndFrag)
152 #define COND_SND_LAST_FRAG(machine) ((machine)->stCondition.bSndLastFrag)
153 #define COND_SND_PENDING_CANCEL(machine) ((machine)->stCondition.bSndPendingCancel)
157 #define COND_NON_IDEMPOTENT(machine)\
158 (!COND_IDEMPOTENT(machine) && !COND_BROADCAST(machine) && !COND_MAYBE(machine))
161 #define COND_OUT_FRAG_NUM_EQ(machine)\
162 ((machine)->stSND.wFragNum == gstServerGlobal.stPDU.wFragNum)
165 #define COND_OUT_FRAG_NUM_NE(machine)\
166 ((machine)->stSND.wFragNum != gstServerGlobal.stPDUwFragNum)
169 #define COND_SEQ_NUM_EQ(machine)\
170 (lpstServerGlobal->stPDU.dwSeqNum == (machine)->stRT.dwSeqNum)
173 #define COND_SEQ_NUM_GT(machine)\
174 ((long)lpstServerGlobal->stPDU.dwSeqNum > (long)(machine)->stRT.dwSeqNum)
177 #define COND_SEQ_NUM_LE(machine)\
178 (lpstServerGlobal->stPDU.dwSeqNum <= (machine)->stRT.dwSeqNum)
181 #define COND_SEQ_NUM_LOST(machine)\
182 ((machine)->stRT.dwSeqNum ==0)
187 typedef enum _enClServer{
192 typedef enum _enSrvWorking{
198 typedef enum _enSrvData{
200 enSrvDataIndication =1,
201 enSrvDataProcessReq =2,
210 ST_CL_SERVER_COND stCondition;
211 ST_CL_SERVER_MACHINE_RT stRT;
212 ST_CL_SERVER_MACHINE_SND stSND;
213 ST_CLR_RPC_UUID uuidSession;
216 EN_CLSERVER_STATE enClServerState;
217 EN_SRV_WORKING enClServerWorkingState;
218 EN_SRV_DATA enClServerDataState;
220 APP_LPVOID lpstServerGlobal;
222 } PACK_ALIGNEMENT(ST_CL_SERVER),APP_FAR *LPST_CL_SERVER;
224 #define GET_SRV_RPC_REQ(machine) ((machine).stRPCReq)
232 APP_DWORD bBroadcast;
233 APP_DWORD bIdempotent;
238 }PACK_ALIGNEMENT(ST_CL_COND_PDU),APP_FAR* LPST_CL_COND_PDU;
242 ST_CLR_RPC_UUID uuidActivityId;
243 ST_CLR_RPC_UUID uuidObjId;
244 ST_CLR_RPC_UUID uuidIfId;
245 APP_DWORD dwIfVersion;
247 APP_DWORD dwBootTime;
248 APP_DWORD dwCancelVers;
249 APP_DWORD dwCancelID;
255 APP_BYTE byRequestType;
256 APP_BYTE byLittleEndian;
257 }PACK_ALIGNEMENT(ST_CL_SERVER_PDU),APP_FAR* LPST_CL_SERVER_PDU;
262 ST_CL_SERVER stClServer[MAX_RPCSERVER];
265 ST_INTERFACE_REGISTER stResiteredInterface[MAX_REG_INTERFACE];
266 ST_CL_SERVER_PDU stPDU;
267 ST_CL_COND_PDU stCondition;
269 APP_DWORD dwSysBootTime;
272 APP_DWORD dwIPAddressLastCaller;
278 }PACK_ALIGNEMENT(ST_CL_SERVER_GLOBAL),APP_FAR* LPST_CL_SERVER_GLOBAL;
280 extern ST_CL_SERVER_GLOBAL gstServerGlobal[MAX_DEVICE];
285 }PACK_ALIGNEMENT(ST_EPM), APP_FAR * LPST_EPM;
288 #define GET_EPM_STATE(a) a.wEPMState
289 #define SET_EPM_STATE(a,b) a.wEPMState =b
291 #define GET_EPM_RPC_CALL(a) a.stRPCCall
299 ST_CLR_RPC_UUID uuidObject;
300 APP_DWORD referenceid;
301 APP_DWORD annotation_offset;
302 APP_DWORD annotation_length;
303 APP_BYTE annotation[64];
307 }PACK_ALIGNEMENT(EPT_ENTRY_T), APP_FAR * LPEPT_ENTRY_T;
312 }PACK_ALIGNEMENT(FLOOR_DOD_T), APP_FAR * LPFLOOR_DOD_T;
315 #define FS_COND_PDU_BROADCAST (lpstServerGlobal->stCondition.bBroadcast = 0)
316 #define FS_COND_PDU_IDEMPOTENT (lpstServerGlobal->stCondition.bIdempotent = 0)
317 #define FS_COND_PDU_MAYBE (lpstServerGlobal->stCondition.bMaybe = 0)
318 #define FS_COND_PDU_NOFACK (lpstServerGlobal->stCondition.bNoFack = 0)
319 #define FS_COND_PDU_FRAG (lpstServerGlobal->stCondition.bFrag = 0)
320 #define FS_COND_PDU_LASTFRAG (lpstServerGlobal->stCondition.bLastFrag = 0)
322 #define TR_COND_PDU_BROADCAST (lpstServerGlobal->stCondition.bBroadcast = 1)
323 #define TR_COND_PDU_IDEMPOTENT (lpstServerGlobal->stCondition.bIdempotent = 1)
324 #define TR_COND_PDU_MAYBE (lpstServerGlobal->stCondition.bMaybe = 1)
325 #define TR_COND_PDU_NOFACK (lpstServerGlobal->stCondition.bNoFack = 1)
326 #define TR_COND_PDU_FRAG (lpstServerGlobal->stCondition.bFrag = 1)
327 #define TR_COND_PDU_LASTFRAG (lpstServerGlobal->stCondition.bLastFrag = 1)
329 #define COND_PDU_BROADCAST (lpstServerGlobal->stCondition.bBroadcast )
330 #define COND_PDU_IDEMPOTENT (lpstServerGlobal->stCondition.bIdempotent)
331 #define COND_PDU_MAYBE (lpstServerGlobal->stCondition.bMaybe )
332 #define COND_PDU_NOFACK (lpstServerGlobal->stCondition.bNoFack )
333 #define COND_PDU_FRAG (lpstServerGlobal->stCondition.bFrag )
334 #define COND_PDU_LASTFRAG (lpstServerGlobal->stCondition.bLastFrag )
337 #define EPM_EVENT_NONE 0xFFFF
338 #define EPM_EVENT_LOOKUP 0
339 #define EPM_EVENT_LOOKUPFREE 1
340 #define MAX_EPM_EVENT EPM_EVENT_LOOKUPFREE
347 #define EPM_W_L_UP_FREE 4
354 APP_VOID clserver_event_abort(LPST_CL_SERVER pstClServer);
356 APP_VOID clserver_event_processing_fault(LPST_CL_SERVER pstClServer);
357 APP_VOID clserver_event_processing_fdne (LPST_CL_SERVER pstClServer);
358 APP_VOID clserver_event_proc_response (LPST_CL_SERVER pstClServer);
359 APP_BOOL clserver_event_receive_pdu (LPST_CL_SERVER pstClServer);
361 APP_VOID clserver_event_tmidle (LPST_CL_SERVER pstClServer);
362 APP_VOID clserver_event_tmresend(LPST_CL_SERVER pstClServer);
367 APP_VOID clserver_action_enter_server (LPST_CL_SERVER pstClServer);
368 APP_VOID clserver_action_fack_nocall_call(LPST_CL_SERVER pstClServer,APP_BYTE byReplyType);
369 APP_VOID clserver_action_resend_out_frags(LPST_CL_SERVER pstClServer);
371 APP_VOID clserver_action_server_reject(APP_DWORD dwError, LPST_CL_SERVER_GLOBAL lpstServerGlobal);
372 APP_VOID clserver_action_server_nocall( LPST_CL_SERVER_GLOBAL lpstServerGlobal);
376 APP_VOID clserver_cancel_req (LPST_CL_SERVER pstClServer);
377 APP_VOID clserver_cancel_res (LPST_CL_SERVER pstClServer);
378 APP_VOID clserver_AbortCall (LPST_CL_SERVER pstClServer);
379 APP_VOID clserver_SendPkt (LPST_CL_SERVER pstClServer);
381 APP_VOID clserver_StubCall(LPST_CL_SERVER pstClServer, LPST_CL_SERVER_GLOBAL lpstServerGlobal);
383 APP_VOID clserver_StartTimer(LPST_CL_SERVER pstClServer,APP_BYTE byIdTimer);
384 APP_VOID clserver_StopTimer (LPST_CL_SERVER pstClServer,APP_BYTE byIdTimer);
388 APP_VOID clserver_InitStateMachine(LPST_CL_SERVER_GLOBAL lpstServerGlobal);
389 APP_BOOL clserver_Step (LPST_CL_SERVER_GLOBAL lpstServerGlobal);
390 APP_VOID clserver_ExitStateMachine(LPST_CL_SERVER_GLOBAL lpstServerGlobal);
392 APP_VOID clserver_RegisterInterface(LPST_INTERFACE_REGISTER pstRegInt);
394 #include "os_unpck.h"
396 #ifdef __TEST_SIMU_ERROR__
399 APP_BOOL test_rpcserver_lost_packet(APP_DWORD dwPacket);
400 APP_BOOL test_rpcserver_do_not_rec_packet(APP_DWORD dwPacket);
Definition: clserver.h:75
Definition: clserver.h:48
Definition: clserver.h:98
Definition: stk_sckt.h:49
Definition: clserver.h:240
Definition: clserver.h:283
Definition: clserver.h:207
Definition: clserver.h:309
Definition: schedule.h:40
Definition: clserver.h:259
Definition: clserver.h:230
Definition: clserver.h:293