mirror of
https://github.com/RangeNetworks/openbts.git
synced 2025-11-02 12:53:15 +00:00
merge 5.0 preview from commercial
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
@@ -27,7 +26,6 @@
|
||||
#include "ScalarTypes.h"
|
||||
#include "SgsnBase.h"
|
||||
//#include "GPRSL3New.h"
|
||||
extern ConfigurationTable gConfig;
|
||||
using namespace std;
|
||||
#define DEHEXIFY(c) ((c)>=10 ? (c)-10+'a' : (c)+'0')
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
@@ -22,6 +21,7 @@
|
||||
#include "Sgsn.h"
|
||||
#include "Ggsn.h"
|
||||
#include "miniggsn.h"
|
||||
#include <GSMConfig.h>
|
||||
//#include "MSInfo.h" // To dump MSInfo
|
||||
#include "GPRSL3Messages.h"
|
||||
#define CASENAME(x) case x: return #x;
|
||||
@@ -111,15 +111,15 @@ void *miniGgsnReadServiceLoop(void *arg)
|
||||
{
|
||||
Ggsn *ggsn = (Ggsn*)arg;
|
||||
sethighpri();
|
||||
while (ggsn->active()) {
|
||||
while (ggsn->active() && !gBTS.btsShutdown()) {
|
||||
struct pollfd fds[1];
|
||||
fds[0].fd = tun_fd;
|
||||
fds[0].events = POLLIN;
|
||||
fds[0].revents = 0; // being cautious
|
||||
// We time out occassionally to check if the user wants to shut the sgsn down.
|
||||
if (-1 == poll(fds,1,ggsn->mStopTimeout)) {
|
||||
SGSNERROR("ggsn: poll failure");
|
||||
return 0;
|
||||
SGSNERROR("ggsn: poll failure, errno="<<strerror(errno));
|
||||
continue;
|
||||
}
|
||||
if (fds[0].revents & POLLIN) {
|
||||
miniggsn_handle_read();
|
||||
@@ -132,7 +132,7 @@ void *miniGgsnWriteServiceLoop(void *arg)
|
||||
{
|
||||
sethighpri();
|
||||
Ggsn *ggsn = (Ggsn*)arg;
|
||||
while (ggsn->active()) {
|
||||
while (ggsn->active() && !gBTS.btsShutdown()) {
|
||||
// 8-6-2012 This interthreadqueue is clumping things up. Try taking out the timeout.
|
||||
//PdpPdu *npdu = ggsn->mTxQ.read(ggsn->mStopTimeout);
|
||||
PdpPdu *npdu = ggsn->mTxQ.read();
|
||||
@@ -172,9 +172,11 @@ void *miniGgsnShellServiceLoop(void *arg)
|
||||
{
|
||||
Ggsn *ggsn = (Ggsn*)arg;
|
||||
std::string shname = gConfig.getStr(SQL_SHELLSCRIPT);
|
||||
while (ggsn->active()) {
|
||||
while (ggsn->active() && !gBTS.btsShutdown()) {
|
||||
ShellRequest *req = ggsn->mShellQ.read(ggsn->mStopTimeout);
|
||||
if (! req) continue;
|
||||
// (pat added 3-2014) Dont try to exec a shell script that does not exist; prevents a warning.
|
||||
if (0 != access(shname.c_str(),R_OK)) continue;
|
||||
runcmd("/bin/sh","sh",shname.c_str(), req->msrCommand.c_str(), req->msrArg1.c_str(),
|
||||
req->msrArg2.c_str(),req->msrArg3.c_str());
|
||||
delete req;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#
|
||||
# Copyright 2008 Free Software Foundation, Inc.
|
||||
# Copyright 2014 Range Networks, Inc.
|
||||
#
|
||||
# This software is distributed under the terms of the GNU Public License.
|
||||
# See the COPYING file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
@@ -1342,6 +1341,18 @@ bool MSUEAdapter::sgsnGetGeranFeaturePackI(uint32_t mshandle)
|
||||
}
|
||||
#endif
|
||||
|
||||
// If the MS is registered return the IMSI, otherwise return an empty string.
|
||||
string MSUEAdapter::sgsnFindImsiByHandle(uint32_t handle)
|
||||
{
|
||||
ScopedLock lock(sSgsnListMutex); // Will be locked again recursively in findSgsnInfoByHandle.
|
||||
if (SgsnInfo *si = findSgsnInfoByHandle(handle,false)) {
|
||||
GmmInfo *gmm = si->getGmm();
|
||||
if (gmm) return gmm->mImsi.hexstr();
|
||||
}
|
||||
return string("");
|
||||
}
|
||||
|
||||
|
||||
GmmState::state MSUEAdapter::sgsnGetRegistrationState(uint32_t mshandle)
|
||||
{
|
||||
SgsnInfo *si = sgsnGetSgsnInfoByHandle(mshandle,false);
|
||||
@@ -1584,7 +1595,7 @@ SgsnInfo * SgsnInfo::changeTlli(bool now)
|
||||
SgsnInfo *othersi = findSgsnInfoByHandle(newTlli,true);
|
||||
// We will use the new tlli for downlink l3 messages, eg, pdp context messages,
|
||||
// unless they use some other SI specifically, like AttachAccept
|
||||
// must be sent on the SI tha the AttachRequest arrived on.
|
||||
// must be sent on the SI that the AttachRequest arrived on.
|
||||
othersi->setGmm(gmm);
|
||||
if (now) { gmm->msi = othersi; }
|
||||
return othersi;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
@@ -137,6 +136,7 @@ class MSUEAdapter {
|
||||
int sgsnGetMultislotClass(uint32_t mshandle);
|
||||
bool sgsnGetGeranFeaturePackI(uint32_t mshandle);
|
||||
#endif
|
||||
string sgsnFindImsiByHandle(uint32_t handle);
|
||||
private:
|
||||
virtual uint32_t msGetHandle() = 0; // return URNTI or TLLI
|
||||
friend std::ostream& operator<<(std::ostream&os,const SgsnInfo*);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
@@ -509,7 +508,9 @@ bool miniggsn_init()
|
||||
|
||||
// This is the first message in the newly opened file.
|
||||
time(&gGgsnInitTime);
|
||||
MGINFO("Initializing Mini GGSN %s",ctime(&gGgsnInitTime)); // ctime includes a newline.
|
||||
std::string res;
|
||||
Timeval::isoTime(gGgsnInitTime, res, true);
|
||||
MGINFO("Initializing Mini GGSN %s\n",res.c_str());
|
||||
|
||||
if (mg_log_fp) {
|
||||
mg_debug_level = 1;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Copyright 2011 Range Networks, Inc.
|
||||
* All Rights Reserved.
|
||||
* Copyright 2011, 2014 Range Networks, Inc.
|
||||
*
|
||||
* This software is distributed under multiple licenses;
|
||||
* see the COPYING file in the main directory for licensing
|
||||
* information for this specific distribuion.
|
||||
* information for this specific distribution.
|
||||
*
|
||||
* This use of this software may be subject to additional restrictions.
|
||||
* See the LEGAL file in the main directory for details.
|
||||
|
||||
Reference in New Issue
Block a user