//copy from spp tcapparser.cpp
void CTcapTrans::handleComponents(unsigned char* inbuf, int inbuf_len, unsigned int opc, unsigned int dpc, unsigned char ossn, unsigned char dssn, char* cggt, char* cdgt)
{
    STcapIEHeader stTag;
    unsigned char *pNextTag = NULL;
    int iNextTagLen = 0;

    if (NULL == inbuf || inbuf_len<= 0)
    {
        LOG4CXX_DEBUG(rootlog, "switch["<<m_pSwitch->getID()<<"] "<< __FILE__ <<"::"<<__LINE__<<": ParseCompPortion... the input parameter is error!");
        return;
    }

    pNextTag = inbuf;
    iNextTagLen = inbuf_len;

    do
    {
        if(CTcapParser::ParseIEHeader(pNextTag, iNextTagLen, &stTag) < 0)
        {
        	LOG4CXX_DEBUG(rootlog, "switch["<<m_pSwitch->getID()<<"] "<< __FILE__<<"::"<<__LINE__<<": TCAP message parse tag error!");
            return;
        }

        switch (stTag.tagID)
        {
        case TCAP_TAG_INVOKE:           // 调用
            handleInvoke(stTag.pData, stTag.dataLen, opc, dpc, ossn, dssn, cggt, cdgt);
            break;

        case TCAP_TAG_RETURN_RESULT_L:  // 返回结果(最终)
            handleReturnRlstLast(stTag.pData, stTag.dataLen, ossn, dssn, cggt, cdgt);
            break;

        case TCAP_TAG_RETURN_ERROR:     // 返回差错
            handleReturnError(stTag.pData, stTag.dataLen, ossn, dssn, cggt, cdgt);
            break;

        case TCAP_TAG_REJECT:           // 拒绝
            handleReject(stTag.pData, stTag.dataLen, ossn, dssn, cggt, cdgt);
            break;

        case TCAP_TAG_RETURN_RESULT_NL: // 返回结果(非最终)
            handleReturnRlstNLast(stTag.pData, stTag.dataLen, ossn, dssn, cggt, cdgt);
            break;
        default:
            break;
        }

        pNextTag = stTag.pData + stTag.dataLen;
        iNextTagLen = inbuf_len - (pNextTag - inbuf);

    }while (iNextTagLen > 0);

}
Example #2
0
void Debugger::afterInvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid) {
	handleInvoke(interpreter, invokeElem, invokeid, Breakpoint::AFTER, Breakpoint::INVOKE);
}
Example #3
0
void Debugger::beforeUninvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invokeElem, const std::string& invokeid) {
	handleInvoke(interpreter, invokeElem, invokeid, Breakpoint::BEFORE, Breakpoint::UNINVOKE);
}
 }    bool
 RTMPSession::handleMessage(uint8_t *p, uint8_t msgTypeId)
 {
     bool ret = true;
     
     switch(msgTypeId) {
         case RTMP_PT_BYTES_READ:
         {
             //DLog("received bytes read: %d\n", get_be32(p));
         }
             break;
             
         case RTMP_PT_CHUNK_SIZE:
         {
             unsigned long newChunkSize = get_be32(p);
             DLog("Request to change incoming chunk size from %zu -> %zu\n", m_inChunkSize, newChunkSize);
             m_inChunkSize = newChunkSize;
         }
             break;
             
         case RTMP_PT_PING:
         {
             DLog("received ping, sending pong.\n");
             sendPong();
         }
             break;
             
         case RTMP_PT_SERVER_WINDOW:
         {
             DLog("received server window size: %d\n", get_be32(p));
         }
             break;
             
         case RTMP_PT_PEER_BW:
         {
             DLog("received peer bandwidth limit: %d type: %d\n", get_be32(p), p[4]);
         }
             break;
             
         case RTMP_PT_INVOKE:
         {
             DLog("Received invoke\n");
             handleInvoke(p);
         }
             break;
         case RTMP_PT_VIDEO:
         {
             DLog("received video\n");
         }
             break;
             
         case RTMP_PT_AUDIO:
         {
             DLog("received audio\n");
         }
             break;
             
         case RTMP_PT_METADATA:
         {
             DLog("received metadata\n");
         }
             break;
             
         case RTMP_PT_NOTIFY:
         {
             DLog("received notify\n");
         }
             break;
             
         default:
         {
             DLog("received unknown packet type: 0x%02X\n", msgTypeId);
             ret = false;
         }
             break;
     }
     return ret;
 }
Example #5
0
void Debugger::afterInvoking(Interpreter interpreter, const Arabica::DOM::Element<std::string>& invokeElem, const std::string& invokeid) {
	handleInvoke(interpreter, invokeElem, invokeid, Breakpoint::AFTER, Breakpoint::INVOKE);
}
Example #6
0
void Debugger::beforeUninvoking(Interpreter interpreter, const Arabica::DOM::Element<std::string>& invokeElem, const std::string& invokeid) {
	handleInvoke(interpreter, invokeElem, invokeid, Breakpoint::BEFORE, Breakpoint::UNINVOKE);
}