⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wtls_state-decl.h

📁 The Kannel Open Source WAP and SMS gateway works as both an SMS gateway, for implementing keyword b
💻 H
📖 第 1 页 / 共 3 页
字号:
},        OPEN)/* Unitdata arrival - critical/fatal alert */ROW(COMMIT,        T_Unitdata_Ind,        is_critical_alert(event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Do the necessary SEC_Terminate_Ind stuff *//* And we're dead :-< */},        NULL_STATE)/* Unitdata arrival - warning alert */ROW(COMMIT,        T_Unitdata_Ind,        is_warning_alert(event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Do the necessary SEC_Exception_Ind stuff */},        COMMIT)/* Terminate */ROW(COMMIT,        SEC_Terminate_Req,        1,        {/* Send off a T_Unitdata_Req containing an alert as specified */send_alert(event->u.SEC_Terminate_Req.alert_level,        event->u.SEC_Terminate_Req.alert_desc, wtls_machine);},        NULL_STATE)/* Exception */ROW(COMMIT,        SEC_Exception_Req,        1,        {/* Send off a T_Unitdata_Req containing an exception as specified */send_alert(event->u.SEC_Exception_Req.alert_level,        event->u.SEC_Exception_Req.alert_desc, wtls_machine);},        COMMIT)/* Opening State *//* Create Request */ROW(OPENING,        SEC_Create_Request_Req,        1,        {/* Send off a T_Unitdata_Req containing a HelloRequest */},        OPENING)/* Send out UnitData */ROW(OPENING,        SEC_Unitdata_Req,        1,        {/* Apply the negotiated security "stuff" to the received packet *//* Send out the packet to the destination port/address requested */},        OPENING)/* Unitdata received - ClientHello *///ROW(OPENING,//        T_Unitdata_Ind,//        packet_contains_clienthello (event->u.T_Unitdata_Ind.pdu_list) == 0,//        {///* Hmm, they're obviously not happy with something we discussed, so let's head back to creating *////* Do the necessary SEC_Create_Ind stuff *///},//        CREATING)/* Unitdata received */ROW(OPENING,        T_Unitdata_Ind,        packet_contains_userdata(event->u.T_Unitdata_Ind.pdu_list) == 1,        {            wtls_Payload* tempPayload;            wtls_PDU* ApplicationPDU;			            tempPayload = (wtls_Payload*) list_search (event->u.T_Unitdata_Ind.pdu_list,                                                      (void*) Application_PDU,                                                      match_pdu_type);            if(tempPayload == NULL)                debug("wtls", 0, "no App PDU found in list !!!");            			debug("wtls",0, "PDU type: %d", tempPayload->type);			octstr_dump(tempPayload->data,0);			ApplicationPDU = wtls_pdu_unpack(tempPayload, wtls_machine);						wtls_pdu_dump(ApplicationPDU,0);						/* Apply the negotiated decryption/decoding/MAC check to the received data */			/* Take the userdata and pass it on up to the WTP/WSP, depending on the destination port */						/* calculate the padding length */	        /*			contentLength = octstr_len(bufferCopy);    	    macSize = hash_table[wtls_machine->mac_algorithm].mac_size;        	blockLength = bulk_table[wtls_machine->bulk_cipher_algorithm].block_size;			paddingLength = (contentLength + macSize + 1) % (blockLength);			*/			/* get the MAC */},        OPEN)/* Unitdata arrival - Certificate, ClientKeyExchange ... Finished */ROW(OPENING,        T_Unitdata_Ind,        certificates_are_identical(event->u.T_Unitdata_Ind.pdu_list, wtls_machine->last_received_packet) == 1 &&clientkeyexchanges_are_identical(event->u.T_Unitdata_Ind.pdu_list, wtls_machine->last_received_packet) == 1 && certifcateverifys_are_identical(event->u.T_Unitdata_Ind.pdu_list, wtls_machine->last_received_packet) == 1 &&changecipherspecs_are_identical(event->u.T_Unitdata_Ind.pdu_list, wtls_machine->last_received_packet) == 1 &&finisheds_are_indentical(event->u.T_Unitdata_Ind.pdu_list, wtls_machine->last_received_packet) == 1,        {/* It appears as though someone has sent us an identical ClientHello to the last one *//* Make ourselves a T_Unitdata_Req with the last_transmitted_packet *//* And send it on it's merry way */},        OPENING)/* Unitdata arrival - critical/fatal alert */ROW(OPENING,        T_Unitdata_Ind,        is_critical_alert(event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Do the necessary SEC_Terminate_Ind stuff *//* And we're dead :-< */},        NULL_STATE)/* Unitdata arrival - warning alert */ROW(OPENING,        T_Unitdata_Ind,        is_warning_alert(event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Do the necessary SEC_Exception_Ind stuff */},        OPENING)/* Terminate */ROW(OPENING,        SEC_Terminate_Req,        1,        {/* Send off a T_Unitdata_Req containing an alert as specified */send_alert(event->u.SEC_Terminate_Req.alert_level,        event->u.SEC_Terminate_Req.alert_desc, wtls_machine);},        NULL_STATE)/* Exception */ROW(OPENING,        SEC_Exception_Req,        1,        {/* Send off a T_Unitdata_Req containing an exception as specified */send_alert(event->u.SEC_Exception_Req.alert_level,        event->u.SEC_Exception_Req.alert_desc, wtls_machine);},        OPENING)/* Open State *//* Create Request */ROW(OPEN,        SEC_Create_Request_Req,        1,        {/* Send off a T_Unitdata_Req with a HelloRequest */},        OPEN)/* Send out UnitData */ROW(OPEN,        SEC_Unitdata_Req,        1,        { /* Apply the negotiated security "stuff" to the received packet *//* Send out the packet to the destination port/address requested */},        OPEN)/* Unitdata received - ClientHello */ROW(OPEN,        T_Unitdata_Ind,        packet_contains_clienthello (event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Hmm, they're obviously not happy with something we discussed, so let's head back to creating *//* Do the necessary SEC_Create_Ind stuff */},        CREATING)/* Unitdata received */ROW(OPEN,        T_Unitdata_Ind,        packet_contains_userdata(event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Apply the negotiated decryption/decoding/MAC check to the received data *//* Take the userdata and pass it on up to the WTP/WSP, depending on the destination port */},        OPEN)/* Unitdata arrival - ChangeCipherSpec, Finished */ROW(OPEN,        T_Unitdata_Ind,        packet_contains_changecipherspec (event->u.T_Unitdata_Ind.pdu_list) == 1 &&packet_contains_finished (event->u.T_Unitdata_Ind.pdu_list) == 1 &&packet_contains_userdata(event->u.T_Unitdata_Ind.pdu_list) != 1 &&finisheds_are_indentical(event->u.T_Unitdata_Ind.pdu_list, wtls_machine->last_received_packet) == 1,        {/* Just send out a T_Unitdata_Req with an Alert(duplicate_finished_received) */},        OPEN)/* Unitdata arrival - ChangeCipherSpec, Finished and UD */ROW(OPEN,        T_Unitdata_Ind,        packet_contains_changecipherspec (event->u.T_Unitdata_Ind.pdu_list) == 1 &&packet_contains_finished (event->u.T_Unitdata_Ind.pdu_list) == 1 &&packet_contains_userdata(event->u.T_Unitdata_Ind.pdu_list) == 1 &&finisheds_are_indentical(event->u.T_Unitdata_Ind.pdu_list, wtls_machine->last_received_packet) == 1,        {/* Apply the negotiated decryption/decoding/MAC check to the received data *//* Take the userdata and pass it on up to the WTP/WSP, depending on the destination port *//* Send out a T_Unitdata_Req with an Alert(duplicate_finished_received) */},        OPEN)/* Unitdata arrival - critical/fatal alert */ROW(OPEN,        T_Unitdata_Ind,        is_critical_alert(event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Do the necessary SEC_Terminate_Ind stuff *//* And we're dead :-< */},        NULL_STATE)/* Unitdata arrival - warning alert */ROW(OPEN,        T_Unitdata_Ind,        is_warning_alert(event->u.T_Unitdata_Ind.pdu_list) == 1,        {/* Do the necessary SEC_Terminate_Ind stuff */},        OPEN)/* Terminate */ROW(OPEN,        SEC_Terminate_Req,        1,        {/* Send off a T_Unitdata_Req containing an alert as specified */send_alert(event->u.SEC_Terminate_Req.alert_level,        event->u.SEC_Terminate_Req.alert_desc, wtls_machine);},        NULL_STATE)/* Exception */ROW(OPEN,        SEC_Exception_Req,        1,    {/* Send off a T_Unitdata_Req containing an exception as specified */send_alert(event->u.SEC_Exception_Req.alert_level,        event->u.SEC_Exception_Req.alert_desc, wtls_machine);},        OPEN)#undef ROW#undef STATE_NAME

⌨️ 快捷键说明

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