Merge 'achemeris/pending' into 'USSD'
This commit is contained in:
commit
216ade372c
|
@ -290,6 +290,19 @@ int tmsis(int argc, char** argv, ostream& os, istream& is)
|
|||
}
|
||||
|
||||
|
||||
/** Print the transactions table. */
|
||||
int trans(int argc, char** argv, ostream& os, istream& is)
|
||||
{
|
||||
if (argc!=1) return BAD_NUM_ARGS;
|
||||
|
||||
// os << "TMSI IMSI IMEI age used" << endl;
|
||||
gTransactionTable.dump(os);
|
||||
os << endl << gTransactionTable.size() << " transactions in table" << endl;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int findimsi(int argc, char** argv, ostream& os, istream& is)
|
||||
{
|
||||
|
@ -769,6 +782,7 @@ Parser::Parser()
|
|||
addCommand("help", showHelp, "[command] -- list available commands or gets help on a specific command.");
|
||||
addCommand("exit", exit_function, "[wait] -- exit the application, either immediately, or waiting for existing calls to clear with a timeout in seconds");
|
||||
addCommand("tmsis", tmsis, "[\"clear\"] or [\"dump\" filename] -- print/clear the TMSI table or dump it to a file.");
|
||||
addCommand("trans", trans, "-- print the transactions table.");
|
||||
addCommand("findimsi", findimsi, "[IMSIPrefix] -- prints all imsi's that are prefixed by IMSIPrefix");
|
||||
addCommand("sendsms", sendsms, "<IMSI> <src> -- send SMS to <IMSI>, addressed from <src>, after prompting.");
|
||||
addCommand("sendrrlp", sendrrlp, "<IMSI> <hexstring> -- send RRLP message <hexstring> to <IMSI>.");
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "Threads.h"
|
||||
#include "Timeval.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -72,16 +73,17 @@ void unlockCerr()
|
|||
|
||||
Mutex::Mutex()
|
||||
{
|
||||
assert(!pthread_mutexattr_init(&mAttribs));
|
||||
assert(!pthread_mutexattr_settype(&mAttribs,PTHREAD_MUTEX_RECURSIVE));
|
||||
assert(!pthread_mutex_init(&mMutex,&mAttribs));
|
||||
pthread_mutexattr_init(&mAttribs);
|
||||
int s = pthread_mutexattr_settype(&mAttribs,PTHREAD_MUTEX_RECURSIVE);
|
||||
assert(s!=0);
|
||||
pthread_mutex_init(&mMutex,&mAttribs);
|
||||
}
|
||||
|
||||
|
||||
Mutex::~Mutex()
|
||||
{
|
||||
pthread_mutex_destroy(&mMutex);
|
||||
assert(!pthread_mutexattr_destroy(&mAttribs));
|
||||
pthread_mutexattr_destroy(&mAttribs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -95,22 +97,79 @@ void Signal::wait(Mutex& wMutex, unsigned timeout) const
|
|||
pthread_cond_timedwait(&mSignal,&wMutex.mMutex,&waitTime);
|
||||
}
|
||||
|
||||
/** Wait for semaphore to be signaled with timeout.
|
||||
* @returns 0 on success, -1 on error or timeout.
|
||||
*/
|
||||
int ThreadSemaphore::wait(unsigned timeout) const
|
||||
ThreadSemaphore::Result ThreadSemaphore::wait(unsigned timeoutMs)
|
||||
{
|
||||
Timeval then(timeout);
|
||||
Timeval then(timeoutMs);
|
||||
struct timespec waitTime = then.timespec();
|
||||
return sem_timedwait(&mSem,&waitTime);
|
||||
int s;
|
||||
while ((s = sem_timedwait(&mSem,&waitTime)) == -1 && errno == EINTR)
|
||||
continue;
|
||||
|
||||
if (s == -1)
|
||||
{
|
||||
if (errno == ETIMEDOUT)
|
||||
{
|
||||
return TSEM_TIMEOUT;
|
||||
}
|
||||
return TSEM_ERROR;
|
||||
}
|
||||
return TSEM_OK;
|
||||
}
|
||||
|
||||
ThreadSemaphore::Result ThreadSemaphore::wait()
|
||||
{
|
||||
int s;
|
||||
while ((s = sem_wait(&mSem)) == -1 && errno == EINTR)
|
||||
continue;
|
||||
|
||||
if (s == -1)
|
||||
{
|
||||
return TSEM_ERROR;
|
||||
}
|
||||
return TSEM_OK;
|
||||
}
|
||||
|
||||
ThreadSemaphore::Result ThreadSemaphore::trywait()
|
||||
{
|
||||
int s;
|
||||
while ((s = sem_trywait(&mSem)) == -1 && errno == EINTR)
|
||||
continue;
|
||||
|
||||
if (s == -1)
|
||||
{
|
||||
if (errno == EAGAIN)
|
||||
{
|
||||
return TSEM_TIMEOUT;
|
||||
}
|
||||
return TSEM_ERROR;
|
||||
}
|
||||
return TSEM_OK;
|
||||
}
|
||||
|
||||
ThreadSemaphore::Result ThreadSemaphore::post()
|
||||
{
|
||||
if (sem_post(&mSem) != 0)
|
||||
{
|
||||
if (errno == EOVERFLOW)
|
||||
{
|
||||
return TSEM_OVERFLOW;
|
||||
}
|
||||
return TSEM_ERROR;
|
||||
}
|
||||
return TSEM_OK;
|
||||
}
|
||||
|
||||
void Thread::start(void *(*task)(void*), void *arg)
|
||||
{
|
||||
int s;
|
||||
assert(mThread==((pthread_t)0));
|
||||
assert(!pthread_attr_init(&mAttrib));
|
||||
assert(!pthread_attr_setstacksize(&mAttrib, mStackSize));
|
||||
assert(!pthread_create(&mThread, &mAttrib, task, arg));
|
||||
|
||||
s = pthread_attr_init(&mAttrib);
|
||||
assert(s == 0);
|
||||
s = pthread_attr_setstacksize(&mAttrib, mStackSize);
|
||||
assert(s == 0);
|
||||
s = pthread_create(&mThread, &mAttrib, task, arg);
|
||||
assert(s == 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class Signal {
|
|||
|
||||
public:
|
||||
|
||||
Signal() { assert(!pthread_cond_init(&mSignal,NULL)); }
|
||||
Signal() { int s = pthread_cond_init(&mSignal,NULL); assert(s == 0); }
|
||||
|
||||
~Signal() { pthread_cond_destroy(&mSignal); }
|
||||
|
||||
|
@ -126,30 +126,55 @@ class ThreadSemaphore {
|
|||
|
||||
private:
|
||||
|
||||
mutable sem_t mSem;
|
||||
sem_t mSem;
|
||||
|
||||
public:
|
||||
|
||||
ThreadSemaphore(int pshared = 0, unsigned value = 0) { assert(sem_init(&mSem,pshared,value)!=-1); }
|
||||
enum Result {
|
||||
TSEM_OK, ///< Success.
|
||||
TSEM_TIMEOUT, ///< wait() or trywait() timed out.
|
||||
TSEM_OVERFLOW, ///< post() overflows a semaphore
|
||||
TSEM_ERROR ///< Generic error.
|
||||
};
|
||||
|
||||
/** Create and initialize semaphore.
|
||||
* @param[in] value - initial semaphore value.
|
||||
*/
|
||||
ThreadSemaphore(unsigned value = 0)
|
||||
{
|
||||
int s = sem_init(&mSem,0,value);
|
||||
assert(s == 0);
|
||||
}
|
||||
|
||||
~ThreadSemaphore() { sem_destroy(&mSem); }
|
||||
|
||||
/** Wait for semaphore to be signaled with timeout.
|
||||
* @returns 0 on success, -1 on error or timeout.
|
||||
* @param[in] timeoutMs - timeout in milliseconds
|
||||
*
|
||||
* @retval TSEM_OK on success.
|
||||
* @retval TSEM_TIMEOUT on timeout.
|
||||
* @retval TSEM_ERROR on error.
|
||||
*/
|
||||
int wait (unsigned timeout) const;
|
||||
Result wait(unsigned timeoutMs);
|
||||
|
||||
/** Wait for semaphore to be signaled infinitely.
|
||||
* @returns 0 on success, -1 on error.
|
||||
* @retval TSEM_OK on success.
|
||||
* @retval TSEM_ERROR on error.
|
||||
*/
|
||||
int wait() const { return sem_wait(&mSem); }
|
||||
|
||||
/** Check if semaphore has been signaled and disarm it.
|
||||
* @returns 0 if semaphore has been signaled, -1 in other cases.
|
||||
*/
|
||||
int trywait() const { return sem_trywait(&mSem); }
|
||||
Result wait();
|
||||
|
||||
int post() { return sem_post (&mSem); }
|
||||
/** Check if semaphore has been signaled and disarm it.
|
||||
* @retval TSEM_OK is semaphore is signaled.
|
||||
* @retval TSEM_TIMEOUT if semaphore is not signaled.
|
||||
* @retval TSEM_ERROR on error.
|
||||
*/
|
||||
Result trywait();
|
||||
|
||||
/** Signal semaphore.
|
||||
* @retval TSEM_OK on success.
|
||||
* @retval TSEM_ERROR on error.
|
||||
*/
|
||||
Result post();
|
||||
|
||||
};
|
||||
|
||||
|
@ -176,14 +201,14 @@ class Thread {
|
|||
Destroy the Thread.
|
||||
It should be stopped and joined.
|
||||
*/
|
||||
~Thread() { assert(!pthread_attr_destroy(&mAttrib)); }
|
||||
~Thread() { int s = pthread_attr_destroy(&mAttrib); assert(s==0); }
|
||||
|
||||
|
||||
/** Start the thread on a task. */
|
||||
void start(void *(*task)(void*), void *arg);
|
||||
|
||||
/** Join a thread that will stop on its own. */
|
||||
void join() { assert(!pthread_join(mThread,NULL)); }
|
||||
void join() { int s = pthread_join(mThread,NULL); assert(s==0); }
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ double Timeval::seconds() const
|
|||
long Timeval::delta(const Timeval& other) const
|
||||
{
|
||||
// 2^31 milliseconds is just over 4 years.
|
||||
long deltaS = other.sec() - sec();
|
||||
long deltaUs = other.usec() - usec();
|
||||
int32_t deltaS = other.sec() - sec();
|
||||
int32_t deltaUs = other.usec() - usec();
|
||||
return 1000*deltaS + deltaUs/1000;
|
||||
}
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ bool TransactionTable::find(const L3MobileIdentity& mobileID, TransactionEntry&
|
|||
|
||||
// Since clearDeadEntries is also linear, do that here, too.
|
||||
|
||||
// Brtue force search.
|
||||
// Brute force search.
|
||||
bool foundIt = false;
|
||||
mLock.lock();
|
||||
clearDeadEntries();
|
||||
|
@ -385,6 +385,18 @@ size_t TransactionTable::size()
|
|||
}
|
||||
|
||||
|
||||
void TransactionTable::dump(ostream& os) const
|
||||
{
|
||||
mLock.lock();
|
||||
TransactionMap::const_iterator tp = mTable.begin();
|
||||
while (tp != mTable.end()) {
|
||||
os << hex << "0x" << tp->first << " " << dec << tp->second << endl;
|
||||
++tp;
|
||||
}
|
||||
mLock.unlock();
|
||||
}
|
||||
|
||||
|
||||
void Control::clearTransactionHistory( TransactionEntry& transaction )
|
||||
{
|
||||
SIP::SIPEngine& engine = transaction.SIP();
|
||||
|
|
|
@ -589,7 +589,7 @@ class TransactionEntry {
|
|||
/** Reset all Q.931 timers. */
|
||||
void resetTimers();
|
||||
|
||||
/** Retrns true if the transaction is "dead". */
|
||||
/** Returns true if the transaction is "dead". */
|
||||
bool dead() const;
|
||||
|
||||
private:
|
||||
|
@ -669,7 +669,7 @@ class TransactionTable {
|
|||
Also clears dead entries during search.
|
||||
@param mobileID The mobile at to search for.
|
||||
@param target A TransactionEntry to accept the found record.
|
||||
@return true is the mobile ID was foind.
|
||||
@return true is the mobile ID was found.
|
||||
*/
|
||||
bool find(const GSM::L3MobileIdentity& mobileID, TransactionEntry& target);
|
||||
|
||||
|
@ -686,6 +686,9 @@ class TransactionTable {
|
|||
//@}
|
||||
|
||||
size_t size();
|
||||
|
||||
/** Write entries as text to a stream. */
|
||||
void dump(std::ostream&) const;
|
||||
};
|
||||
|
||||
//@} // Transaction Table
|
||||
|
|
|
@ -1,412 +0,0 @@
|
|||
# Makefile.in generated by automake 1.9.4 from Makefile.am.
|
||||
# RRLP/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Copyright 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This software is distributed under the terms of the GNU Affero Public License.
|
||||
# See the COPYING file in the main directory for details.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This software is distributed under the terms of the GNU Affero Public License.
|
||||
# See the COPYING file in the main directory for details.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
srcdir = .
|
||||
top_srcdir = ..
|
||||
|
||||
pkgdatadir = $(datadir)/openbts
|
||||
pkglibdir = $(libdir)/openbts
|
||||
pkgincludedir = $(includedir)/openbts
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = /opt/local/bin/ginstall -c
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = i686-apple-darwin8.11.1
|
||||
host_triplet = i686-apple-darwin8.11.1
|
||||
target_triplet = i686-apple-darwin8.11.1
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/Makefile.common
|
||||
subdir = RRLP
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /Users/dburgess/OpenBTSProject/openbts-SF/public-trunk/missing --run aclocal-1.9
|
||||
AMDEP_FALSE = #
|
||||
AMDEP_TRUE =
|
||||
AMTAR = ${SHELL} /Users/dburgess/OpenBTSProject/openbts-SF/public-trunk/missing --run tar
|
||||
AR = ar
|
||||
AS = as
|
||||
AUTOCONF = ${SHELL} /Users/dburgess/OpenBTSProject/openbts-SF/public-trunk/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /Users/dburgess/OpenBTSProject/openbts-SF/public-trunk/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /Users/dburgess/OpenBTSProject/openbts-SF/public-trunk/missing --run automake-1.9
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCAS = gcc
|
||||
CCASFLAGS = -g -O2
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -g -O2
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CXX = g++
|
||||
CXXCPP = g++ -E
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -g -O2
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DHAVE_CONFIG_H
|
||||
DEPDIR = .deps
|
||||
DLLTOOL = dlltool
|
||||
ECHO = echo
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /usr/bin/grep -E
|
||||
EXEEXT =
|
||||
F77 = gfortran
|
||||
FFLAGS = -g -O2
|
||||
GREP = /usr/bin/grep
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
|
||||
LDFLAGS =
|
||||
LIBOBJS =
|
||||
LIBS = -lreadline
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
LN_S = ln -s
|
||||
LTLIBOBJS =
|
||||
MAKEINFO = ${SHELL} /Users/dburgess/OpenBTSProject/openbts-SF/public-trunk/missing --run makeinfo
|
||||
OBJDUMP = objdump
|
||||
OBJEXT = o
|
||||
ORTP_CFLAGS = -D_REENTRANT -DORTP_INET6 -I/usr/local/include
|
||||
ORTP_LIBS = -L/usr/local/lib -lortp -lpthread
|
||||
OSIP_CFLAGS = -DOSIP_MT -I/usr/local/include
|
||||
OSIP_LIBS = -L/usr/local/lib -losipparser2 -losip2
|
||||
PACKAGE = openbts
|
||||
PACKAGE_BUGREPORT =
|
||||
PACKAGE_NAME = openbts
|
||||
PACKAGE_STRING = openbts 2.6PUBLIC
|
||||
PACKAGE_TARNAME = openbts
|
||||
PACKAGE_VERSION = 2.6PUBLIC
|
||||
PATH_SEPARATOR = :
|
||||
PKG_CONFIG = /sw/bin/pkg-config
|
||||
RANLIB = ranlib
|
||||
RM_PROG = /bin/rm
|
||||
SET_MAKE =
|
||||
SHELL = /bin/sh
|
||||
STRIP = strip
|
||||
USRP_CFLAGS = -DOMNITHREAD_POSIX=1 -I/usr/local/include/gnuradio -I/sw/include -I/usr/local/include
|
||||
USRP_LIBS = -L/usr/local/lib -L/sw/lib -lusrp -lusb -lgromnithread
|
||||
VERSION = 2.6PUBLIC
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = g++
|
||||
ac_ct_F77 = gfortran
|
||||
am__fastdepCC_FALSE = #
|
||||
am__fastdepCC_TRUE =
|
||||
am__fastdepCXX_FALSE = #
|
||||
am__fastdepCXX_TRUE =
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = ${AMTAR} chof - "$$tardir"
|
||||
am__untar = ${AMTAR} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build = i686-apple-darwin8.11.1
|
||||
build_alias =
|
||||
build_cpu = i686
|
||||
build_os = darwin8.11.1
|
||||
build_vendor = apple
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host = i686-apple-darwin8.11.1
|
||||
host_alias =
|
||||
host_cpu = i686
|
||||
host_os = darwin8.11.1
|
||||
host_vendor = apple
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = /Users/dburgess/OpenBTSProject/openbts-SF/public-trunk/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = $(install_sh) -d
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
sysconfdir = ${prefix}/etc
|
||||
target = i686-apple-darwin8.11.1
|
||||
target_alias =
|
||||
target_cpu = i686
|
||||
target_os = darwin8.11.1
|
||||
target_vendor = apple
|
||||
COMMON_INCLUDEDIR = $(top_srcdir)/CommonLibs
|
||||
CONTROL_INCLUDEDIR = $(top_srcdir)/Control
|
||||
GSM_INCLUDEDIR = $(top_srcdir)/GSM
|
||||
SIP_INCLUDEDIR = $(top_srcdir)/SIP
|
||||
SMS_INCLUDEDIR = $(top_srcdir)/SMS
|
||||
TRX_INCLUDEDIR = $(top_srcdir)/TRXManager
|
||||
GLOBALS_INCLUDEDIR = $(top_srcdir)/Globals
|
||||
CLI_INCLUDEDIR = $(top_srcdir)/CLI
|
||||
#SQL_INCLUDEDIR = $(top_srcdir)/SQL
|
||||
HLR_INCLUDEDIR = $(top_srcdir)/HLR
|
||||
STD_DEFINES_AND_INCLUDES = \
|
||||
-I$(COMMON_INCLUDEDIR) \
|
||||
-I$(CONTROL_INCLUDEDIR) \
|
||||
-I$(GSM_INCLUDEDIR) \
|
||||
-I$(SIP_INCLUDEDIR) \
|
||||
-I$(SMS_INCLUDEDIR) \
|
||||
-I$(TRX_INCLUDEDIR) \
|
||||
-I$(GLOBALS_INCLUDEDIR) \
|
||||
-I$(CLI_INCLUDEDIR) \
|
||||
-I$(HLR_INCLUDEDIR)
|
||||
|
||||
# -I$(SQL_INCLUDEDIR)
|
||||
COMMON_LA = $(top_builddir)/CommonLibs/libcommon.la
|
||||
GSM_LA = $(top_builddir)/GSM/libGSM.la
|
||||
SIP_LA = $(top_builddir)/SIP/libSIP.la
|
||||
SMS_LA = $(top_builddir)/SMS/libSMS.la
|
||||
TRX_LA = $(top_builddir)/TRXManager/libtrxmanager.la
|
||||
CONTROL_LA = $(top_builddir)/Control/libcontrol.la
|
||||
GLOBALS_LA = $(top_builddir)/Globals/libglobals.la
|
||||
CLI_LA = $(top_builddir)/CLI/libcli.la
|
||||
HLR_LA = $(top_builddir)/HLR/libHLR.la
|
||||
#SQL_LA = $(top_builddir)/SQL/libSQL.la
|
||||
MOSTLYCLEANFILES = *~
|
||||
EXTRA_DIST = \
|
||||
RRLPMessages.cpp \
|
||||
RRLPTest.cpp \
|
||||
RRLPMessages.h
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.common $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu RRLP/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu RRLP/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(mkdir_p) $(distdir)/..
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -300,12 +300,12 @@ bool SIPInterface::checkInvite( osip_message_t * msg )
|
|||
// IMSIs are 14 or 15 char + "IMSI" prefix
|
||||
unsigned namelen = strlen(IMSI);
|
||||
if ((namelen>19)||(namelen<18)) {
|
||||
LOG(WARN) << "INVITE with malformed username \"" << IMSI << "\"";
|
||||
LOG(WARN) << "INVITE/MESSAGE with malformed username \"" << IMSI << "\"";
|
||||
return false;
|
||||
}
|
||||
// Skip first 4 char "IMSI".
|
||||
IMSI+=4;
|
||||
// Make the mobile id we need for transaction and paging enties.
|
||||
// Make the mobile id we need for transaction and paging entries.
|
||||
L3MobileIdentity mobile_id(IMSI);
|
||||
|
||||
// Check SIP map. Repeated entry? Page again.
|
||||
|
@ -343,7 +343,7 @@ bool SIPInterface::checkInvite( osip_message_t * msg )
|
|||
if (!callerID) {
|
||||
callerID = emptyString;
|
||||
callerHost = emptyString;
|
||||
LOG(NOTICE) << "INVITE with no From: username for " << mobile_id;
|
||||
LOG(NOTICE) << "INVITE/MESSAGE with no From: username for " << mobile_id;
|
||||
}
|
||||
LOG(DEBUG) << "callerID " << callerID << "@" << callerHost;
|
||||
// Build the transaction table entry.
|
||||
|
|
|
@ -420,8 +420,9 @@ SMnet::string_addr (struct sockaddr *sa, socklen_t len, bool withport)
|
|||
bool
|
||||
SMnet::parse_addr (const char *str, char *sockad, socklen_t maxlen, socklen_t *len)
|
||||
{
|
||||
char *p = strchr(str, ':');
|
||||
char *host, *port;
|
||||
const char *p = strchr(str, ':');
|
||||
char *host;
|
||||
const char *port;
|
||||
|
||||
if (p == NULL)
|
||||
return false;
|
||||
|
|
Reference in New Issue