MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / csl3HandleFrame

Function csl3HandleFrame

Control/L3StateMachine.cpp:580–625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580static void csl3HandleFrame(const GSM::L3Frame *frame, L3LogicalChannel *lch)
581{
582 L3Message *l3msg = NULL;
583 // The primitives apply directly to the L3LogicalChannel and a specific SAPI, rather than to the MMContext.
584 if (! checkPrimitive(frame->primitive(), lch, frame->getSAPI())) { return; }
585 // Everything else runs on the MMContext.
586 MMContext *mmchan = lch->chanGetContext(true);
587 if (frame->isData()) {
588 l3msg = parseL3(*frame);
589 if (l3msg) {
590 WATCHINFO(lch <<" received L3 message "<<*l3msg);
591 } else {
592 LOG(ERR) <<lch<< " received unparseable Layer3 frame "<<*frame;
593 // We pass unparseable messages through to machineRunState1 to provide an error indication to
594 // any state machine that uses that function, but the default machrineRunState1 eliminates them
595 // so machineRunState never sees them.
596 }
597 bool deleteit;
598 if (l3msg && handleCommonMessages(l3msg, mmchan, &deleteit)) {
599 LOG(DEBUG) << "message handled by handleCommonMessagse"<<LOGVAR(l3msg);
600 if (deleteit) { delete l3msg; }
601 return;
602 }
603 }
604 mmchan->mmDispatchL3Frame(frame,l3msg);
605 if (l3msg) delete l3msg;
606#if UNUSED
607 L3Message *msg = NULL;
608 try {
609 // Even through parseL3 catches L3ReadError, looks to me like this can still throw SMS_READ_ERROR, so catch it:
610 msg = parseL3(*frame);
611 } catch (...) {
612 msg = NULL;
613 }
614 if (msg) {
615 LOG(DEBUG) <<lch <<" received L3 message "<<*msg;
616 csl3HandleLCHMsg(msg,lch);
617 } else {
618 L3PD PD = frame->PD();
619 int MTI = frame->MTI();
620 LOG(ERR) << "unparseable Layer3 message with"<<LOGVAR(PD)<<LOGVAR(MTI);
621 // Give the state machine a chance to do something about an error:
622 lch->chanGetContext(true)->mmDispatchError(PD,MTI,lch);
623 }
624#endif
625}
626
627#if UNUSED
628// Handle timeouts. Return the next timeout or -1 if no timeout is pending.

Callers 2

csl3HandleMsgMethod · 0.85
checkemMessagesFunction · 0.85

Calls 10

checkPrimitiveFunction · 0.85
handleCommonMessagesFunction · 0.85
csl3HandleLCHMsgFunction · 0.85
getSAPIMethod · 0.80
chanGetContextMethod · 0.80
isDataMethod · 0.80
mmDispatchL3FrameMethod · 0.80
primitiveMethod · 0.45
PDMethod · 0.45
MTIMethod · 0.45

Tested by

no test coverage detected