Merge branch 'master' into PentHerz

This commit is contained in:
trxstudio 2023-04-04 13:22:59 +01:00 committed by GitHub
commit 446ee27b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 120 additions and 71 deletions

5
.gitignore vendored
View File

@ -1,3 +1,4 @@
*~
._*
*.a
*.o
@ -17,11 +18,13 @@ apps/fpga.rbf
apps/transceiver
build-arch-stamp
build-indep-stamp
compile
config/libtool.m4
config/ltoptions.m4
config/ltsugar.m4
config/ltversion.m4
config/lt~obsolete.m4
config/test_ortp_version
config.guess
config.h
config.log
@ -46,3 +49,5 @@ TransceiverRAD1/transceiver
apps/OpenBTS-UMTS
apps/OpenBTS-UMTSCLI
apps/OpenBTS-UMTSDo
vlm-asn1c-0959ffb/
README

2
.gitmodules vendored
View File

@ -1,4 +1,4 @@
[submodule "NodeManager"]
path = NodeManager
url = https://github.com/RangeNetworks/NodeManager.git
url = https://github.com/FlUxIuS/NodeManager
branch = master

View File

@ -4916,7 +4916,4 @@ check: ${TARGET}
@echo ================
distclean: clean
rm -f $(ASN_MODULE_SOURCES)
rm -f $(ASN_MODULE_HEADERS)
rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS)
rm -f Makefile.am.sample

View File

