Пример #1
0
unsigned Pager::pageAll()
{
    // Traverse the full list and page all IDs.
    // Remove expired IDs.
    // Return the number of IDs paged.
    // This is a linear time operation.

    mLock.lock();

    // Clear expired entries.
    PagingEntryList::iterator lp = mPageIDs.begin();
    while (lp != mPageIDs.end()) {
        if (!lp->expired()) ++lp;
        else {
            // DO NOT remove the transaction entry here.
            // It may be in use in an active call.
            LOG(INFO) << "erasing " << lp->ID();
            lp=mPageIDs.erase(lp);
        }
    }

    LOG(INFO) << "paging " << mPageIDs.size() << " mobile(s)";

    // Page remaining entries, two at a time if possible.
    // These PCH send operations are non-blocking.
    lp = mPageIDs.begin();
    while (lp != mPageIDs.end()) {
        // FIXME -- This completely ignores the paging groups.
        // HACK -- So we send every page twice.
        // That will probably mean a different Pager for each subchannel.
        // See GSM 04.08 10.5.2.11 and GSM 05.02 6.5.2.
        const L3MobileIdentity& id1 = lp->ID();
        ChannelType type1 = lp->type();
        ++lp;
        if (lp==mPageIDs.end()) {
            // Just one ID left?
            LOG(DEBUG) << "paging " << id1;
            gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
            gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
            break;
        }
        // Page by pairs when possible.
        const L3MobileIdentity& id2 = lp->ID();
        ChannelType type2 = lp->type();
        ++lp;
        LOG(DEBUG) << "paging " << id1 << " and " << id2;
        gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1,id2,type2));
        gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1,id2,type2));
    }

    mLock.unlock();

    return mPageIDs.size();
}
unsigned Pager::pageAll()
{
	// Traverse the full list and page all IDs.
	// Remove expired IDs.
	// Return the number of IDs paged.
	// This is a linear time operation.

	mLock.lock();


	
	
	
	

	// Clear expired entries.
	PagingEntryList::iterator lp = mPageIDs.begin();
	while (lp != mPageIDs.end()) {
		if (!lp->expired()) ++lp;
		else {
			// DO NOT remove the transaction entry here.
			// It may be in use in an active call.
			LOG(INFO) << "erasing " << lp->ID();
			lp=mPageIDs.erase(lp);
		}
	}

	LOG(INFO) << "paging " << mPageIDs.size() << " mobile(s)";

	// Page remaining entries, two at a time if possible.
	// These PCH send operations are non-blocking.
	lp = mPageIDs.begin();
	while (lp != mPageIDs.end()) {
		// FIXME -- This completely ignores the paging groups.
		// HACK -- So we send every page twice.
		// That will probably mean a different Pager for each subchannel.
		// See GSM 04.08 10.5.2.11 and GSM 05.02 6.5.2.
		//const FuzzingL3MobileIdentity &FuzzingID1=lp->FuzzingID();
		const L3MobileIdentity& id1 = lp->ID();
		ChannelType type1 = lp->type();
		++lp;

		
		if(gFuzzingControl.state()==L3Fuzzing&&gFuzzingControl.PD()==GSM::L3MobilityManagementPD&&gFuzzingControl.MTI()==L3MMMessage::LocationUpdatingAccept){
			LOG(INFO)<<"Sending Paging Request for Location Updating Accept Fuzzing: "<<id1;
			COUT("Sending SendingPaging Request for Location Updating Accept Fuzzing: "<<id1);
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			removeID(id1);
			break;
			}
		if(gFuzzingControl.state()==L3Fuzzing&&gFuzzingControl.PD()==GSM::L3MobilityManagementPD&&gFuzzingControl.MTI()==L3MMMessage::MMInformation){
			LOG(INFO)<<"SendingPaging Request for Fuzzing L3MMInformation "<<id1;
			COUT("Sending SendingPaging Request for L3MMInformation "<<id1);
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			removeID(id1);
			break;
			}

		if(gFuzzingControl.state()==TestPhoneConnect){
			LOG(INFO)<<"SendingPaging Request for testing Phone connection state"<<id1;
			COUT("Sending SendingPaging Request for testing Phone connection state "<<id1);
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			removeID(id1);
			break;
			}
		
		if (lp==mPageIDs.end()) {
			// Just one ID left?
			LOG(INFO) << "L3PagingRequestType1 is "<<L3PagingRequestType1(id1,type1);
			LOG(INFO) << "paging " << id1;
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1));
			break;
		}
		// Page by pairs when possible.
		const L3MobileIdentity& id2 = lp->ID();
		ChannelType type2 = lp->type();
		++lp;
		LOG(INFO) << "paging " << id1 << " and " << id2;
		gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1,id2,type2));
		gBTS.getPCH(0)->send(L3PagingRequestType1(id1,type1,id2,type2));
	}
	
	mLock.unlock();

	return mPageIDs.size();
}