wsp_client_session_states.def
来自「mms client」· DEF 代码 · 共 697 行 · 第 1/2 页
DEF
697 行
/* * wsp_client_session_states.def - states for WSP session state machines * * Macro calls to generate rows of the state table. See the documentation for * guidance how to use and update these. * * Note that `NULL' state is renamed to `NULL_SESSION' because NULL is * reserved by C. * * Marcel Jansen */STATE_NAME(NULL_SESSION)STATE_NAME(CONNECTING)STATE_NAME(CONNECTED)STATE_NAME(SUSPENDED)STATE_NAME(RESUMING)ROW(NULL_SESSION, S_Connect_Req, 1, { Octstr *opdu; opdu = make_connect_pdu(sm); send_invoke(sm, opdu, 0, PROVIDER_ACKNOWLEDGEMENT, TRANSACTION_CLASS_2); }, CONNECTING)ROW(CONNECTING, S_Disconnect_Req, 1, { if (sm->connect_handle >= 0) /* TR-Abort.req(DISCONNECT) the Connect transaction */ send_abort(WSP_ABORT_DISCONNECT, sm->connect_handle); /* Abort(DISCONNECT) all outstanding method transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_USERREQ); }, NULL_SESSION)ROW(CONNECTING, Disconnect_Event, 1, { if (sm->connect_handle >= 0) /* TR-Abort.req(DISCONNECT) the Connect transaction */ send_abort(WSP_ABORT_DISCONNECT, sm->connect_handle); /* Abort(DISCONNECT) all outstanding method transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(CONNECTING, S_MethodInvoke_Req, 1, { WSPClientMethodMachine *msm; /* start a new method invoke with this event (see method state table) */ msm = method_machine_create(sm, current_event->u.S_MethodInvoke_Req.client_transaction_id); /* Hand off the event to the new method machine */ handle_method_event(sm, msm, current_event, pdu); }, CONNECTING)ROW(CONNECTING, S_MethodAbort_Req, 1, { WSPClientMethodMachine *msm; /* See method state table */ msm = find_client_method_machine(sm, current_event->u.S_MethodAbort_Req.transaction_id); handle_method_event(sm, msm, current_event, pdu); }, CONNECTING)ROW(CONNECTING, Suspend_Event, 1, { send_abort(WSP_ABORT_DISCONNECT, sm->connect_handle); /* Abort(DISCONNECT) all outstanding method transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_SUSPEND); }, NULL_SESSION)ROW(CONNECTING, TR_Invoke_Ind, current_event->u.TR_Invoke_Ind.tcl == 1 && pdu->type == ConfirmedPush, { /* TR-Abort.req(PROTOERR) the TR-Invoke */ send_abort(WSP_ABORT_PROTOERR, e->handle); }, CONNECTING)ROW(CONNECTING, TR_Result_Ind, current_event->u.TR_Result_Ind.handle == sm->connect_handle && pdu->type == ConnectReply, { /* TR-Result.res */ sendResultResponse(current_event->u.TR_Result_Ind.handle); /* Session_ID = SessionId from PDU */ sm->server_session_id = pdu->u.ConnectReply.sessionid; /* S-Connect.cnf */ confirm_connect(sm, wsp_headers_unpack(pdu->u.ConnectReply.headers, 1), wsp_cap_unpack_list(pdu->u.ConnectReply.capabilities)); }, CONNECTED)ROW(CONNECTING, TR_Result_Ind, current_event->u.TR_Result_Ind.handle == sm->connect_handle && pdu->type == Redirect, { /* TR-Result.res */ sendResultResponse(current_event->u.TR_Result_Ind.handle); /* abort(CONNECTERR) all outstanding method transactions */ abort_methods(sm, WSP_ABORT_CONNECTERR); /* TODO: support redirect properly S-disconnect.ind(Redirect parameters) */ indicate_disconnect(sm, WSP_ABORT_SUSPEND); }, NULL_SESSION)ROW(CONNECTING, TR_Result_Ind, current_event->u.TR_Result_Ind.handle == sm->connect_handle && pdu->type == Reply, { /* TR-Result.res */ sendResultResponse(current_event->u.TR_Result_Ind.handle); /* abort(CONNECTERR) all outstanding method transactions */ abort_methods(sm, WSP_ABORT_CONNECTERR); /* TODO: how to fill in reply parameters S-disconnect.ind(Reply parameters) */ indicate_disconnect(sm, WSP_ABORT_SUSPEND); }, NULL_SESSION)ROW(CONNECTING, TR_Result_Ind, /* method transaction */ current_event->u.TR_Result_Ind.handle != sm->connect_handle, { WSPClientMethodMachine *msm; WAPEvent *ab; /* abort(PROTOERR) the method transaction */ abort_method(sm, e->handle, WSP_ABORT_PROTOERR); }, CONNECTING)ROW(CONNECTING, TR_Invoke_Cnf, /* method transaction */ current_event->u.TR_Invoke_Cnf.handle != sm->connect_handle, { WSPClientMethodMachine *msm; WAPEvent *ab; /* abort(PROTOERR) the method transaction */ abort_method(sm, e->handle, WSP_ABORT_PROTOERR); }, CONNECTING)ROW(CONNECTING, TR_Abort_Ind, current_event->u.TR_Abort_Ind.handle == sm->connect_handle, { /* abort(CONNECTERR) all outstanding method transactions */ abort_methods(sm, WSP_ABORT_CONNECTERR); /* S-disconnect.ind(abort reason) */ indicate_disconnect(sm, current_event->u.TR_Abort_Ind.abort_code); }, NULL_SESSION)ROW(CONNECTING, TR_Abort_Ind, current_event->u.TR_Abort_Ind.handle != sm->connect_handle, { WSPClientMethodMachine *msm; /* See method state table */ msm = find_client_method_machine(sm, e->handle); handle_method_event(sm, msm, current_event, pdu); }, CONNECTING)ROW(CONNECTED, S_Disconnect_Req, 1, { Octstr *opdu; /* abort(DISCONNECT) all method and push transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* TR-Invoke.req(Class 0, Disconnect) */ opdu = make_disconnect_pdu(sm); send_invoke(sm, opdu, sm->connect_handle, USER_ACKNOWLEDGEMENT, TRANSACTION_CLASS_0); /* S-disconnect.ind(USERREQ) */ indicate_disconnect(sm, WSP_ABORT_USERREQ); }, NULL_SESSION)ROW(CONNECTED, Disconnect_Event, 1, { /* abort(DISCONNECT) all method and push transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-disconnect.ind(DISCONNECT) */ indicate_disconnect(sm, WSP_ABORT_DISCONNECT); }, NULL_SESSION)ROW(CONNECTED, S_MethodInvoke_Req, 1, { WSPClientMethodMachine *msm; /* start a new method invoke with this event (see method state table */ msm = method_machine_create(sm, current_event->u.S_MethodInvoke_Req.client_transaction_id); /* Hand off the event to the new method machine */ handle_method_event(sm, msm, current_event, pdu); }, CONNECTED)ROW(CONNECTED, S_MethodResult_Res, 1, { WSPClientMethodMachine *msm; /* See method state table */ msm = find_client_method_machine(sm, current_event->u.S_MethodResult_Res.client_transaction_id); handle_method_event(sm, msm, current_event, pdu); }, CONNECTED)ROW(CONNECTED, S_MethodAbort_Req, 1, { WSPClientMethodMachine *msm; /* See method state table */ msm = find_client_method_machine(sm, current_event->u.S_MethodAbort_Req.transaction_id); handle_method_event(sm, msm, current_event, pdu); }, CONNECTED)ROW(CONNECTED, S_ConfirmedPush_Res, 1, { /* See push state table*/ WSPClientPushMachine *spm; spm = find_push_machine(sm, current_event->u.S_ConfirmedPush_Res.client_push_id); handle_push_event(sm, spm, current_event, pdu); }, CONNECTED)ROW(CONNECTED, S_PushAbort_Req, 1, { /* See push state table*/ WSPClientPushMachine *spm; spm = find_push_machine(sm, current_event->u.S_PushAbort_Req.push_id); handle_push_event(sm, spm, current_event, pdu); }, CONNECTED)ROW(CONNECTED, S_Suspend_Req, 1, { Octstr *opdu; /* abort(DISCONNECT) all method and push transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* TR-Invoke.req(Class 0, Suspend) */ opdu = make_suspend_pdu(sm); send_invoke(sm, opdu, sm->connect_handle, USER_ACKNOWLEDGEMENT, TRANSACTION_CLASS_0); /* S-Suspend.ind(USERREQ) */ indicate_suspend(sm, WSP_ABORT_USERREQ); }, SUSPENDED)ROW(CONNECTED, Suspend_Event, ! resume_enabled, { /* abort(DISCONNECT) all method and push transactions */ abort_methods(sm, WSP_ABORT_DISCONNECT); /* S-Disconnect.ind(SUSPEND) */ indicate_disconnect(sm, WSP_ABORT_SUSPEND); }, NULL_SESSION)ROW(CONNECTED, Suspend_Event, resume_enabled, { /* abort(SUSPEND) all method and push transactions */ abort_methods(sm, WSP_ABORT_SUSPEND); /* S-Suspend.ind(SUSPEND) */ indicate_suspend(sm, WSP_ABORT_SUSPEND); }, SUSPENDED)ROW(CONNECTED, S_Resume_Req, 1, { Octstr *opdu; /* abort(USERREQ) all method and push transactions */ abort_methods(sm, WSP_ABORT_USERREQ); /* Bind session tot he new peer address quadruplet */ sm->addr_tuple = wap_addr_tuple_duplicate(current_event->u.S_Resume_Req.addr_tuple); /* TR-Invoke(Class 2, Resume) */ opdu = make_resume_pdu(NULL, current_event->u.S_Resume_Req.client_headers); send_invoke(sm, opdu, sm->connect_handle, USER_ACKNOWLEDGEMENT, TRANSACTION_CLASS_2);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?