wtp_resp_states.def

来自「The Kannel Open Source WAP and SMS gatew」· DEF 代码 · 共 742 行 · 第 1/2 页

DEF
742
字号
      wap_event_destroy(resp_machine->result);      resp_machine->rid = 0;      begin_sar_result(resp_machine, event);	     },     RESULT_RESP_WAIT)/* * Conditions below do not correspond wholly ones found from the spec. (If  * they does, user acknowledgement flag would never be used by the protocol,  * which cannot be the original intention.)  * User acknowledgement flag is used following way: if it is on, WTP does not * send an acknowledgement (user acknowledgement in form of TR-Invoke.res or  * TR-Result.req instead of provider acknowledgement is awaited); if it is  * off, WTP does this. IMHO, specs support this exegesis: there is condition  * Uack == False && class == 2 with action send ack pdu. In addition, WTP  * 8.3.1 says " When [user acknowledgement] is enabled WTP provider does not * respond to a received message until after WTP user has confirmed the  * indication service primitive by issuing the response primitive". * * BTW: CR correcting this shall appear soonish. */ROW(INVOKE_RESP_WAIT,    TimerTO_A,    resp_machine->aec < AEC_MAX && resp_machine->u_ack == 1,    {      ++resp_machine->aec;     start_timer_A(resp_machine);    },    INVOKE_RESP_WAIT)ROW(INVOKE_RESP_WAIT,    TimerTO_A,    (resp_machine->aec < AEC_MAX && resp_machine->u_ack == 0),    {      ++resp_machine->aec;     start_timer_A(resp_machine);     send_ack(resp_machine, ACKNOWLEDGEMENT, resp_machine->rid);     if (resp_machine->ack_pdu_sent == 0)         resp_machine->ack_pdu_sent = 1;    },    INVOKE_RESP_WAIT)/* * When a transaction is aborted, WSP must surely know this. One of corrections * in MOT_WTP_CR_01. What to do when a counter reaches its maximum value dep- * ends on whether we have opened the connection or not. In previous case, we  * must go to the state WAIT_TIMEOUT_STATE, for instance to prevent bad incarn- * ations. */ROW(INVOKE_RESP_WAIT,    TimerTO_A,    resp_machine->aec == AEC_MAX && resp_machine->tcl == 2,    {     send_abort(resp_machine, PROVIDER, NORESPONSE);     wsp_event = create_tr_abort_ind(resp_machine, NORESPONSE);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)ROW(INVOKE_RESP_WAIT,    TimerTO_A,    resp_machine->aec == AEC_MAX && resp_machine->tcl == 1,    {      start_timer_W(resp_machine);    },    WAIT_TIMEOUT_STATE)ROW(INVOKE_RESP_WAIT,    RcvErrorPDU,    1,    {     send_abort(resp_machine, PROVIDER, PROTOERR);          wsp_event = create_tr_abort_ind(resp_machine, PROTOERR);     if (resp_machine->tcl == 1)         wsp_push_client_dispatch_event(wsp_event);     else         wsp_session_dispatch_event(wsp_event);    },    LISTEN)/* * Non-SARed */ROW(RESULT_WAIT,    TR_Result_Req,    resp_machine->sar == NULL,    {     WAPEvent *result;     resp_machine->rcr = 0;     start_timer_R(resp_machine);     wap_event_destroy(resp_machine->result);     resp_machine->rid = 0;     result = wtp_pack_result(resp_machine, event);     resp_machine->result = wap_event_duplicate(result);     dispatch_to_wdp(result);     resp_machine->rid = 1;    },    RESULT_RESP_WAIT)/* * SARed */ROW(RESULT_WAIT,    TR_Result_Req,    (resp_machine->sar != NULL) && ((octstr_len(event->u.TR_Result_Req.user_data)-1)/SAR_SEGM_SIZE < 255),    {     resp_machine->rcr = 0;     start_timer_R(resp_machine);     wap_event_destroy(resp_machine->result);     resp_machine->rid = 0;     begin_sar_result(resp_machine, event);	    },    RESULT_RESP_WAIT)ROW(RESULT_WAIT,    TR_Result_Req,    (resp_machine->sar != NULL) && ((octstr_len(event->u.TR_Result_Req.user_data)-1)/SAR_SEGM_SIZE >= 255),    {     send_abort(resp_machine, PROVIDER, NOTIMPLEMENTEDESAR);     wsp_event = create_tr_abort_ind(resp_machine, NOTIMPLEMENTEDESAR);     wsp_session_dispatch_event(wsp_event);     wap_event_destroy(resp_machine->result);    },    LISTEN)ROW(RESULT_WAIT,    RcvAbort,    1,    {     wsp_event = create_tr_abort_ind(resp_machine,          event->u.RcvAbort.abort_reason);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)ROW(RESULT_WAIT,    RcvInvoke,    event->u.RcvInvoke.rid == 0,    { },    RESULT_WAIT)ROW(RESULT_WAIT,    RcvInvoke,    event->u.RcvInvoke.rid == 1 && resp_machine->ack_pdu_sent == 0,    { },    RESULT_WAIT)ROW(RESULT_WAIT,    RcvInvoke,    event->u.RcvInvoke.rid == 1 && resp_machine->ack_pdu_sent == 1,    {     send_ack(resp_machine, ACKNOWLEDGEMENT, resp_machine->rid);    },    RESULT_WAIT)ROW(RESULT_WAIT,    TR_Abort_Req,    1,    {      send_abort(resp_machine, USER, event->u.TR_Abort_Req.abort_reason);    },    LISTEN)ROW(RESULT_WAIT,    RcvErrorPDU,    1,    {     send_abort(resp_machine, PROVIDER, PROTOERR);          wsp_event = create_tr_abort_ind(resp_machine, PROTOERR);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)   /* * This state follows two possible ones: INVOKE_RESP_WAIT & TR-Invoke.res and  * INVOKE_RESP_WAIT & TimerTO_A & Class == 2 & Uack == FALSE. Contrary what  * spec says, in first case we are now sending first time. We must, too, abort * after AEC_MAX timer periods. */ROW(RESULT_WAIT,    TimerTO_A,    resp_machine->aec < AEC_MAX,    {      start_timer_A(resp_machine);     send_ack(resp_machine, ACKNOWLEDGEMENT, resp_machine->rid);     if (resp_machine->ack_pdu_sent == 0)        resp_machine->ack_pdu_sent = 1;     resp_machine->aec++;    },    RESULT_WAIT)ROW(RESULT_WAIT,    TimerTO_A,    resp_machine->aec == AEC_MAX,    {     send_abort(resp_machine, PROVIDER, NORESPONSE);     wsp_event = create_tr_abort_ind(resp_machine, NORESPONSE);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)/* * A duplicate ack(tidok) caused by a heavy load (the original changed state * from TIDOK_WAIT). This implements CR-Nokia-WTP-20-March-2000/2. */ROW(RESULT_WAIT,    RcvAck,    event->u.RcvAck.tid_ok,    {},    RESULT_WAIT)/* * Non-SARed */ROW(RESULT_RESP_WAIT,    RcvAck,    resp_machine->sar == NULL || event->u.RcvAck.psn == resp_machine->sar->nsegm,    {     wsp_event = create_tr_result_cnf(resp_machine);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)/* * SARed */ROW(RESULT_RESP_WAIT,    RcvAck,    resp_machine->sar != NULL && event->u.RcvAck.psn != resp_machine->sar->nsegm,    {     continue_sar_result(resp_machine, event);	     },    RESULT_RESP_WAIT)ROW(RESULT_RESP_WAIT,    RcvNegativeAck,    resp_machine->sar != NULL,    {     resend_sar_result(resp_machine, event);	     },    RESULT_RESP_WAIT)/* * Specs does not tell what to do, when wtp responder receives invoke pdu and * its state is RESULT_RESP_WAIT. This can happen, however: event causing the  * transition RESULT_WAIT -> RESULT_RESP_WAIT is TR-Result.req, an internal  * responder event.  */ROW(RESULT_RESP_WAIT,    RcvInvoke,    1,    { },    RESULT_RESP_WAIT)ROW(RESULT_RESP_WAIT,    RcvAbort,    1,    {     wsp_event = create_tr_abort_ind(resp_machine,          event->u.RcvAbort.abort_reason);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)ROW(RESULT_RESP_WAIT,    TR_Abort_Req,    1,    {      send_abort(resp_machine, USER, event->u.TR_Abort_Req.abort_reason);    },    LISTEN)ROW(RESULT_RESP_WAIT,    TimerTO_R,    resp_machine->rcr < MAX_RCR,    {     WAPEvent *resend;     start_timer_R(resp_machine);     resend = wap_event_duplicate(resp_machine->result);     wtp_pack_set_rid(resend, resp_machine->rid);     dispatch_to_wdp(resend);     ++resp_machine->rcr;    },    RESULT_RESP_WAIT)ROW(RESULT_RESP_WAIT,    TimerTO_R,    resp_machine->rcr == MAX_RCR,    {     send_abort(resp_machine, PROVIDER, NORESPONSE);     wsp_event = create_tr_abort_ind(resp_machine, NORESPONSE);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)ROW(RESULT_RESP_WAIT,    RcvErrorPDU,    1,    {     send_abort(resp_machine, PROVIDER, PROTOERR);           wsp_event = create_tr_abort_ind(resp_machine, PROTOERR);     wsp_session_dispatch_event(wsp_event);    },    LISTEN)ROW(WAIT_TIMEOUT_STATE,    RcvInvoke,    event->u.RcvInvoke.rid == 0,    { },    WAIT_TIMEOUT_STATE)ROW(WAIT_TIMEOUT_STATE,    RcvInvoke,    event->u.RcvInvoke.rid == 1,    {     send_ack(resp_machine, ACKNOWLEDGEMENT, resp_machine->rid);    },    WAIT_TIMEOUT_STATE)ROW(WAIT_TIMEOUT_STATE,    RcvErrorPDU,    1,    {     send_abort(resp_machine, PROVIDER, PROTOERR);           wsp_event = create_tr_abort_ind(resp_machine, PROTOERR);     wsp_push_client_dispatch_event(wsp_event);    },    LISTEN)ROW(WAIT_TIMEOUT_STATE,    RcvAbort,    1,    {     wsp_event = create_tr_abort_ind(resp_machine, PROTOERR);     wsp_push_client_dispatch_event(wsp_event);    },    LISTEN)/* * Waiting to prevent premature incarnations. */ROW(WAIT_TIMEOUT_STATE,    TimerTO_W,    1,    {     wsp_event = create_tr_abort_ind(resp_machine, NORESPONSE);     wsp_push_client_dispatch_event(wsp_event);     },    LISTEN)ROW(WAIT_TIMEOUT_STATE,    TR_Abort_Req,    1,    {     send_abort(resp_machine, USER, event->u.TR_Abort_Req.abort_reason);    },    LISTEN)#undef ROW#undef STATE_NAME

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?