@ -3,7 +3,7 @@
* traditionally complex, proprietary hardware systems.
*
* Copyright 2011-2014 Range Networks, Inc.
*
* Patched by FlUxIuS @ Penthertz SAS
* This software is distributed under the terms of the GNU Affero General
* Public License version 3. See the COPYING and NOTICE files in the main
* directory for licensing information.
@ -31,6 +31,18 @@
Basetype* operator&() { return &value; } \
#define _INITIALIZED_SCALAR_FUNCSBOOL(Classname,Basetype,Init) \
Classname() : value(Init) {} \
Classname(Basetype wvalue) { value = wvalue; } /* Can set from basetype. */ \
operator Basetype(void) const { return value; } /* Converts from basetype. */ \
Basetype operator++() { return true; } \
Basetype operator++(int) { return true; } \
Basetype operator=(Basetype wvalue) { return value = wvalue; } \
Basetype operator+=(Basetype wvalue) { return value = value + wvalue; } \
Basetype operator-=(Basetype wvalue) { return value = value - wvalue; } \
Basetype* operator&() { return &value; } \
#define _DECLARE_SCALAR_TYPE(Classname_i,Classname_z,Basetype) \
template <Basetype Init> \
struct Classname_i { \
@ -39,6 +51,14 @@
}; \
typedef Classname_i<0> Classname_z;
#define _DECLARE_SCALAR_TYPEBOOL(Classname_i,Classname_z,Basetype) \
template <Basetype Init> \
struct Classname_i { \
Basetype value; \
_INITIALIZED_SCALAR_FUNCSBOOL(Classname_i,Basetype,Init) \
}; \
typedef Classname_i<0> Classname_z;
// Usage:
// Where 'classname' is one of the types listed below, then:
@ -55,7 +75,7 @@ _DECLARE_SCALAR_TYPE(UInt8_i, UInt8_z, uint8_t)
_DECLARE_SCALAR_TYPE(UInt16_i, UInt16_z, uint16_t)
_DECLARE_SCALAR_TYPE(UInt32_i, UInt32_z, uint32_t)
_DECLARE_SCALAR_TYPE(Size_t_i, Size_t_z, size_t)
_DECLARE_SCALAR_TYPE(Bool_i, Bool_z, bool)
_DECLARE_SCALAR_TYPEBOOL(Bool_i, Bool_z, bool)
// float is special, because C++ does not permit the template initalization:
struct Float_z {

View File

@ -32,7 +32,8 @@ const char *gOpenWelcome =
"OpenBTS, OpenBTS-UMTS\n"
"Copyright 2008, 2009, 2010 Free Software Foundation, Inc.\n"
"Copyright 2010 Kestrel Signal Processing, Inc.\n"
"Copyright 2011-2021 Range Networks, Inc.\n"
"Copyright 2011, 2012, 2013, 2014 Range Networks, Inc.\n"
"Reloaded for 2023 by FlUxIuS @ Penthertz SAS.\n"
"Release " VERSION " " PROD_CAT " formal build date " TIMESTAMP_ISO " " REPO_REV "\n"
"\"OpenBTS\" is a trademark of Range Networks, Inc.\n"
"\"OpenBTS-UMTS\" is a trademark of Range Networks, Inc.\n"

@ -1 +1 @@
Subproject commit 45420fe5f81a18e029f56f6cca24f2b6eeeba0cd
Subproject commit 720d812f285e01e68ad18a49036b30ae132208cc

View File

@ -1,5 +1,26 @@
Welcome to the OpenBTS-UMTS source code
========================================
# OpenBTS-UMTS reloaded 2023
OpenBTS-UMTS reloaded for 2023. This fork extends changes from @EurecatSecurity make it compatiblee with latest UHD drivers, several fixes to work on Ubuntu 22.04.
## Compatible devices
* USRP
* B200/B210/B205-mini*
* X300/X310
* N200/N210
* USRP2
* LimeSDR (experimental)
## Documentation
Refer to this wiki page for the new documentation: https://github.com/PentHertz/OpenBTS-UMTS/wiki
## Docker images
We are also providing a Docker images, so you will not to follow the installation instructions and run it straightfoward even if system dependencies are broken in the future (in theory!).
Checkout the images there: https://hub.docker.com/r/penthertz/openbts-umts
## Original notes from Range Networks (obsolete):
For information on supported hardware, and build, install, setup and run instructions see [the wiki page](http://openbts.org/w/index.php/OpenBTS-UMTS).

View File

@ -124,7 +124,7 @@ void SgsnInfo::sirm()
{
std::ostringstream ss;
sgsnInfoDump(this,ss);
SGSNLOG("Removing SgsnInfo:"<<ss);
SGSNLOG(string("Removing SgsnInfo: ") + ss.str());
sSgsnInfoList.remove(this);
delete this;
}
@ -221,7 +221,7 @@ static void GmmRemove(GmmInfo *gmm)
{
std::ostringstream ss;
gmmInfoDump(gmm,ss,0);
SGSNLOG("Removing gmm:"<<ss);
SGSNLOG(string("Removing gmm: ") + ss.str());
SgsnInfo *si;
RN_FOR_ALL(SgsnInfoList_t,sSgsnInfoList,si) {
// The second test here should be redundant.

View File

@ -754,7 +754,7 @@ void SIPEngine::InitRTP(const osip_message_t * msg )
#ifdef ORTP_NEW_API
rtp_session_set_local_addr(mSession, "0.0.0.0", mRTPPort, -1);
#else
rtp_session_set_local_addr(mSession, "0.0.0.0", mRTPPort);
rtp_session_set_local_addr(mSession, "0.0.0.0", mRTPPort, mRTPPort+1);
#endif
rtp_session_set_remote_addr(mSession, d_ip_addr, atoi(d_port));

View File

@ -287,7 +287,7 @@ const char* extractIMSI(const osip_message_t *msg)
unsigned namelen = strlen(IMSI);
if ((namelen>19)||(namelen<18)) {
LOG(WARNING) << "INVITE with malformed username \"" << IMSI << "\"";
return false;
return nullptr;
}
// Skip first 4 char "IMSI".
return IMSI+4;

View File

@ -75,7 +75,7 @@ RPData *SMS::hex2rpdata(const char *hexstring)
BitVector RPDUbits(strlen(hexstring)*4);
if (!RPDUbits.unhex(hexstring)) {
return false;
return nullptr;
}
LOG(DEBUG) << "SMS RPDU bits: " << RPDUbits;

View File

@ -4,6 +4,7 @@
*
* Copyright 2010-2011 Free Software Foundation, Inc.
* Copyright 2014 Ettus Research LLC
* Patched by FlUxIuS @ Penthertz SAS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -26,8 +27,7 @@
#include <uhd/version.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/msg.hpp>
#include <uhd/utils/thread.hpp>
#include "Threads.h"
#include "Logger.h"
@ -86,11 +86,12 @@ static struct uhd_dev_offset uhd_offsets[NUM_USRP_TYPES] = {
{ B2XX, 99 },
{ X300, 73 },
{ UMTRX, 0 },
{ LimeSDRUSB, 50 }, // picked from http://swigerco.com/UHDDevice.cpp.diff
};
static int get_dev_offset(enum uhd_dev_type type)
{
if ((type != B2XX) && (type != USRP2) && (type != X300)) {
if ((type != B2XX) && (type != USRP2) && (type != X300) && (type != LimeSDRUSB)) {
LOG(ALERT) << "Unsupported device type";
return 0;
}
@ -113,28 +114,6 @@ static void *async_event_loop(UHDDevice *dev)
return NULL;
}
/*
* Catch and drop underrun 'U' and overrun 'O' messages from stdout
* since we already report using the logging facility. Direct
* everything else appropriately.
*/
void uhd_msg_handler(uhd::msg::type_t type, const std::string &msg)
{
switch (type) {
case uhd::msg::status:
LOG(INFO) << msg;
break;
case uhd::msg::warning:
LOG(WARNING) << msg;
break;
case uhd::msg::error:
LOG(ERR) << msg;
break;
case uhd::msg::fastpath:
break;
}
}
static void thread_enable_cancel(bool cancel)
{
cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) :
@ -261,33 +240,41 @@ double UHDDevice::setRxGain(double db)
*/
bool UHDDevice::parse_dev_type()
{
std::string mboard_str, dev_str;
uhd::property_tree::sptr prop_tree;
size_t usrp2_str, b200_str, b210_str, x300_str, x310_str;
prop_tree = usrp_dev->get_device()->get_tree();
dev_str = prop_tree->access<std::string>("/name").get();
mboard_str = usrp_dev->get_mboard_name();
std::string mboard_str, dev_str;
uhd::property_tree::sptr prop_tree;
size_t usrp2_str, b200_str, b210_str, x300_str, x310_str, b205mini_str, LimeSDRUSB_str;
usrp2_str = dev_str.find("USRP2");
b200_str = mboard_str.find("B205mini");
b210_str = mboard_str.find("B210");
x300_str = mboard_str.find("X300");
x310_str = mboard_str.find("X310");
prop_tree = usrp_dev->get_device()->get_tree();
dev_str = prop_tree->access<std::string>("/name").get();
mboard_str = usrp_dev->get_mboard_name();
usrp2_str = dev_str.find("USRP2");
b200_str = mboard_str.find("B200");
b205mini_str = mboard_str.find("B205mini");
b210_str = mboard_str.find("B210");
x300_str = mboard_str.find("X300");
x310_str = mboard_str.find("X310");
LimeSDRUSB_str = mboard_str.find("LimeSDR");
if (b200_str != std::string::npos) {
dev_type = B2XX;
} else if (b205mini_str != std::string::npos) {
dev_type = B2XX;
} else if (b210_str != std::string::npos) {
dev_type = B2XX;
} else if (usrp2_str != std::string::npos) {
dev_type = USRP2;
} else if (x300_str != std::string::npos) {
dev_type = X300;
} else if (x310_str != std::string::npos) {
dev_type = X300;
} else if (LimeSDRUSB_str != std::string::npos) {
dev_type = LimeSDRUSB;
} else {
goto nosupport;
}
if (b200_str != std::string::npos) {
dev_type = B2XX;
} else if (b210_str != std::string::npos) {
dev_type = B2XX;
} else if (usrp2_str != std::string::npos) {
dev_type = USRP2;
} else if (x300_str != std::string::npos) {
dev_type = X300;
} else if (x310_str != std::string::npos) {
dev_type = X300;
} else {
goto nosupport;
}
tx_window = TX_WINDOW_FIXED;
LOG(INFO) << "Using fixed transmit window for "
@ -414,9 +401,6 @@ bool UHDDevice::start()
setPriority();
/* Register msg handler */
uhd::msg::register_handler(&uhd_msg_handler);
/* Start receive streaming */
if (!restart())
return false;

View File

@ -14,6 +14,7 @@ enum uhd_dev_type {
B2XX,
X300,
UMTRX,
LimeSDRUSB, // picked from http://swigerco.com/UHDDevice.h.diff
NUM_USRP_TYPES,
};

View File

@ -1027,7 +1027,10 @@ void BeaconConfig::regenerate()
uint32_t *cellID = RN_CALLOC(uint32_t);
// (pat) TODO: Is this right? network order is high byte first.
// Luckily, hardly matters.
*cellID = htonl(gConfig.getNum("UMTS.Identity.CI"));
*cellID = gConfig.getNum("UMTS.Identity.CI");
// UMTS protocol specifies that the cell ID is a 28 bit number, but it is casted into a 32 bit value. The 4 LSB bits are considered padding, so the "real" data must be shifted about this padding.
*cellID = *cellID << 4;
*cellID = htonl(*cellID);
// cellID is a 28-bit BIT_STRING
setAsnBIT_STRING(&mSIB3.cellIdentity,(uint8_t*)cellID,28);
// ASN CellSelectReselectInfoSIB_3_4 cellSelectReselectInfo, 10.3.2.3

View File

@ -178,7 +178,7 @@ public:
friend void *RACHLoopAdapter(RadioModem*);
friend void *DCHLoopAdapter(DCHLoopInfo*);
static const float mRACHThreshold = 10.0;
static constexpr float mRACHThreshold = 10.0;
private:

View File

@ -15,7 +15,7 @@ dnl See the LEGAL file in the main directory for details.
dnl FIXME -- Need to add dependency check for asn1c.
AC_PREREQ(2.57)
AC_INIT(openbts-umts,1.0-master)
AC_INIT(openbts-umts,1.1-master)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST

17
install_dependences.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# This script has been tested in Ubuntu 16.04 and 18.04. Please report any problem you find.
# Install all package dependencies
sudo apt install autoconf libtool build-essential libuhd-dev uhd-host libzmq3-dev libosip2-dev libortp-dev libusb-1.0-0-dev asn1c libtool-bin libsqlite3-dev libreadline-dev
# Clone submodules from base repo
git submodule init
git submodule update
# Uncompress, configure, compile and install bundled version of ASN1 compiler, necessary in build-time
tar -xvzf asn1c-0.9.23.tar.gz
cd ./vlm-asn1c-0959ffb/
./configure
make
sudo make install
cd ../
# TODO: possibly more dependencies to be added here. Please suggest any requirement package you detect as missing.