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

Method dispatchFrame

Control/L3StateMachine.cpp:365–408  ·  view source on GitHub ↗

l3msg may be NULL for primitives or unparseable messages.

Source from the content-addressed store, hash-verified

363
364// l3msg may be NULL for primitives or unparseable messages.
365MachineStatus MachineBase::dispatchFrame(const L3Frame *frame, const L3Message *l3msg)
366{
367 int state;
368 if (frame) {
369 if (frame->isData()) {
370 // Note: the frame MTI must be ANDed with 0xbf. See 4.08 10.4. I moved that into class L3Frame.
371 state = L3CASE_RAW(frame->PD(),frame->MTI());
372 } else {
373 state = L3CASE_PRIMITIVE(frame->primitive());
374 }
375 } else if (l3msg) {
376 state = L3CASE_RAW(l3msg->PD(),l3msg->MTI());
377 } else {
378 LOG(ERR) << "called with no arguments?";
379 return MachineStatusOK;
380 }
381 return machineRunState1(state,frame,l3msg);
382#if 0
383 if (frame->isData()) {
384 if (L3Message *msg = parseL3(*frame)) {
385 LOG(DEBUG) <<channel() <<" received L3 message "<<*msg;
386 // Manufacture an integral state from the msg.
387 // Note we overload pd==0 (Group Call Control) for naked states in the state machines, which is ok because
388 // we dont support Group Call and even if we did, the Group Call MTIs (GSM 04.68 9.3) will probably not collide
389 // because there are no small numberic MTIs.
390 int state = L3CASE_RAW(frame->PD(),frame->MTI());
391 LOG(DEBUG) <<"calling machineRunState1 "<<LOGHEX(state)<<machText()<<LOGVAR(frame);
392 //MachineStatus result = machineRunL3Msg(state, msg);
393 MachineStatus result = machineRunState1(state, frame, msg, NULL);
394 delete msg;
395 return result;
396 } else {
397 LOG(ERR) <<channel()<< " received unparseable Layer3 frame "<<*frame;
398 //old: lch->chanGetContext(true)->mmDispatchError(PD,MTI,lch);
399 return MachineStatusOK; // Was not handled, but the caller cant do anything more with this frame.
400 }
401 } else {
402 Primitive primitive = frame->primitive();
403 int state = L3CASE_PRIMITIVE(primitive);
404 LOG(DEBUG) <<"calling machineRunState1 "<<LOGHEX(state)<<machText()<<LOGVAR(primitive);
405 return machineRunState1(state);
406 }
407#endif
408}
409
410// The procedure is pre-locked by the caller.
411MachineStatus MachineBase::dispatchTimeout(L3Timer*timer)

Callers 1

lockAndInvokeFrameMethod · 0.80

Calls 4

isDataMethod · 0.80
PDMethod · 0.45
MTIMethod · 0.45
primitiveMethod · 0.45

Tested by

no test coverage detected