Compare commits
27 Commits
Author | SHA1 | Date |
---|---|---|
Oliver Smith | 1db9b60023 | |
Oliver Smith | d15ef114cc | |
Max | 460b553971 | |
Pau Espin | a9b33a40af | |
Pau Espin | b04885005b | |
Pau Espin | ab8db8fabd | |
Pau Espin | d3cd9e7afa | |
Pau Espin | 8ff216bf02 | |
Pau Espin | 9f2a584fb6 | |
Andreas Eversberg | 4bc90a6be7 | |
Harald Welte | fed4bf196a | |
Vadim Yanitskiy | b303e296b7 | |
Vadim Yanitskiy | 11b379d95a | |
Vadim Yanitskiy | be5af799c3 | |
Pau Espin | 4f7362272f | |
Pau Espin | 69682c8deb | |
Oliver Smith | 4d94531f6f | |
Vadim Yanitskiy | b4a5d3d9a8 | |
Oliver Smith | eee4534364 | |
Vadim Yanitskiy | a2aa6b19b2 | |
Vadim Yanitskiy | 54899f76b0 | |
Vadim Yanitskiy | 9b356e1c5c | |
arehbein | ad5981352b | |
Pau Espin | 69f91b1773 | |
Oliver Smith | 1bad165c69 | |
Max | 9c2c2654ba | |
Vadim Yanitskiy | f74f944784 |
|
@ -19,7 +19,6 @@ SUBDIRS = \
|
|||
BUILT_SOURCES = $(top_srcdir)/.version
|
||||
EXTRA_DIST = \
|
||||
.version \
|
||||
contrib/osmo-hnodeb.spec.in \
|
||||
debian \
|
||||
git-version-gen \
|
||||
osmoappdesc.py \
|
||||
|
|
|
@ -7,3 +7,5 @@
|
|||
# If any interfaces have been added since the last public release: c:r:a + 1.
|
||||
# If any interfaces have been removed or changed since the last public release: c:r:0.
|
||||
#library what description / commit summary line
|
||||
libosmocore depend >= 1.9.0 we need osmo_sockaddr_from_str_and_uint()
|
||||
libosmo-netif depend > 1.4.0 osmo_prim_srv{_link}_set_name()
|
25
configure.ac
25
configure.ac
|
@ -37,8 +37,6 @@ fi
|
|||
PKG_PROG_PKG_CONFIG([0.20])
|
||||
|
||||
dnl checks for libraries
|
||||
AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
|
||||
AC_SUBST(LIBRARY_DL)
|
||||
old_LIBS=$LIBS
|
||||
AC_SEARCH_LIBS([sctp_recvmsg], [sctp], [
|
||||
AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
|
||||
|
@ -51,17 +49,17 @@ AC_SEARCH_LIBS([sctp_recvmsg], [sctp], [
|
|||
LIBS=$old_LIBS
|
||||
|
||||
PKG_CHECK_MODULES(LIBASN1C, libasn1c >= 0.9.30)
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.7.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.7.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.7.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.7.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.2.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.6.0)
|
||||
PKG_CHECK_MODULES(LIBOSMORUA, libosmo-rua >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOHNBAP, libosmo-hnbap >= 1.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.9.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.9.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.5.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 1.5.0)
|
||||
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.4.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.8.0)
|
||||
PKG_CHECK_MODULES(LIBOSMORUA, libosmo-rua >= 1.5.0)
|
||||
PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 1.5.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOHNBAP, libosmo-hnbap >= 1.5.0)
|
||||
|
||||
|
||||
dnl checks for header files
|
||||
|
@ -228,5 +226,4 @@ AC_OUTPUT(
|
|||
doc/manuals/Makefile
|
||||
contrib/Makefile
|
||||
contrib/systemd/Makefile
|
||||
contrib/osmo-hnodeb.spec
|
||||
Makefile)
|
||||
|
|
|
@ -52,7 +52,7 @@ set -x
|
|||
|
||||
cd "$base"
|
||||
autoreconf --install --force
|
||||
./configure --enable-sanitize --enable-external-tests $CONFIG
|
||||
./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG
|
||||
$MAKE $PARALLEL_MAKE
|
||||
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|
||||
|| cat-testlogs.sh
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
#
|
||||
# spec file for package osmo-hnodeb
|
||||
#
|
||||
# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
## Disable LTO for now since it breaks compilation of the tests
|
||||
## https://osmocom.org/issues/4113
|
||||
%define _lto_cflags %{nil}
|
||||
|
||||
Name: osmo-hnodeb
|
||||
Version: @VERSION@
|
||||
Release: 0
|
||||
Summary: Osmohnodeb: Osmocom's Base Station Controller for 2G CS mobile networks
|
||||
License: AGPL-3.0-or-later AND GPL-2.0-or-later
|
||||
Group: Hardware/Mobile
|
||||
URL: https://osmocom.org/projects/osmohnodeb
|
||||
Source: %{name}-%{version}.tar.xz
|
||||
BuildRequires: autoconf-archive
|
||||
BuildRequires: automake >= 1.9
|
||||
BuildRequires: libtool >= 2
|
||||
BuildRequires: lksctp-tools-devel
|
||||
BuildRequires: pkgconfig >= 0.20
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: systemd-rpm-macros
|
||||
%endif
|
||||
BuildRequires: pkgconfig(libcrypto) >= 0.9.5
|
||||
BuildRequires: pkgconfig(libosmo-netif) >= 1.2.0
|
||||
BuildRequires: pkgconfig(libosmo-sigtran) >= 1.6.0
|
||||
BuildRequires: pkgconfig(libosmoabis) >= 1.3.0
|
||||
BuildRequires: pkgconfig(libosmotrau) >= 1.3.0
|
||||
BuildRequires: pkgconfig(libosmocore) >= 1.7.0
|
||||
BuildRequires: pkgconfig(libosmoctrl) >= 1.7.0
|
||||
BuildRequires: pkgconfig(libosmogb) >= 1.7.0
|
||||
BuildRequires: pkgconfig(libosmogsm) >= 1.7.0
|
||||
BuildRequires: pkgconfig(libosmovty) >= 1.7.0
|
||||
BuildRequires: pkgconfig(libosmo-hnbap) >= 1.3.0
|
||||
BuildRequires: pkgconfig(libosmo-ranap) >= 1.3.0
|
||||
BuildRequires: pkgconfig(libosmo-rua) >= 1.3.0
|
||||
BuildRequires: pkgconfig(talloc)
|
||||
BuildRequires: pkgconfig(libasn1c) >= 0.9.30
|
||||
%{?systemd_requires}
|
||||
|
||||
%description
|
||||
OsmoHNodeB: Osmocom's Home NodeB for 3G mobile networks.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
echo "%{version}" >.tarball-version
|
||||
autoreconf -fi
|
||||
%configure \
|
||||
--docdir=%{_docdir}/%{name} \
|
||||
--with-systemdsystemunitdir=%{_unitdir}
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%make_install
|
||||
|
||||
%if 0%{?suse_version}
|
||||
%preun
|
||||
%service_del_preun %{name}.service
|
||||
|
||||
%postun
|
||||
%service_del_postun %{name}.service
|
||||
|
||||
%pre
|
||||
%service_add_pre %{name}.service
|
||||
|
||||
%post
|
||||
%service_add_post %{name}.service
|
||||
%endif
|
||||
|
||||
%check
|
||||
make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
|
||||
|
||||
%files
|
||||
%license COPYING
|
||||
%doc AUTHORS README.md
|
||||
%{_bindir}/osmo-hnodeb
|
||||
%dir %{_docdir}/%{name}/examples
|
||||
%dir %{_docdir}/%{name}/examples/osmo-hnodeb
|
||||
%{_docdir}/%{name}/examples/osmo-hnodeb/osmo-hnodeb.cfg
|
||||
%dir %{_sysconfdir}/osmocom
|
||||
%config(noreplace) %{_sysconfdir}/osmocom/osmo-hnodeb.cfg
|
||||
%{_unitdir}/%{name}.service
|
||||
|
||||
%changelog
|
|
@ -1,9 +1,15 @@
|
|||
[Unit]
|
||||
Description=Osmocom Home NodeB (hNodeB)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
StateDirectory=osmocom
|
||||
WorkingDirectory=%S/osmocom
|
||||
Restart=always
|
||||
User=osmocom
|
||||
Group=osmocom
|
||||
ExecStart=/usr/bin/osmo-hnodeb -c /etc/osmocom/osmo-hnodeb.cfg
|
||||
RestartSec=2
|
||||
|
||||
|
|
|
@ -1,3 +1,36 @@
|
|||
osmo-hnodeb (0.1.2) unstable; urgency=medium
|
||||
|
||||
[ arehbein ]
|
||||
* Transition to use of 'telnet_init_default'
|
||||
|
||||
[ Vadim Yanitskiy ]
|
||||
* build: remove $(COVERAGE_LDFLAGS) from osmo_hnodeb_LDADD
|
||||
* tests: make 'vty-test' target depend on the respective binary
|
||||
* tests: do not depend on undefined $(BUILT_SOURCES)
|
||||
* copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
|
||||
|
||||
[ Oliver Smith ]
|
||||
* debian: set compat level to 10
|
||||
* systemd: depend on networking-online.target
|
||||
|
||||
[ Pau Espin Pedrol ]
|
||||
* rua: Fix null ptr access in hnb->llsk.srv
|
||||
|
||||
-- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 12 Sep 2023 17:22:10 +0200
|
||||
|
||||
osmo-hnodeb (0.1.1) unstable; urgency=medium
|
||||
|
||||
[ Vadim Yanitskiy ]
|
||||
* configure.ac: do not require unused dlopen
|
||||
|
||||
[ Max ]
|
||||
* Set working directory in systemd service file
|
||||
|
||||
[ Oliver Smith ]
|
||||
* contrib/jenkins.sh: use --enable-werror
|
||||
|
||||
-- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 07 Feb 2023 18:03:48 +0100
|
||||
|
||||
osmo-hnodeb (0.1.0) unstable; urgency=medium
|
||||
|
||||
[ Pau Espin Pedrol ]
|
||||
|
|
|
@ -1 +1 @@
|
|||
9
|
||||
10
|
||||
|
|
|
@ -2,7 +2,7 @@ Source: osmo-hnodeb
|
|||
Section: net
|
||||
Priority: extra
|
||||
Maintainer: Osmocom team <openbsc@lists.osmocom.org>
|
||||
Build-Depends: debhelper (>=9),
|
||||
Build-Depends: debhelper (>= 10),
|
||||
dh-autoreconf,
|
||||
autotools-dev,
|
||||
autoconf,
|
||||
|
@ -14,14 +14,14 @@ Build-Depends: debhelper (>=9),
|
|||
libtalloc-dev,
|
||||
libasn1c-dev (>= 0.9.30),
|
||||
libsctp-dev,
|
||||
libosmocore-dev (>= 1.7.0),
|
||||
libosmo-sigtran-dev (>= 1.6.0),
|
||||
libosmo-abis-dev (>= 1.3.0),
|
||||
libosmo-netif-dev (>= 1.2.0),
|
||||
libosmo-hnbap-dev (>= 1.3.0),
|
||||
libosmo-ranap-dev (>= 1.3.0),
|
||||
libosmo-rua-dev (>= 1.3.0),
|
||||
osmo-gsm-manuals-dev (>= 1.3.0)
|
||||
libosmocore-dev (>= 1.9.0),
|
||||
libosmo-sigtran-dev (>= 1.8.0),
|
||||
libosmo-abis-dev (>= 1.5.0),
|
||||
libosmo-netif-dev (>= 1.4.0),
|
||||
libosmo-hnbap-dev (>= 1.5.0),
|
||||
libosmo-ranap-dev (>= 1.5.0),
|
||||
libosmo-rua-dev (>= 1.5.0),
|
||||
osmo-gsm-manuals-dev (>= 1.5.0)
|
||||
Standards-Version: 3.9.8
|
||||
Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-hnodeb
|
||||
Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-hnodeb
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh -e
|
||||
case "$1" in
|
||||
configure)
|
||||
# Create the osmocom group and user (if it doesn't exist yet)
|
||||
if ! getent group osmocom >/dev/null; then
|
||||
groupadd --system osmocom
|
||||
fi
|
||||
if ! getent passwd osmocom >/dev/null; then
|
||||
useradd \
|
||||
--system \
|
||||
--gid osmocom \
|
||||
--home-dir /var/lib/osmocom \
|
||||
--shell /sbin/nologin \
|
||||
--comment "Open Source Mobile Communications" \
|
||||
osmocom
|
||||
fi
|
||||
|
||||
# Fix permissions of previous (root-owned) install (OS#4107)
|
||||
chown osmocom:osmocom /etc/osmocom/osmo-hnodeb.cfg
|
||||
chmod 0660 /etc/osmocom/osmo-hnodeb.cfg
|
||||
chown root:osmocom /etc/osmocom
|
||||
chmod 2775 /etc/osmocom
|
||||
mkdir -p /var/lib/osmocom
|
||||
chown -R osmocom:osmocom /var/lib/osmocom
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb(1) will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
#DEBHELPER#
|
|
@ -1,9 +1,11 @@
|
|||
log stderr
|
||||
logging filter all 1
|
||||
logging color 1
|
||||
logging print category 1
|
||||
logging print category-hex 0
|
||||
logging timestamp 1
|
||||
logging print category 1
|
||||
logging timestamp 0
|
||||
logging print file basename last
|
||||
logging print level 1
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* hNodeB shutdown FSM */
|
||||
|
||||
/* (C) 2021 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
|
||||
/* (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
|
||||
* Author: Pau Espin Pedrol <pespin@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
|
@ -28,6 +28,7 @@
|
|||
|
||||
enum hnb_shutdown_fsm_states {
|
||||
HNB_SHUTDOWN_ST_NONE,
|
||||
HNB_SHUTDOWN_ST_IN_PROGRESS,
|
||||
HNB_SHUTDOWN_ST_EXIT,
|
||||
};
|
||||
|
||||
|
|
|
@ -30,8 +30,11 @@ struct hnb;
|
|||
struct rtp_conn;
|
||||
|
||||
int hnb_llsk_alloc(struct hnb *hnb);
|
||||
void hnb_llsk_free(struct hnb *hnb);
|
||||
int hnb_llsk_start_listen(struct hnb *hnb);
|
||||
bool hnb_llsk_connected(const struct hnb *hnb);
|
||||
bool hnb_llsk_can_be_configured(struct hnb *hnb);
|
||||
void hnb_llsk_close_conn(const struct hnb *hnb);
|
||||
|
||||
int ll_addr_type2af(enum u_addr_type t);
|
||||
int ll_addr2osa(enum u_addr_type t, const union u_addr *uaddr, uint16_t port, struct osmo_sockaddr *osa);
|
||||
|
|
|
@ -40,5 +40,6 @@ struct rtp_conn {
|
|||
struct rtp_conn *rtp_conn_alloc(struct hnb_ue *ue);
|
||||
void rtp_conn_free(struct rtp_conn *conn);
|
||||
|
||||
int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr, const struct hnb_audio_conn_establish_req_param *ce_req);
|
||||
int rtp_conn_setup(struct rtp_conn *conn, const char *local_ipstr, const struct osmo_sockaddr *rem_addr,
|
||||
const struct hnb_audio_conn_establish_req_param *ce_req);
|
||||
int rtp_conn_tx_data(struct rtp_conn *conn, uint8_t frame_nr, uint8_t fqc, uint8_t rfci, const uint8_t *data, unsigned int data_len);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# (C) 2021 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
|
||||
# (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
|
||||
# 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -54,7 +54,6 @@ osmo_hnodeb_LDADD = \
|
|||
$(LIBOSMOVTY_LIBS) \
|
||||
$(LIBOSMOCTRL_LIBS) \
|
||||
$(LIBOSMONETIF_LIBS) \
|
||||
$(COVERAGE_LDFLAGS) \
|
||||
$(LIBOSMOABIS_LIBS) \
|
||||
$(LIBOSMOTRAU_LIBS) \
|
||||
$(LIBOSMOSIGTRAN_LIBS) \
|
||||
|
|
|
@ -88,9 +88,7 @@ void hnb_free(struct hnb *hnb)
|
|||
}
|
||||
hnb_iuh_free(hnb);
|
||||
|
||||
osmo_timer_del(&hnb->llsk.defer_configure_ind_timer);
|
||||
osmo_prim_srv_link_free(hnb->llsk.link);
|
||||
hnb->llsk.link = NULL;
|
||||
hnb_llsk_free(hnb);
|
||||
|
||||
hnb_gtp_unbind(hnb);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* hNodeB shutdown FSM */
|
||||
|
||||
/* (C) 2021 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
|
||||
/* (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
|
||||
* Author: Pau Espin Pedrol <pespin@sysmocom.de>
|
||||
*
|
||||
* All Rights Reserved
|
||||
|
@ -44,21 +44,35 @@ static void st_none_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
|
|||
|
||||
static void st_none(struct osmo_fsm_inst *fi, uint32_t event, void *data)
|
||||
{
|
||||
struct hnb *hnb = (struct hnb *)fi->priv;
|
||||
switch (event) {
|
||||
case HNB_SHUTDOWN_EV_START:
|
||||
/* TODO: here we may want to communicate t lower layers over UDsocket that we are shutting down...
|
||||
* TODO: Also, if Iuh link is still up, maybe send a Hnb deregister req towards HNBGW
|
||||
* TODO: also signal the hnb object somehow that we are starting to shut down?
|
||||
*/
|
||||
if (osmo_stream_cli_is_connected(hnb->iuh.client))
|
||||
osmo_stream_cli_close(hnb->iuh.client);
|
||||
|
||||
hnb_shutdown_fsm_state_chg(fi, HNB_SHUTDOWN_ST_EXIT);
|
||||
hnb_shutdown_fsm_state_chg(fi, HNB_SHUTDOWN_ST_IN_PROGRESS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void st_in_progress_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
|
||||
{
|
||||
struct hnb *hnb = (struct hnb *)fi->priv;
|
||||
struct hnb_ue *ue, *ue_tmp;
|
||||
|
||||
/* TODO: Also, if Iuh link is still up, maybe send a Hnb deregister req towards HNBGW */
|
||||
|
||||
/* Drop active UE contexts, together with their GTP/AUDIO sessions: */
|
||||
llist_for_each_entry_safe(ue, ue_tmp, &hnb->ue_list, list)
|
||||
hnb_ue_free(ue);
|
||||
|
||||
if (osmo_stream_cli_is_connected(hnb->iuh.client))
|
||||
osmo_stream_cli_close(hnb->iuh.client);
|
||||
|
||||
/* Close LLSK to notify lower layers that we are shutting down
|
||||
* even if we are not exiting the process. */
|
||||
if (hnb_llsk_connected(hnb))
|
||||
hnb_llsk_close_conn(hnb);
|
||||
|
||||
hnb_shutdown_fsm_state_chg(fi, HNB_SHUTDOWN_ST_EXIT);
|
||||
}
|
||||
|
||||
static void st_exit_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
|
||||
{
|
||||
struct hnb *hnb = (struct hnb *)fi->priv;
|
||||
|
@ -76,11 +90,17 @@ static struct osmo_fsm_state hnb_shutdown_fsm_states[] = {
|
|||
.in_event_mask =
|
||||
X(HNB_SHUTDOWN_EV_START),
|
||||
.out_state_mask =
|
||||
X(HNB_SHUTDOWN_ST_EXIT),
|
||||
X(HNB_SHUTDOWN_ST_IN_PROGRESS),
|
||||
.name = "NONE",
|
||||
.onenter = st_none_on_enter,
|
||||
.action = st_none,
|
||||
},
|
||||
[HNB_SHUTDOWN_ST_IN_PROGRESS] = {
|
||||
.out_state_mask =
|
||||
X(HNB_SHUTDOWN_ST_EXIT),
|
||||
.name = "IN_PROGRESS",
|
||||
.onenter = st_in_progress_on_enter,
|
||||
},
|
||||
[HNB_SHUTDOWN_ST_EXIT] = {
|
||||
.name = "EXIT",
|
||||
.out_state_mask =
|
||||
|
|
|
@ -180,6 +180,7 @@ void hnb_iuh_alloc(struct hnb *hnb)
|
|||
cli = osmo_stream_cli_create(hnb);
|
||||
OSMO_ASSERT(cli);
|
||||
hnb->iuh.client = cli;
|
||||
osmo_stream_cli_set_name(cli, "Iuh");
|
||||
osmo_stream_cli_set_nodelay(cli, true);
|
||||
osmo_stream_cli_set_proto(cli, IPPROTO_SCTP);
|
||||
osmo_stream_cli_set_reconnect_timeout(cli, 5);
|
||||
|
|
|
@ -85,6 +85,7 @@ enum u_addr_type osa2_ll_addr(const struct osmo_sockaddr *osa, union u_addr *uad
|
|||
static int llsk_opened_cb(struct osmo_prim_srv *srv)
|
||||
{
|
||||
struct hnb *hnb = (struct hnb *)osmo_prim_srv_get_priv(srv);
|
||||
osmo_prim_srv_set_name(srv, "llsk");
|
||||
|
||||
if (hnb->llsk.srv) {
|
||||
LOGP(DLLSK, LOGL_ERROR, "New connection opened while one is already active, dropping it\n");
|
||||
|
@ -112,7 +113,12 @@ static int llsk_closed_cb(struct osmo_prim_srv *srv)
|
|||
hnb->llsk.srv = NULL;
|
||||
hnb->llsk.valid_sapi_mask = 0x0;
|
||||
osmo_timer_del(&hnb->llsk.defer_configure_ind_timer);
|
||||
hnb_shutdown(hnb, "LLSK conn dropped", false);
|
||||
|
||||
/* We actively close the llsk conn during hnb_shutdown, no need to
|
||||
* re-enter shutdown procedure thin that case: */
|
||||
if (!hnb_shutdown_in_progress(hnb))
|
||||
hnb_shutdown(hnb, "LLSK conn dropped", false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -135,6 +141,14 @@ bool hnb_llsk_can_be_configured(struct hnb *hnb)
|
|||
return false;
|
||||
}
|
||||
|
||||
void hnb_llsk_close_conn(const struct hnb *hnb)
|
||||
{
|
||||
if (!hnb_llsk_connected(hnb))
|
||||
return;
|
||||
osmo_prim_srv_close(hnb->llsk.srv);
|
||||
/* pointer NULLed in llsk_closed_cb() */
|
||||
}
|
||||
|
||||
static void llsk_defer_configure_ind_timer_cb(void *data)
|
||||
{
|
||||
struct hnb *hnb = (struct hnb *)data;
|
||||
|
@ -208,6 +222,7 @@ int hnb_llsk_alloc(struct hnb *hnb)
|
|||
{
|
||||
hnb->llsk.link = osmo_prim_srv_link_alloc(hnb);
|
||||
osmo_prim_srv_link_set_priv(hnb->llsk.link, hnb);
|
||||
osmo_prim_srv_link_set_name(hnb->llsk.link, "llsk-link");
|
||||
osmo_prim_srv_link_set_log_category(hnb->llsk.link, DLLSK);
|
||||
osmo_prim_srv_link_set_addr(hnb->llsk.link, HNB_PRIM_UD_SOCK_DEFAULT);
|
||||
osmo_prim_srv_link_set_opened_conn_cb(hnb->llsk.link, llsk_opened_cb);
|
||||
|
@ -217,3 +232,15 @@ int hnb_llsk_alloc(struct hnb *hnb)
|
|||
osmo_timer_setup(&hnb->llsk.defer_configure_ind_timer, llsk_defer_configure_ind_timer_cb, hnb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void hnb_llsk_free(struct hnb *hnb)
|
||||
{
|
||||
osmo_timer_del(&hnb->llsk.defer_configure_ind_timer);
|
||||
osmo_prim_srv_link_free(hnb->llsk.link);
|
||||
hnb->llsk.link = NULL;
|
||||
}
|
||||
|
||||
int hnb_llsk_start_listen(struct hnb *hnb)
|
||||
{
|
||||
return osmo_prim_srv_link_open(g_hnb->llsk.link);
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ static int llsk_rx_audio_conn_establish_req(struct hnb *hnb, struct hnb_audio_co
|
|||
|
||||
/* Create the socket: */
|
||||
conn = rtp_conn_alloc(ue);
|
||||
if ((rc = rtp_conn_setup(conn, &rem_osa, ce_req)) < 0) {
|
||||
if ((rc = rtp_conn_setup(conn, hnb->iuh.local_addr, &rem_osa, ce_req)) < 0) {
|
||||
LOGUE(ue, DLLSK, LOGL_ERROR, "Rx AUDIO-CONN_ESTABLISH.req: Failed to set up audio socket rem_addr=%s\n",
|
||||
rem_addrstr);
|
||||
return _send_conn_establish_cnf_failed(hnb, v0->context_id, 4);
|
||||
|
|
|
@ -268,14 +268,14 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
rc = telnet_init_dynif(tall_hnb_ctx, g_hnb, vty_get_bind_addr(), OSMO_VTY_PORT_HNODEB);
|
||||
rc = telnet_init_default(tall_hnb_ctx, g_hnb, OSMO_VTY_PORT_HNODEB);
|
||||
if (rc < 0) {
|
||||
perror("Error binding VTY port");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Start listening on lower layer unix domain socket: */
|
||||
rc = osmo_prim_srv_link_open(g_hnb->llsk.link);
|
||||
rc = hnb_llsk_start_listen(g_hnb);
|
||||
if (rc < 0) {
|
||||
perror("Error opening lower layer socket");
|
||||
exit(1);
|
||||
|
|
|
@ -263,14 +263,13 @@ static void rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl,
|
|||
"Failed passing rx rtp up to IuUP layer: %d\n", rc);
|
||||
}
|
||||
|
||||
int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr,
|
||||
int rtp_conn_setup(struct rtp_conn *conn, const char *local_ipstr, const struct osmo_sockaddr *rem_addr,
|
||||
const struct hnb_audio_conn_establish_req_param *ce_req)
|
||||
{
|
||||
int rc;
|
||||
char cname[256+4];
|
||||
char name[32];
|
||||
struct osmo_rtp_socket *rs;
|
||||
const char *local_wildcard_ipstr = "0.0.0.0";
|
||||
char remote_ipstr[INET6_ADDRSTRLEN];
|
||||
uint16_t remote_port;
|
||||
struct osmo_iuup_rnl_prim *irp;
|
||||
|
@ -305,15 +304,16 @@ int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr,
|
|||
rs->priv = conn;
|
||||
rs->rx_cb = &rtp_rx_cb;
|
||||
|
||||
rc = rtp_bind(hnb, rs, local_wildcard_ipstr);
|
||||
rc = rtp_bind(hnb, rs, local_ipstr);
|
||||
if (rc < 0) {
|
||||
LOGUE(ue, DRTP, LOGL_ERROR, "Failed to bind RTP/RTCP sockets\n");
|
||||
goto free_ret;
|
||||
}
|
||||
conn->id = rc; /* We use local port as rtp conn ID */
|
||||
osmo_sockaddr_from_str_and_uint(&conn->loc_addr, local_ipstr, rc);
|
||||
|
||||
/* Ensure RTCP SDES contains some useful information */
|
||||
snprintf(cname, sizeof(cname), "hnb@%s", local_wildcard_ipstr);
|
||||
snprintf(cname, sizeof(cname), "hnb@%s", local_ipstr);
|
||||
snprintf(name, sizeof(name), "ue@%u-%u", conn->ue->conn_id, conn->id);
|
||||
osmo_rtp_set_source_desc(rs, cname, name, NULL, NULL, NULL,
|
||||
"OsmoHNodeB-" PACKAGE_VERSION, NULL);
|
||||
|
@ -324,12 +324,14 @@ int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr,
|
|||
goto free_ret;
|
||||
}
|
||||
|
||||
/* osmo_rtp_socket_connect() is broken, OS#5356 */
|
||||
//rc = rtp_get_bound_addr(rs, &conn->loc_addr);
|
||||
rc = rtp_get_bound_addr(rs, rem_addr, &conn->loc_addr);
|
||||
if (rc < 0) {
|
||||
LOGUE(ue, DRTP, LOGL_ERROR, "Cannot obtain locally bound IP/port: %d\n", rc);
|
||||
goto free_ret;
|
||||
if (osmo_sockaddr_is_any(&conn->loc_addr)) {
|
||||
/* osmo_rtp_socket_connect() is broken, OS#5356 */
|
||||
//rc = rtp_get_bound_addr(rs, &conn->loc_addr);
|
||||
rc = rtp_get_bound_addr(rs, rem_addr, &conn->loc_addr);
|
||||
if (rc < 0) {
|
||||
LOGUE(ue, DRTP, LOGL_ERROR, "Cannot obtain locally bound IP/port: %d\n", rc);
|
||||
goto free_ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now configure the IuUP layer: */
|
||||
|
|
|
@ -115,6 +115,11 @@ static void hnb_rua_cl_handle(struct hnb *hnb, ANY_t *in)
|
|||
ranap_buf_len = ies.ranaP_Message.size;
|
||||
|
||||
LOGP(DRUA, LOGL_DEBUG, "Rx RUA UDT ranap_len=%zu\n", ranap_buf_len);
|
||||
if (!hnb->llsk.srv) {
|
||||
LOGP(DRUA, LOGL_NOTICE, "Discarding rx RUA UDT ranap_len=%zu due to lower layers not available\n",
|
||||
ranap_buf_len);
|
||||
goto free_ret;
|
||||
}
|
||||
|
||||
LOGP(DLLSK, LOGL_DEBUG, "Tx IUH-UNITDATA.ind ranap_len=%zu\n", ranap_buf_len);
|
||||
iuh_prim = hnb_iuh_makeprim_unitdata_ind(ranap_buf, ranap_buf_len);
|
||||
|
|
|
@ -343,7 +343,10 @@ static int config_write_hnodeb(struct vty *vty)
|
|||
|
||||
|
||||
DEFUN(asn_dbg, asn_dbg_cmd,
|
||||
"asn-debug (1|0)", "Enable or disable libasn1c debugging")
|
||||
"asn-debug (1|0)",
|
||||
"Enable or disable libasn1c debugging\n"
|
||||
"Enable libasn1c debugging\n"
|
||||
"Disable libasn1c debugging\n")
|
||||
{
|
||||
asn_debug = atoi(argv[0]);
|
||||
|
||||
|
|
|
@ -34,15 +34,14 @@ DISTCLEANFILES = \
|
|||
$(NULL)
|
||||
|
||||
if ENABLE_EXT_TESTS
|
||||
python-tests: $(BUILT_SOURCES)
|
||||
echo ""
|
||||
# TODO: Enable once we have a VTY/CTRL interface:
|
||||
# $(MAKE) vty-test
|
||||
# osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
|
||||
# osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
|
||||
python-tests: $(top_builddir)/src/osmo-hnodeb/osmo-hnodeb
|
||||
$(MAKE) vty-test
|
||||
osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
|
||||
osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
|
||||
# TODO: CTRL interface is not implemented
|
||||
# $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
|
||||
else
|
||||
python-tests: $(BUILT_SOURCES)
|
||||
python-tests:
|
||||
echo "Not running python-based tests (determined at configure-time)"
|
||||
endif
|
||||
|
||||
|
@ -52,7 +51,7 @@ VTY_TEST ?= *.vty
|
|||
# To update the VTY script from current application behavior,
|
||||
# pass -u to vty_script_runner.py by doing:
|
||||
# make vty-test U=-u
|
||||
vty-test:
|
||||
vty-test: $(top_builddir)/src/osmo-hnodeb/osmo-hnodeb
|
||||
osmo_verify_transcript_vty.py -v \
|
||||
-n OsmoHNodeB -p 4273 \
|
||||
-r "$(top_builddir)/src/osmo-hnodeb/osmo-hnodeb -c $(top_srcdir)/doc/examples/osmo-hnodeb/osmo-hnodeb.cfg" \
|
||||
|
|
|
@ -154,7 +154,7 @@ class TestCtrlHNB(TestCtrlBase):
|
|||
"doc/examples/osmo-hnodeb/osmo-hnodeb.cfg"]
|
||||
|
||||
def ctrl_app(self):
|
||||
return (4249, "./src/osmo-hnodeb/osmo-hnodeb", "OsmoHNodeB", "hnb")
|
||||
return (4274, "./src/osmo-hnodeb/osmo-hnodeb", "OsmoHNodeB", "hnb")
|
||||
|
||||
def testCtrlErrs(self):
|
||||
r = self.do_get('invalid')
|
||||
|
|
Loading…
Reference in New Issue