Compare commits

...

1 Commits

Author SHA1 Message Date
Jonathan Santos
5a45b156d4 New upstream version 0.9.14 2011-08-17 15:33:57 -04:00
225 changed files with 8503 additions and 4760 deletions

View File

@@ -1 +1 @@
0.9.13
0.9.14

View File

@@ -1,12 +1,13 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
INCLUDES = $(all_includes) -I$(top_srcdir)/include
SUBDIRS = include src tests
SUBDIRS = doc include src tests
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = openbsc.pc
BUILT_SOURCES = $(top_srcdir)/.version
EXTRA_DIST = git-version-gen
$(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:

View File

@@ -38,7 +38,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/openbsc.pc.in $(top_srcdir)/configure AUTHORS \
COPYING depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -162,6 +162,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
@@ -232,10 +234,11 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
INCLUDES = $(all_includes) -I$(top_srcdir)/include
SUBDIRS = include src tests
SUBDIRS = doc include src tests
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = openbsc.pc
BUILT_SOURCES = $(top_srcdir)/.version
EXTRA_DIST = git-version-gen
all: $(BUILT_SOURCES) bscconfig.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

14
aclocal.m4 vendored
View File

@@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
[m4_warning([this file was generated for autoconf 2.67.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
[m4_warning([this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -47,7 +47,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -93,7 +94,8 @@ m4_define([_PKG_CONFIG],
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
@@ -141,9 +143,9 @@ if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD

View File

@@ -1,8 +1,11 @@
/* bscconfig.h.in. Generated from configure.in by autoheader. */
/* bscconfig.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dahdi/user.h> header file. */
#undef HAVE_DAHDI_USER_H
/* Define to 1 if you have the <dbi/dbd.h> header file. */
#undef HAVE_DBI_DBD_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

399
configure vendored

File diff suppressed because it is too large Load Diff

115
configure.ac Normal file
View File

@@ -0,0 +1,115 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT([openbsc],
m4_esyscmd([./git-version-gen .tarball-version]),
[openbsc-devel@lists.openbsc.org])
AM_INIT_AUTOMAKE([dist-bzip2])
dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl checks for programs
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl checks for libraries
AC_SEARCH_LIBS(crypt, crypt,
[LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])])
AC_SEARCH_LIBS(gtp_new, gtp,
[LIBCRYPT="-lgtp"; AC_SUBST([GPRS_LIBGTP], [1])])
AM_CONDITIONAL(HAVE_LIBGTP, test "x$GPRS_LIBGTP" != "x")
AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
[
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
osmo_ac_build_nat="yes"
],
[
osmo_ac_build_nat="no"
])
AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes")
AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
[
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
osmo_ac_build_bsc="yes"
],
[
osmo_ac_build_bsc="no"
])
AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
dnl checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed))
dnl Checks for typedefs, structures and compiler characteristics
# The following test is taken from WebKit's webkit.m4
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden "
AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
[ AC_MSG_RESULT([yes])
SYMBOL_VISIBILITY="-fvisibility=hidden"],
AC_MSG_RESULT([no]))
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
# Coverage build taken from WebKit's configure.in
AC_MSG_CHECKING([whether to enable code coverage support])
AC_ARG_ENABLE(coverage,
AC_HELP_STRING([--enable-coverage],
[enable code coverage support [default=no]]),
[],[enable_coverage="no"])
AC_MSG_RESULT([$enable_coverage])
if test "$enable_coverage" = "yes"; then
COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
AC_SUBST([COVERAGE_CFLAGS])
AC_SUBST([COVERAGE_LDFLAGS])
fi
dnl Generate the output
AM_CONFIG_HEADER(bscconfig.h)
AC_OUTPUT(
openbsc.pc
include/openbsc/Makefile
include/Makefile
src/Makefile
src/libtrau/Makefile
src/libabis/Makefile
src/libbsc/Makefile
src/libmsc/Makefile
src/libmgcp/Makefile
src/libcommon/Makefile
src/osmo-nitb/Makefile
src/osmo-bsc/Makefile
src/osmo-bsc_nat/Makefile
src/osmo-bsc_mgcp/Makefile
src/ipaccess/Makefile
src/utils/Makefile
src/libgb/Makefile
src/gprs/Makefile
tests/Makefile
tests/debug/Makefile
tests/gsm0408/Makefile
tests/db/Makefile
tests/channel/Makefile
tests/bsc-nat/Makefile
tests/mgcp/Makefile
doc/Makefile
doc/examples/Makefile
Makefile)

1
doc/Makefile.am Normal file
View File

@@ -0,0 +1 @@
SUBDIRS = examples

539
doc/Makefile.in Normal file
View File

@@ -0,0 +1,539 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
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 = :
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
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)/bscconfig.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GPRS_LIBGTP = @GPRS_LIBGTP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
LIBOSMOVTY_LIBS = @LIBOSMOVTY_LIBS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYMBOL_VISIBILITY = @SYMBOL_VISIBILITY@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = examples
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/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
$(am__aclocal_m4_deps):
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
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:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic ctags \
ctags-recursive distclean distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
tags-recursive uninstall uninstall-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:

23
doc/examples/Makefile.am Normal file
View File

@@ -0,0 +1,23 @@
CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,'
dist-hook:
for f in $$($(CFG_FILES)); do \
j="$(distdir)/$$f" && \
mkdir -p "$$(dirname $$j)" && \
$(INSTALL_DATA) $(srcdir)/$$f $$j; \
done
install-data-hook:
for f in $$($(CFG_FILES)); do \
j="$(DESTDIR)$(docdir)/examples/$$f" && \
mkdir -p "$$(dirname $$j)" && \
$(INSTALL_DATA) $(srcdir)/$$f $$j; \
done
uninstall-hook:
@$(PRE_UNINSTALL)
for f in $$($(CFG_FILES)); do \
j="$(DESTDIR)$(docdir)/examples/$$f" && \
$(RM) $$j; \
done

364
doc/examples/Makefile.in Normal file
View File

@@ -0,0 +1,364 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
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 = :
subdir = doc/examples
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
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)/bscconfig.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GPRS_LIBGTP = @GPRS_LIBGTP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
LIBOSMOVTY_LIBS = @LIBOSMOVTY_LIBS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYMBOL_VISIBILITY = @SYMBOL_VISIBILITY@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,'
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/examples/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/examples/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
$(am__aclocal_m4_deps):
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
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:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
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
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
.MAKE: install-am install-data-am install-strip uninstall-am
.PHONY: all all-am check check-am clean clean-generic dist-hook \
distclean distclean-generic distdir dvi dvi-am html html-am \
info info-am install install-am install-data install-data-am \
install-data-hook install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am uninstall uninstall-am uninstall-hook
dist-hook:
for f in $$($(CFG_FILES)); do \
j="$(distdir)/$$f" && \
mkdir -p "$$(dirname $$j)" && \
$(INSTALL_DATA) $(srcdir)/$$f $$j; \
done
install-data-hook:
for f in $$($(CFG_FILES)); do \
j="$(DESTDIR)$(docdir)/examples/$$f" && \
mkdir -p "$$(dirname $$j)" && \
$(INSTALL_DATA) $(srcdir)/$$f $$j; \
done
uninstall-hook:
@$(PRE_UNINSTALL)
for f in $$($(CFG_FILES)); do \
j="$(DESTDIR)$(docdir)/examples/$$f" && \
$(RM) $$j; \
done
# 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:

View File

@@ -0,0 +1,19 @@
!
! MGCP configuration hand edited
! !
password foo
!
line vty
no login
!
mgcp
! local ip 213.167.134.14
bts ip 172.16.252.43
bind ip 213.167.134.141
bind port 2427
bind early 1
rtp base 4000
sdp audio payload number 98
sdp audio payload name AMR/8000
number endpoints 31
loop 1

View File

@@ -0,0 +1,164 @@
!
! OpenBSC (0.9.0.845-57c4) configuration saved from vty
!!
password foo
!
line vty
no login
!
e1_input
e1_line 0 driver misdn
network
network country code 1
mobile network code 1
short name OpenBSC
long name OpenBSC
auth policy closed
location updating reject cause 13
encryption a5 0
neci 1
rrlp mode none
mm info 0
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 0
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3141 0
bts 0
type bs11
band GSM900
cell_identity 0
location_area_code 1
training_sequence_code 7
base_station_id_code 63
ms max power 15
cell reselection hysteresis 4
rxlev access min 0
channel allocator descending
rach tx integer 9
rach max transmission 7
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
gprs mode none
trx 0
rf_locked 0
arfcn 121
nominal power 24
max_power_red 12
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 1
timeslot 0
phys_chan_config CCCH
hopping enabled 0
e1 line 0 timeslot 1 sub-slot full
timeslot 1
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 2 sub-slot 1
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 2 sub-slot 2
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 2 sub-slot 3
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 1
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 2
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 3
trx 1
rf_locked 0
arfcn 119
nominal power 24
max_power_red 12
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 2
timeslot 0
phys_chan_config SDCCH8
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
timeslot 1
phys_chan_config TCH/F
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
e1 line 0 timeslot 4 sub-slot 1
timeslot 2
phys_chan_config TCH/F
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
e1 line 0 timeslot 4 sub-slot 2
timeslot 3
phys_chan_config TCH/F
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
e1 line 0 timeslot 4 sub-slot 3
timeslot 4
phys_chan_config TCH/F
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
e1 line 0 timeslot 5 sub-slot 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
e1 line 0 timeslot 5 sub-slot 1
timeslot 6
phys_chan_config TCH/F
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
e1 line 0 timeslot 5 sub-slot 2
timeslot 7
phys_chan_config TCH/F
hopping enabled 1
hopping sequence-number 0
hopping maio 0
hopping arfcn add 117
hopping arfcn add 119
e1 line 0 timeslot 5 sub-slot 3

View File

@@ -0,0 +1,84 @@
!
! OpenBSC configuration saved from vty
! !
password foo
!
line vty
no login
!
e1_input
e1_line 0 driver misdn
network
network country code 1
mobile network code 1
short name OpenBSC
long name OpenBSC
timer t3101 10
timer t3113 60
bts 0
type bs11
band GSM900
cell_identity 1
location_area_code 1
training_sequence_code 7
base_station_id_code 63
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
trx 0
arfcn 121
max_power_red 0
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 1
timeslot 0
phys_chan_config CCCH+SDCCH4
e1 line 0 timeslot 1 sub-slot full
timeslot 1
phys_chan_config SDCCH8
e1 line 0 timeslot 2 sub-slot 1
timeslot 2
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 2
timeslot 3
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 3
timeslot 4
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 0
timeslot 5
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 1
timeslot 6
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 2
timeslot 7
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 3
trx 1
arfcn 123
max_power_red 0
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 2
timeslot 0
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 0
timeslot 1
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 1
timeslot 2
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 2
timeslot 3
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 3
timeslot 4
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 0
timeslot 5
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 1
timeslot 6
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 2
timeslot 7
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 3

View File

@@ -0,0 +1,148 @@
!
! OpenBSC configuration saved from vty
! !
password foo
!
line vty
no login
!
network
network country code 1
mobile network code 1
short name OpenBSC
long name OpenBSC
timer t3101 10
timer t3113 60
bts 0
type bs11
band GSM900
cell_identity 1
location_area_code 1
training_sequence_code 7
base_station_id_code 63
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
trx 0
arfcn 121
max_power_red 0
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 1
timeslot 0
phys_chan_config CCCH+SDCCH4
e1 line 0 timeslot 1 sub-slot full
timeslot 1
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 1
timeslot 2
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 2
timeslot 3
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 3
timeslot 4
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 0
timeslot 5
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 1
timeslot 6
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 2
timeslot 7
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 3
trx 1
arfcn 123
max_power_red 0
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 2
timeslot 0
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 0
timeslot 1
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 1
timeslot 2
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 2
timeslot 3
phys_chan_config TCH/F
e1 line 0 timeslot 4 sub-slot 3
timeslot 4
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 0
timeslot 5
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 1
timeslot 6
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 2
timeslot 7
phys_chan_config TCH/F
e1 line 0 timeslot 5 sub-slot 3
bts 1
type bs11
band GSM900
location_area_code 2
training_sequence_code 7
base_station_id_code 63
oml e1 line 1 timeslot 6 sub-slot full
oml e1 tei 25
trx 0
arfcn 122
max_power_red 0
rsl e1 line 1 timeslot 6 sub-slot full
rsl e1 tei 1
timeslot 0
phys_chan_config CCCH+SDCCH4
e1 line 1 timeslot 7 sub-slot 0
timeslot 1
phys_chan_config SDCCH8
e1 line 1 timeslot 7 sub-slot 1
timeslot 2
phys_chan_config TCH/F
e1 line 1 timeslot 7 sub-slot 2
timeslot 3
phys_chan_config TCH/F
e1 line 1 timeslot 7 sub-slot 3
timeslot 4
phys_chan_config TCH/F
e1 line 1 timeslot 8 sub-slot 0
timeslot 5
phys_chan_config TCH/F
e1 line 1 timeslot 8 sub-slot 1
timeslot 6
phys_chan_config TCH/F
e1 line 1 timeslot 8 sub-slot 2
timeslot 7
phys_chan_config TCH/F
e1 line 1 timeslot 8 sub-slot 3
trx 1
arfcn 124
max_power_red 0
rsl e1 line 1 timeslot 6 sub-slot full
rsl e1 tei 2
timeslot 0
phys_chan_config TCH/F
e1 line 1 timeslot 9 sub-slot 0
timeslot 1
phys_chan_config TCH/F
e1 line 1 timeslot 9 sub-slot 1
timeslot 2
phys_chan_config TCH/F
e1 line 1 timeslot 9 sub-slot 2
timeslot 3
phys_chan_config TCH/F
e1 line 1 timeslot 9 sub-slot 3
timeslot 4
phys_chan_config TCH/F
e1 line 1 timeslot 10 sub-slot 0
timeslot 5
phys_chan_config TCH/F
e1 line 1 timeslot 10 sub-slot 1
timeslot 6
phys_chan_config TCH/F
e1 line 1 timeslot 10 sub-slot 2
timeslot 7
phys_chan_config TCH/F
e1 line 1 timeslot 10 sub-slot 3

View File

@@ -0,0 +1,56 @@
!
! OpenBSC configuration saved from vty
! !
password foo
!
line vty
no login
!
e1_input
e1_line 0 driver misdn
network
network country code 1
mobile network code 1
short name OpenBSC
long name OpenBSC
timer t3101 10
timer t3113 60
bts 0
type bs11
band GSM900
cell_identity 1
location_area_code 1
training_sequence_code 7
base_station_id_code 63
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
trx 0
arfcn 121
max_power_red 0
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 1
timeslot 0
phys_chan_config CCCH+SDCCH4
e1 line 0 timeslot 1 sub-slot full
timeslot 1
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 1
timeslot 2
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 2
timeslot 3
phys_chan_config TCH/F
e1 line 0 timeslot 2 sub-slot 3
timeslot 4
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 0
timeslot 5
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 1
timeslot 6
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 2
timeslot 7
phys_chan_config TCH/F
e1 line 0 timeslot 3 sub-slot 3

View File

@@ -0,0 +1,87 @@
!
! OpenBSC (0.9.11.261-32c0) configuration saved from vty
!!
password foo
!
line vty
no login
!
network
network country code 262
mobile network code 42
short name OpenBSC
long name OpenBSC
auth policy closed
location updating reject cause 13
encryption a5 0
neci 1
paging any use tch 0
rrlp mode none
mm info 0
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 0
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3122 0
timer t3141 0
dtx-used 1
subscriber-keep-in-ram 0
bts 0
type hsl_femto
band DCS1800
cell_identity 0
location_area_code 1
training_sequence_code 0
base_station_id_code 0
ms max power 15
cell reselection hysteresis 4
rxlev access min 0
channel allocator ascending
rach tx integer 9
rach max transmission 1
hsl serial-number 8303701
neighbor-list mode automatic
gprs mode none
trx 0
rf_locked 0
arfcn 871
nominal power 23
max_power_red 20
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
hopping enabled 0
timeslot 1
phys_chan_config TCH/F
hopping enabled 0
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
timeslot 7
phys_chan_config TCH/F
hopping enabled 0

View File

@@ -0,0 +1,97 @@
!
! OpenBSC configuration saved from vty
! !
password foo
!
line vty
no login
!
network
network country code 1
mobile network code 1
short name OpenBSC
long name OpenBSC
auth policy closed
location updating reject cause 13
encryption a5 0
neci 1
rrlp mode none
mm info 0
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 0
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3141 0
bts 0
type nanobts
band DCS1800
cell_identity 0
location_area_code 1
training_sequence_code 7
base_station_id_code 63
ms max power 15
cell reselection hysteresis 4
rxlev access min 0
channel allocator ascending
rach tx integer 9
rach max transmission 7
ip.access unit_id 1800 0
oml ip.access stream_id 255
gprs mode none
trx 0
rf_locked 0
arfcn 871
nominal power 23
max_power_red 0
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
timeslot 1
phys_chan_config SDCCH8
timeslot 2
phys_chan_config TCH/F
timeslot 3
phys_chan_config TCH/F
timeslot 4
phys_chan_config TCH/F
timeslot 5
phys_chan_config TCH/F
timeslot 6
phys_chan_config TCH/F
timeslot 7
phys_chan_config TCH/F
trx 1
rf_locked 0
arfcn 873
nominal power 23
max_power_red 0
rsl e1 tei 0
timeslot 0
phys_chan_config SDCCH8
timeslot 1
phys_chan_config TCH/F
timeslot 2
phys_chan_config TCH/F
timeslot 3
phys_chan_config TCH/F
timeslot 4
phys_chan_config TCH/F
timeslot 5
phys_chan_config TCH/F
timeslot 6
phys_chan_config TCH/F
timeslot 7
phys_chan_config TCH/F

View File

@@ -0,0 +1,75 @@
!
! OpenBSC configuration saved from vty
! !
password foo
!
line vty
no login
!
network
network country code 1
mobile network code 1
short name OpenBSC
long name OpenBSC
auth policy closed
location updating reject cause 13
encryption a5 0
neci 1
rrlp mode none
mm info 1
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 0
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3141 0
bts 0
type nanobts
band DCS1800
cell_identity 0
location_area_code 1
training_sequence_code 7
base_station_id_code 63
ms max power 15
cell reselection hysteresis 4
rxlev access min 0
channel allocator ascending
rach tx integer 9
rach max transmission 7
ip.access unit_id 1801 0
oml ip.access stream_id 255
gprs mode none
trx 0
rf_locked 0
arfcn 514
nominal power 23
max_power_red 20
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
timeslot 1
phys_chan_config SDCCH8
timeslot 2
phys_chan_config TCH/F
timeslot 3
phys_chan_config TCH/F
timeslot 4
phys_chan_config TCH/F
timeslot 5
phys_chan_config TCH/F
timeslot 6
phys_chan_config TCH/F
timeslot 7
phys_chan_config TCH/F

View File

@@ -0,0 +1,221 @@
!
! OpenBSC (0.9.11.308-62d46) configuration saved from vty
!!
password foo
!
line vty
no login
!
network
network country code 262
mobile network code 42
short name OpenBSC
long name OpenBSC
auth policy closed
location updating reject cause 13
encryption a5 0
neci 0
paging any use tch 0
rrlp mode none
mm info 0
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 0
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3122 0
timer t3141 0
dtx-used 0
subscriber-keep-in-ram 0
bts 0
type rbs2000
band GSM900
cell_identity 0
location_area_code 1
training_sequence_code 7
base_station_id_code 63
ms max power 15
cell reselection hysteresis 4
rxlev access min 0
channel allocator descending
rach tx integer 9
rach max transmission 7
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 62
neighbor-list mode automatic
gprs mode none
is-connection-list add 4 512 12
is-connection-list add 16 524 12
is-connection-list add 28 536 12
is-connection-list add 40 548 12
trx 0
rf_locked 0
arfcn 55
nominal power 24
max_power_red 12
rsl e1 line 0 timeslot 1 sub-slot full
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
hopping enabled 0
e1 line 0 timeslot 1 sub-slot full
timeslot 1
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 2 sub-slot 1
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 2 sub-slot 2
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 2 sub-slot 3
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 1
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 2
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 3 sub-slot 3
trx 1
rf_locked 0
arfcn 57
nominal power 24
max_power_red 12
rsl e1 line 0 timeslot 4 sub-slot full
rsl e1 tei 1
timeslot 0
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 5 sub-slot 0
timeslot 1
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 5 sub-slot 1
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 5 sub-slot 2
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 5 sub-slot 3
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 6 sub-slot 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 6 sub-slot 1
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 6 sub-slot 2
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 6 sub-slot 3
trx 2
rf_locked 0
arfcn 59
nominal power 24
max_power_red 12
rsl e1 line 0 timeslot 7 sub-slot full
rsl e1 tei 2
timeslot 0
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 8 sub-slot 0
timeslot 1
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 8 sub-slot 1
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 8 sub-slot 2
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 8 sub-slot 3
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 9 sub-slot 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 9 sub-slot 1
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 9 sub-slot 2
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 9 sub-slot 3
trx 3
rf_locked 0
arfcn 61
nominal power 24
max_power_red 12
rsl e1 line 0 timeslot 10 sub-slot full
rsl e1 tei 3
timeslot 0
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 11 sub-slot 0
timeslot 1
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 11 sub-slot 1
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 11 sub-slot 2
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 11 sub-slot 3
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 12 sub-slot 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 12 sub-slot 1
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 12 sub-slot 2
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
e1 line 0 timeslot 12 sub-slot 3
e1_input
e1_line 0 driver dahdi

151
git-version-gen Executable file
View File

@@ -0,0 +1,151 @@
#!/bin/sh
# Print a version string.
scriptversion=2010-01-28.01
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
#
# 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
# (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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
# It may be run two ways:
# - from a git repository in which the "git describe" command below
# produces useful output (thus requiring at least one signed tag)
# - from a non-git-repo directory containing a .tarball-version file, which
# presumes this script is invoked like "./git-version-gen .tarball-version".
# In order to use intra-version strings in your project, you will need two
# separate generated version string files:
#
# .tarball-version - present only in a distribution tarball, and not in
# a checked-out repository. Created with contents that were learned at
# the last time autoconf was run, and used by git-version-gen. Must not
# be present in either $(srcdir) or $(builddir) for git-version-gen to
# give accurate answers during normal development with a checked out tree,
# but must be present in a tarball when there is no version control system.
# Therefore, it cannot be used in any dependencies. GNUmakefile has
# hooks to force a reconfigure at distribution time to get the value
# correct, without penalizing normal development with extra reconfigures.
#
# .version - present in a checked-out repository and in a distribution
# tarball. Usable in dependencies, particularly for files that don't
# want to depend on config.h but do want to track version changes.
# Delete this file prior to any autoconf run where you want to rebuild
# files to pick up a version string change; and leave it stale to
# minimize rebuild time after unrelated changes to configure sources.
#
# It is probably wise to add these two files to .gitignore, so that you
# don't accidentally commit either generated file.
#
# Use the following line in your configure.ac, so that $(VERSION) will
# automatically be up-to-date each time configure is run (and note that
# since configure.ac no longer includes a version string, Makefile rules
# should not depend on configure.ac for version updates).
#
# AC_INIT([GNU project],
# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
# [bug-project@example])
#
# Then use the following lines in your Makefile.am, so that .version
# will be present for dependencies, and so that .tarball-version will
# exist in distribution tarballs.
#
# BUILT_SOURCES = $(top_srcdir)/.version
# $(top_srcdir)/.version:
# echo $(VERSION) > $@-t && mv $@-t $@
# dist-hook:
# echo $(VERSION) > $(distdir)/.tarball-version
case $# in
1) ;;
*) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;;
esac
tarball_version_file=$1
nl='
'
# First see if there is a tarball-only version file.
# then try "git describe", then default.
if test -f $tarball_version_file
then
v=`cat $tarball_version_file` || exit 1
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
*) v= ;;
esac
test -z "$v" \
&& echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
fi
if test -n "$v"
then
: # use $v
elif test -d ./../.git \
&& v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
|| git describe --abbrev=4 HEAD 2>/dev/null` \
&& case $v in
[0-9]*) ;;
v[0-9]*) ;;
*) (exit 1) ;;
esac
then
# Is this a new git that lists number of commits since the last
# tag or the previous older version that did not?
# Newer: v6.10-77-g0f8faeb
# Older: v6.10-g0f8faeb
case $v in
*-*-*) : git describe is okay three part flavor ;;
*-*)
: git describe is older two part flavor
# Recreate the number of commits and rewrite such that the
# result is the same as if we were using the newer version
# of git describe.
vtag=`echo "$v" | sed 's/-.*//'`
numcommits=`git rev-list "$vtag"..HEAD | wc -l`
v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
;;
esac
# Change the first '-' to a '.', so version-comparing tools work properly.
# Remove the "g" in git describe's output string, to save a byte.
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
else
v=UNKNOWN
fi
v=`echo "$v" |sed 's/^v//'`
# Don't declare a version "dirty" merely because a time stamp has changed.
git status > /dev/null 2>&1
dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
case "$dirty" in
'') ;;
*) # Append the suffix only if there isn't one already.
case $v in
*-dirty) ;;
*) v="$v-dirty" ;;
esac ;;
esac
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
echo "$v" | tr -d '\012'
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -36,7 +36,7 @@ subdir = include
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -126,6 +126,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@

View File

@@ -11,7 +11,8 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.h \
gprs_ns_frgre.h auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h \
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
bss.h gsm_data_shared.h
openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
openbscdir = $(includedir)/openbsc

View File

@@ -36,7 +36,7 @@ subdir = include/openbsc
DIST_COMMON = $(noinst_HEADERS) $(openbsc_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -110,6 +110,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
@@ -191,7 +193,8 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.h \
gprs_ns_frgre.h auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h \
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
bss.h gsm_data_shared.h
openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
openbscdir = $(includedir)/openbsc

View File

@@ -22,15 +22,15 @@
#ifndef _NM_H
#define _NM_H
#include <sys/types.h>
#include <osmocore/tlv.h>
#include <osmocore/protocol/gsm_12_21.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/abis_nm.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
struct cell_global_id {
u_int16_t mcc;
u_int16_t mnc;
u_int16_t lac;
u_int16_t ci;
uint16_t mcc;
uint16_t mnc;
uint16_t lac;
uint16_t ci;
};
/* The BCCH info from an ip.access test, in host byte order
@@ -38,26 +38,22 @@ struct cell_global_id {
struct ipac_bcch_info {
struct llist_head list;
u_int16_t info_type;
u_int8_t freq_qual;
u_int16_t arfcn;
u_int8_t rx_lev;
u_int8_t rx_qual;
uint16_t info_type;
uint8_t freq_qual;
uint16_t arfcn;
uint8_t rx_lev;
uint8_t rx_qual;
int16_t freq_err;
u_int16_t frame_offset;
u_int32_t frame_nr_offset;
u_int8_t bsic;
uint16_t frame_offset;
uint32_t frame_nr_offset;
uint8_t bsic;
struct cell_global_id cgi;
u_int8_t ba_list_si2[16];
u_int8_t ba_list_si2bis[16];
u_int8_t ba_list_si2ter[16];
u_int8_t ca_list_si1[16];
uint8_t ba_list_si2[16];
uint8_t ba_list_si2bis[16];
uint8_t ba_list_si2ter[16];
uint8_t ca_list_si1[16];
};
extern const struct value_string abis_nm_adm_state_names[];
extern const struct value_string abis_nm_obj_class_names[];
extern const struct tlv_definition nm_att_tlvdef;
/* PUBLIC */
struct msgb;
@@ -72,60 +68,58 @@ struct abis_nm_cfg {
extern int abis_nm_rcvmsg(struct msgb *msg);
int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const u_int8_t *buf, int len);
int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len);
int abis_nm_rx(struct msgb *msg);
int abis_nm_opstart(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0, u_int8_t i1, u_int8_t i2);
int abis_nm_chg_adm_state(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i0,
u_int8_t i1, u_int8_t i2, enum abis_nm_adm_state adm_state);
int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr,
u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot,
u_int8_t tei);
int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2);
int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0,
uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state);
int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr,
uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot,
uint8_t tei);
int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot);
uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot);
int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
u_int8_t e1_port, u_int8_t e1_timeslot,
u_int8_t e1_subslot);
int abis_nm_set_bts_attr(struct gsm_bts *bts, u_int8_t *attr, int attr_len);
int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, u_int8_t *attr, int attr_len);
int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb);
int abis_nm_sw_act_req_ack(struct gsm_bts *bts, u_int8_t obj_class, u_int8_t i1,
u_int8_t i2, u_int8_t i3, int nack, u_int8_t *attr, int att_len);
int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg);
uint8_t e1_port, uint8_t e1_timeslot,
uint8_t e1_subslot);
int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len);
int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len);
int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb);
int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1,
uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len);
int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *msg);
int abis_nm_event_reports(struct gsm_bts *bts, int on);
int abis_nm_reset_resource(struct gsm_bts *bts);
int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname,
u_int8_t win_size, int forced,
uint8_t win_size, int forced,
gsm_cbfn *cbfn, void *cb_data);
int abis_nm_software_load_status(struct gsm_bts *bts);
int abis_nm_software_activate(struct gsm_bts *bts, const char *fname,
gsm_cbfn *cbfn, void *cb_data);
int abis_nm_conn_mdrop_link(struct gsm_bts *bts, u_int8_t e1_port0, u_int8_t ts0,
u_int8_t e1_port1, u_int8_t ts1);
int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0,
uint8_t e1_port1, uint8_t ts1);
int abis_nm_perform_test(struct gsm_bts *bts, u_int8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
u_int8_t test_nr, u_int8_t auton_report, struct msgb *msg);
int abis_nm_chcomb4pchan(enum gsm_phys_chan_config pchan);
int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class,
uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
uint8_t test_nr, uint8_t auton_report, struct msgb *msg);
/* Siemens / BS-11 specific */
int abis_nm_bs11_reset_resource(struct gsm_bts *bts);
int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin);
int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type,
u_int8_t idx, u_int8_t attr_len, const u_int8_t *attr);
int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx);
int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx);
uint8_t idx, uint8_t attr_len, const uint8_t *attr);
int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_t idx);
int abis_nm_bs11_create_bport(struct gsm_bts *bts, uint8_t idx);
int abis_nm_bs11_delete_object(struct gsm_bts *bts,
enum abis_bs11_objtype type, u_int8_t idx);
int abis_nm_bs11_delete_bport(struct gsm_bts *bts, u_int8_t idx);
int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, u_int8_t e1_port,
u_int8_t e1_timeslot, u_int8_t e1_subslot, u_int8_t tei);
enum abis_bs11_objtype type, uint8_t idx);
int abis_nm_bs11_delete_bport(struct gsm_bts *bts, uint8_t idx);
int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port,
uint8_t e1_timeslot, uint8_t e1_subslot, uint8_t tei);
int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts);
int abis_nm_bs11_get_serno(struct gsm_bts *bts);
int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, u_int8_t level);
int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, uint8_t level);
int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx);
int abis_nm_bs11_logon(struct gsm_bts *bts, u_int8_t level, const char *name, int on);
int abis_nm_bs11_logon(struct gsm_bts *bts, uint8_t level, const char *name, int on);
int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on);
int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on);
int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password);
@@ -135,33 +129,31 @@ int abis_nm_bs11_set_pll(struct gsm_bts *bts, int value);
int abis_nm_bs11_get_cclk(struct gsm_bts *bts);
int abis_nm_bs11_get_state(struct gsm_bts *bts);
int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname,
u_int8_t win_size, int forced, gsm_cbfn *cbfn);
uint8_t win_size, int forced, gsm_cbfn *cbfn);
int abis_nm_bs11_set_ext_time(struct gsm_bts *bts);
int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport);
int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, u_int8_t bport, enum abis_bs11_line_cfg line_cfg);
int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport);
int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, uint8_t bport, enum abis_bs11_line_cfg line_cfg);
int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect);
int abis_nm_bs11_restart(struct gsm_bts *bts);
/* ip.access nanoBTS specific commands */
int abis_nm_ipaccess_msg(struct gsm_bts *bts, u_int8_t msg_type,
u_int8_t obj_class, u_int8_t bts_nr,
u_int8_t trx_nr, u_int8_t ts_nr,
u_int8_t *attr, int attr_len);
int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, u_int8_t *attr,
int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type,
uint8_t obj_class, uint8_t bts_nr,
uint8_t trx_nr, uint8_t ts_nr,
uint8_t *attr, int attr_len);
int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr,
int attr_len);
int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx);
int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, u_int8_t obj_class,
u_int8_t bts_nr, u_int8_t trx_nr, u_int8_t ts_nr,
u_int8_t *attr, u_int8_t attr_len);
int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class,
uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
uint8_t *attr, uint8_t attr_len);
int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx,
u_int32_t ip, u_int16_t port, u_int8_t stream);
void abis_nm_ipaccess_cgi(u_int8_t *buf, struct gsm_bts *bts);
int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf);
const char *ipacc_testres_name(u_int8_t res);
uint32_t ip, uint16_t port, uint8_t stream);
void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts);
int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf);
const char *ipacc_testres_name(uint8_t res);
/* Functions calling into other code parts */
const char *nm_opstate_name(u_int8_t os);
const char *nm_avail_name(u_int8_t avail);
int nm_is_running(struct gsm_nm_state *s);
int abis_nm_vty_init(void);

View File

@@ -34,6 +34,13 @@ enum abis_om2k_mo_cls {
OM2K_MO_CLS_RX = 0x0c,
};
enum om2k_mo_state {
OM2K_MO_S_RESET = 0,
OM2K_MO_S_STARTED,
OM2K_MO_S_ENABLED,
OM2K_MO_S_DISABLED,
};
struct abis_om2k_mo {
uint8_t class;
uint8_t bts;
@@ -41,12 +48,26 @@ struct abis_om2k_mo {
uint8_t inst;
} __attribute__ ((packed));
/* on-wire format for IS conn group */
struct om2k_is_conn_grp {
uint16_t icp1;
uint16_t icp2;
uint8_t cont_idx;
} __attribute__ ((packed));
/* internal data formant for IS conn group */
struct is_conn_group {
struct llist_head list;
uint16_t icp1;
uint16_t icp2;
uint8_t ci;
};
extern const struct abis_om2k_mo om2k_mo_cf;
extern const struct abis_om2k_mo om2k_mo_is;
extern const struct abis_om2k_mo om2k_mo_con;
extern const struct abis_om2k_mo om2k_mo_tf;
extern const struct value_string om2k_mo_class_short_vals[];
int abis_om2k_rcvmsg(struct msgb *msg);
@@ -63,8 +84,7 @@ int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo)
int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo,
uint8_t operational);
int abis_om2k_tx_is_conf_req(struct gsm_bts *bts, struct om2k_is_conn_grp *cg,
unsigned int num_cg);
int abis_om2k_tx_is_conf_req(struct gsm_bts *bts);
int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts);
int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx);
int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx);

View File

@@ -22,9 +22,9 @@
#ifndef _RSL_H
#define _RSL_H
#include <osmocore/protocol/gsm_08_58.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocore/msgb.h>
#include <osmocom/core/msgb.h>
struct gsm_bts;
struct gsm_lchan;
@@ -32,61 +32,56 @@ struct gsm_subscriber;
struct gsm_bts_trx_ts;
int rsl_bcch_info(struct gsm_bts_trx *trx, u_int8_t type,
const u_int8_t *data, int len);
int rsl_sacch_filling(struct gsm_bts_trx *trx, u_int8_t type,
const u_int8_t *data, int len);
int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr,
u_int8_t act_type,
int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type,
const uint8_t *data, int len);
int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
const uint8_t *data, int len);
int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr,
uint8_t act_type,
struct rsl_ie_chan_mode *chan_mode,
struct rsl_ie_chan_ident *chan_ident,
u_int8_t bs_power, u_int8_t ms_power,
u_int8_t ta);
int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type,
u_int8_t ta, u_int8_t ho_ref);
uint8_t bs_power, uint8_t ms_power,
uint8_t ta);
int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type,
uint8_t ta, uint8_t ho_ref);
int rsl_chan_mode_modify_req(struct gsm_lchan *ts);
int rsl_encryption_cmd(struct msgb *msg);
int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len,
u_int8_t *ms_ident, u_int8_t chan_needed);
int rsl_imm_assign_cmd(struct gsm_bts *bts, u_int8_t len, u_int8_t *val);
int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len,
uint8_t *ms_ident, uint8_t chan_needed);
int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val);
int rsl_data_request(struct msgb *msg, u_int8_t link_id);
int rsl_establish_request(struct gsm_lchan *lchan, u_int8_t link_id);
int rsl_relase_request(struct gsm_lchan *lchan, u_int8_t link_id);
int rsl_data_request(struct msgb *msg, uint8_t link_id);
int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id);
int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
/* Siemens vendor-specific RSL extensions */
int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
/* ip.access specfic RSL extensions */
int rsl_ipacc_crcx(struct gsm_lchan *lchan);
int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip,
u_int16_t port, u_int8_t rtp_payload2);
int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip,
uint16_t port, uint8_t rtp_payload2);
int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
int abis_rsl_rcvmsg(struct msgb *msg);
unsigned int get_paging_group(u_int64_t imsi, unsigned int bs_cc_chans,
int n_pag_blocks);
unsigned int n_pag_blocks(int bs_ccch_sdcch_comb, unsigned int bs_ag_blks_res);
u_int64_t str_to_imsi(const char *imsi_str);
u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan);
int rsl_release_request(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t reason);
uint64_t str_to_imsi(const char *imsi_str);
int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason);
int rsl_lchan_set_state(struct gsm_lchan *lchan, int);
/* to be provided by external code */
int abis_rsl_sendmsg(struct msgb *msg);
int rsl_deact_sacch(struct gsm_lchan *lchan);
int rsl_lchan_rll_release(struct gsm_lchan *lchan, u_int8_t link_id);
int rsl_lchan_rll_release(struct gsm_lchan *lchan, uint8_t link_id);
/* BCCH related code */
int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf);
int rsl_number_of_paging_subchannels(struct gsm_bts *bts);
int rsl_sacch_info_modify(struct gsm_lchan *lchan, u_int8_t type,
const u_int8_t *data, int len);
int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type,
const uint8_t *data, int len);
int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db);
int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm);

View File

@@ -22,25 +22,33 @@
#ifndef BSC_MSC_H
#define BSC_MSC_H
#include <osmocore/write_queue.h>
#include <osmocore/timer.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/timer.h>
struct bsc_msc_dest {
struct llist_head list;
char *ip;
int port;
int dscp;
};
struct bsc_msc_connection {
struct write_queue write_queue;
struct osmo_wqueue write_queue;
int is_connected;
int is_authenticated;
int first_contact;
const char *ip;
int port;
int prio;
struct llist_head *dests;
void (*connection_loss) (struct bsc_msc_connection *);
void (*connected) (struct bsc_msc_connection *);
struct timer_list reconnect_timer;
struct timer_list timeout_timer;
struct osmo_timer_list reconnect_timer;
struct osmo_timer_list timeout_timer;
};
struct bsc_msc_connection *bsc_msc_create(const char *ip, int port, int prio);
struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dest);
int bsc_msc_connect(struct bsc_msc_connection *);
void bsc_msc_schedule_connect(struct bsc_msc_connection *);

View File

@@ -1,6 +1,6 @@
/*
* (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
* (C) 2010 by On-Waves
* (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
* (C) 2010-2011 by On-Waves
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
@@ -23,22 +23,23 @@
#include "mgcp.h"
#include <sys/types.h>
#include <osmocore/select.h>
#include <osmocore/msgb.h>
#include <osmocore/msgfile.h>
#include <osmocore/timer.h>
#include <osmocore/write_queue.h>
#include <osmocore/rate_ctr.h>
#include <osmocore/statistics.h>
#include <osmocore/protocol/gsm_04_08.h>
#include <osmocom/core/select.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/msgfile.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/statistics.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <regex.h>
#define DIR_BSC 1
#define DIR_MSC 2
#define PAGIN_GROUP_UNASSIGNED -1
struct sccp_source_reference;
struct sccp_connections;
struct bsc_nat_parsed;
@@ -55,6 +56,16 @@ enum {
NAT_CON_TYPE_OTHER,
};
/*
* Is this terminated to the MSC, to the local machine (release
* handling for IMSI filtering) or to a USSD provider?
*/
enum {
NAT_CON_END_MSC,
NAT_CON_END_LOCAL,
NAT_CON_END_USSD,
};
/*
* Per BSC data structure
*/
@@ -65,17 +76,17 @@ struct bsc_connection {
int authenticated;
/* the fd we use to communicate */
struct write_queue write_queue;
struct osmo_wqueue write_queue;
/* the BSS associated */
struct bsc_config *cfg;
/* a timeout node */
struct timer_list id_timeout;
struct osmo_timer_list id_timeout;
/* pong timeout */
struct timer_list ping_timeout;
struct timer_list pong_timeout;
struct osmo_timer_list ping_timeout;
struct osmo_timer_list pong_timeout;
/* mgcp related code */
char *_endpoint_status;
@@ -125,6 +136,7 @@ struct bsc_config {
char *acc_lst_name;
int forbid_paging;
int paging_group;
/* audio handling */
int max_endpoints;
@@ -142,6 +154,14 @@ struct bsc_lac_entry {
uint16_t lac;
};
struct bsc_nat_paging_group {
struct llist_head entry;
/* list of lac entries */
struct llist_head lists;
int nr;
};
/**
* BSCs point of view of endpoints
*/
@@ -159,21 +179,21 @@ struct bsc_endpoint {
*/
struct bsc_nat_statistics {
struct {
struct counter *conn;
struct counter *calls;
struct osmo_counter *conn;
struct osmo_counter *calls;
} sccp;
struct {
struct counter *reconn;
struct counter *auth_fail;
struct osmo_counter *reconn;
struct osmo_counter *auth_fail;
} bsc;
struct {
struct counter *reconn;
struct osmo_counter *reconn;
} msc;
struct {
struct counter *reconn;
struct osmo_counter *reconn;
} ussd;
};
@@ -216,6 +236,9 @@ struct bsc_nat {
/* access lists */
struct llist_head access_lists;
/* paging groups */
struct llist_head paging_groups;
/* known BSC's */
struct llist_head bsc_configs;
int num_bsc;
@@ -227,8 +250,8 @@ struct bsc_nat {
int mgcp_length;
/* msc things */
char *msc_ip;
int msc_port;
struct llist_head dests;
struct bsc_msc_dest *main_dest;
struct bsc_msc_connection *msc_con;
char *token;
@@ -244,20 +267,37 @@ struct bsc_nat {
/* number rewriting */
char *num_rewr_name;
struct msg_entries *num_rewr;
struct llist_head num_rewr;
char *smsc_rewr_name;
struct llist_head smsc_rewr;
char *tpdest_match_name;
struct llist_head tpdest_match;
/* USSD messages we want to match */
char *ussd_lst_name;
char *ussd_query;
regex_t ussd_query_re;
char *ussd_token;
char *ussd_local;
struct bsc_fd ussd_listen;
struct osmo_fd ussd_listen;
struct bsc_nat_ussd_con *ussd_con;
/* for maintainenance */
int blocked;
/* statistics */
struct bsc_nat_statistics stats;
};
struct bsc_nat_ussd_con {
struct osmo_wqueue queue;
struct bsc_nat *nat;
int authorized;
struct osmo_timer_list auth_timeout;
};
/* create and init the structures */
struct bsc_config *bsc_config_alloc(struct bsc_nat *nat, const char *token);
struct bsc_config *bsc_config_num(struct bsc_nat *nat, int num);
@@ -285,7 +325,7 @@ struct bsc_nat_parsed *bsc_nat_parse(struct msgb *msg);
*/
int bsc_nat_filter_ipa(int direction, struct msgb *msg, struct bsc_nat_parsed *parsed);
int bsc_nat_vty_init(struct bsc_nat *nat);
struct bsc_connection *bsc_nat_find_bsc(struct bsc_nat *nat, struct msgb *msg, int *_lac);
int bsc_nat_find_paging(struct msgb *msg, const uint8_t **,int *len);
/**
* Content filtering.
@@ -326,12 +366,12 @@ uint32_t bsc_mgcp_extract_ci(const char *resp);
int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int id);
int bsc_do_write(struct write_queue *queue, struct msgb *msg, int id);
int bsc_write_msg(struct write_queue *queue, struct msgb *msg);
int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg);
int bsc_do_write(struct osmo_wqueue *queue, struct msgb *msg, int id);
int bsc_write_msg(struct osmo_wqueue *queue, struct msgb *msg);
int bsc_write_cb(struct osmo_fd *bfd, struct msgb *msg);
/* IMSI allow/deny handling */
void bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv);
int bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv) __attribute__ ((warn_unused_result));
struct bsc_nat_acc_lst *bsc_nat_acc_lst_find(struct bsc_nat *nat, const char *name);
struct bsc_nat_acc_lst *bsc_nat_acc_lst_get(struct bsc_nat *nat, const char *name);
void bsc_nat_acc_lst_delete(struct bsc_nat_acc_lst *lst);
@@ -350,6 +390,27 @@ int bsc_ussd_init(struct bsc_nat *nat);
int bsc_check_ussd(struct sccp_connections *con, struct bsc_nat_parsed *parsed, struct msgb *msg);
int bsc_close_ussd_connections(struct bsc_nat *nat);
struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct bsc_nat_parsed *, const char *imsi);
struct msgb *bsc_nat_rewrite_msg(struct bsc_nat *nat, struct msgb *msg, struct bsc_nat_parsed *, const char *imsi);
/** paging group handling */
struct bsc_nat_paging_group *bsc_nat_paging_group_num(struct bsc_nat *nat, int group);
struct bsc_nat_paging_group *bsc_nat_paging_group_create(struct bsc_nat *nat, int group);
void bsc_nat_paging_group_delete(struct bsc_nat_paging_group *);
void bsc_nat_paging_group_add_lac(struct bsc_nat_paging_group *grp, int lac);
void bsc_nat_paging_group_del_lac(struct bsc_nat_paging_group *grp, int lac);
/**
* Number rewriting support below
*/
struct bsc_nat_num_rewr_entry {
struct llist_head list;
regex_t msisdn_reg;
regex_t num_reg;
char *replace;
};
void bsc_nat_num_rewr_entry_adapt(void *ctx, struct llist_head *head, const struct osmo_config_list *);
#endif

View File

@@ -22,7 +22,6 @@
#ifndef BSC_NAT_SCCP_H
#define BSC_NAT_SCCP_H
#include <sys/types.h>
#include <osmocom/sccp/sccp_types.h>
/*
@@ -77,9 +76,13 @@ struct sccp_connections {
/* status */
int con_type;
int con_local;
int authorized;
int imsi_checked;
char *imsi;
/* remember which Transactions we run over the bypass */
char ussd_ti[8];
/*
* audio handling. Remember if we have ever send a CRCX,
* remember the endpoint used by the MSC and BSC.

View File

@@ -10,10 +10,10 @@ enum bsc_rllr_ind {
BSC_RLLR_IND_TIMEOUT,
};
int rll_establish(struct gsm_lchan *lchan, u_int8_t link_id,
void (*cb)(struct gsm_lchan *, u_int8_t, void *,
int rll_establish(struct gsm_lchan *lchan, uint8_t link_id,
void (*cb)(struct gsm_lchan *, uint8_t, void *,
enum bsc_rllr_ind),
void *data);
void rll_indication(struct gsm_lchan *lchan, u_int8_t link_id, u_int8_t type);
void rll_indication(struct gsm_lchan *lchan, uint8_t link_id, uint8_t type);
#endif /* _BSC_RLL_H */

17
include/openbsc/bss.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef _BSS_H_
#define _BSS_H_
struct gsm_network;
struct msgb;
/* start and stop network */
extern int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), const char *cfg_file);
extern int bsc_shutdown_net(struct gsm_network *net);
/* register all supported BTS */
extern int bts_init(void);
extern int bts_model_bs11_init(void);
extern int bts_model_rbs2k_init(void);
extern int bts_model_nanobts_init(void);
extern int bts_model_hslfemto_init(void);
#endif

View File

@@ -1,8 +1,10 @@
#ifndef _CRC24_H
#define _CRC24_H
#include <stdint.h>
#define INIT_CRC24 0xffffff
u_int32_t crc24_calc(u_int32_t fcs, u_int8_t *cp, unsigned int len);
uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len);
#endif

View File

@@ -20,7 +20,7 @@
#ifndef _DB_H
#define _DB_H
#include <sys/types.h>
#include "gsm_subscriber.h"
struct gsm_equipment;
struct gsm_network;
@@ -29,8 +29,6 @@ struct gsm_auth_tuple;
struct gsm_sms;
struct gsm_subscriber;
enum gsm_subscriber_field;
/* one time initialisation */
int db_init(const char *name);
int db_prepare();
@@ -45,7 +43,7 @@ struct gsm_subscriber *db_get_subscriber(struct gsm_network *net,
int db_sync_subscriber(struct gsm_subscriber *subscriber);
int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber);
int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber);
int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, u_int32_t* token);
int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token);
int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei);
int db_sync_equipment(struct gsm_equipment *equip);
int db_subscriber_update(struct gsm_subscriber *subscriber);
@@ -71,12 +69,12 @@ int db_sms_inc_deliver_attempts(struct gsm_sms *sms);
/* APDU blob storage */
int db_apdu_blob_store(struct gsm_subscriber *subscr,
u_int8_t apdu_id_flags, u_int8_t len,
u_int8_t *apdu);
uint8_t apdu_id_flags, uint8_t len,
uint8_t *apdu);
/* Statistics counter storage */
struct counter;
int db_store_counter(struct counter *ctr);
struct osmo_counter;
int db_store_counter(struct osmo_counter *ctr);
struct rate_ctr_group;
int db_store_rate_ctr_group(struct rate_ctr_group *ctrg);

View File

@@ -2,10 +2,10 @@
#define _DEBUG_H
#include <stdio.h>
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
#define DEBUG
#include <osmocore/logging.h>
#include <osmocom/core/logging.h>
/* Debug Areas of the code */
enum {

View File

@@ -4,10 +4,10 @@
#include <stdlib.h>
#include <netinet/in.h>
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
#include <openbsc/gsm_data.h>
#include <osmocore/msgb.h>
#include <osmocore/select.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/select.h>
#include <openbsc/subchan_demux.h>
#define NUM_E1_TS 32
@@ -37,12 +37,12 @@ struct e1inp_sign_link {
struct llist_head tx_list;
/* SAPI and TEI on the E1 TS */
u_int8_t sapi;
u_int8_t tei;
uint8_t sapi;
uint8_t tei;
union {
struct {
u_int8_t channel;
uint8_t channel;
} misdn;
} driver;
};
@@ -69,7 +69,7 @@ struct e1inp_ts {
/* delay for the queue */
int delay;
/* timer when to dequeue next frame */
struct timer_list tx_timer;
struct osmo_timer_list tx_timer;
} sign;
struct {
/* subchannel demuxer for frames from E1 */
@@ -81,15 +81,15 @@ struct e1inp_ts {
union {
struct {
/* mISDN driver has one fd for each ts */
struct bsc_fd fd;
struct osmo_fd fd;
} misdn;
struct {
/* ip.access driver has one fd for each ts */
struct bsc_fd fd;
struct osmo_fd fd;
} ipaccess;
struct {
/* DAHDI driver has one fd for each ts */
struct bsc_fd fd;
struct osmo_fd fd;
struct lapd_instance *lapd;
} dahdi;
} driver;
@@ -125,21 +125,21 @@ struct e1inp_driver *e1inp_driver_find(const char *name);
int e1inp_line_register(struct e1inp_line *line);
/* get a line by its ID */
struct e1inp_line *e1inp_line_get(u_int8_t e1_nr);
struct e1inp_line *e1inp_line_get(uint8_t e1_nr);
/* create a line in the E1 input core */
struct e1inp_line *e1inp_line_create(u_int8_t e1_nr, const char *driver_name);
struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name);
/* find a sign_link for given TEI and SAPI in a TS */
struct e1inp_sign_link *
e1inp_lookup_sign_link(struct e1inp_ts *ts, u_int8_t tei,
u_int8_t sapi);
e1inp_lookup_sign_link(struct e1inp_ts *ts, uint8_t tei,
uint8_t sapi);
/* create a new signalling link in a E1 timeslot */
struct e1inp_sign_link *
e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
struct gsm_bts_trx *trx, u_int8_t tei,
u_int8_t sapi);
struct gsm_bts_trx *trx, uint8_t tei,
uint8_t sapi);
/* configure and initialize one e1inp_ts */
int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line,
@@ -150,20 +150,20 @@ int e1inp_update_ts(struct e1inp_ts *ts);
/* Receive a packet from the E1 driver */
int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg,
u_int8_t tei, u_int8_t sapi);
uint8_t tei, uint8_t sapi);
/* called by driver if it wants to transmit on a given TS */
struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts,
struct e1inp_sign_link **sign_link);
/* called by driver in case some kind of link state event */
int e1inp_event(struct e1inp_ts *ts, int evt, u_int8_t tei, u_int8_t sapi);
int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi);
/* Write LAPD frames to the fd. */
void e1_set_pcap_fd(int fd);
/* called by TRAU muxer to obtain the destination mux entity */
struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr);
struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr);
void e1inp_sign_link_destroy(struct e1inp_sign_link *link);
int e1inp_line_update(struct e1inp_line *line);
@@ -175,6 +175,7 @@ int e1_reconfig_bts(struct gsm_bts *bts);
int ia_config_connect(struct gsm_bts *bts, struct sockaddr_in *sin);
int ipaccess_setup(struct gsm_network *gsmnet);
int hsl_setup(struct gsm_network *gsmnet);
extern struct llist_head e1inp_driver_list;
extern struct llist_head e1inp_line_list;

View File

@@ -1,16 +1,15 @@
#ifndef _GB_PROXY_H
#define _GB_PROXY_H
#include <sys/types.h>
#include <osmocore/msgb.h>
#include <osmocom/core/msgb.h>
#include <openbsc/gprs_ns.h>
#include <osmocom/vty/command.h>
struct gbproxy_config {
/* parsed from config file */
u_int16_t nsip_sgsn_nsei;
uint16_t nsip_sgsn_nsei;
/* misc */
struct gprs_ns_inst *nsi;

View File

@@ -182,7 +182,7 @@ struct bssgp_bvc_ctx *btsctx_by_raid_cid(const struct gprs_ra_id *raid, uint16_t
/* Find a BTS context based on BVCI+NSEI tuple */
struct bssgp_bvc_ctx *btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei);
#include <osmocore/tlv.h>
#include <osmocom/gsm/tlv.h>
/* BSSGP-UL-UNITDATA.ind */
int gprs_bssgp_rcvmsg(struct msgb *msg);

View File

@@ -1,7 +1,7 @@
#ifndef _GPRS_GMM_H
#define _GPRS_GMM_H
#include <osmocore/msgb.h>
#include <osmocom/core/msgb.h>
#include <openbsc/gprs_sgsn.h>
int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause);

View File

@@ -99,8 +99,8 @@ struct gprs_llc_lle {
enum gprs_llc_lle_state state;
struct timer_list t200;
struct timer_list t201; /* wait for acknowledgement */
struct osmo_timer_list t200;
struct osmo_timer_list t201; /* wait for acknowledgement */
uint16_t v_sent;
uint16_t v_ack;

View File

@@ -77,10 +77,10 @@ enum ns_cause {
/* Our Implementation */
#include <netinet/in.h>
#include <osmocore/linuxlist.h>
#include <osmocore/msgb.h>
#include <osmocore/timer.h>
#include <osmocore/select.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
#define NS_TIMERS_COUNT 7
#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries)"
@@ -133,13 +133,13 @@ struct gprs_ns_inst {
/* NS-over-IP specific bits */
struct {
struct bsc_fd fd;
struct osmo_fd fd;
uint32_t local_ip;
uint16_t local_port;
} nsip;
/* NS-over-FR-over-GRE-over-IP specific bits */
struct {
struct bsc_fd fd;
struct osmo_fd fd;
uint32_t local_ip;
int enabled:1;
} frgre;
@@ -163,7 +163,7 @@ struct gprs_nsvc {
uint32_t state;
uint32_t remote_state;
struct timer_list timer;
struct osmo_timer_list timer;
enum nsvc_timer_mode timer_mode;
int alive_retries;

View File

@@ -4,7 +4,7 @@
#include <stdint.h>
#include <netinet/in.h>
#include <osmocore/gsm48.h>
#include <osmocom/gsm/gsm48.h>
#include <osmocom/crypt/gprs_cipher.h>
@@ -102,7 +102,7 @@ struct sgsn_mm_ctx {
uint16_t nsei;
uint16_t bvci;
struct rate_ctr_group *ctrg;
struct timer_list timer;
struct osmo_timer_list timer;
unsigned int T; /* Txxxx number */
unsigned int num_T_exp; /* number of consecutive T expirations */
@@ -168,7 +168,7 @@ struct sgsn_pdp_ctx {
//uint32_t charging_id;
int reordering_reqd;
struct timer_list timer;
struct osmo_timer_list timer;
unsigned int T; /* Txxxx number */
unsigned int num_T_exp; /* number of consecutive T expirations */
};

View File

@@ -3,8 +3,8 @@
#include <openbsc/meas_rep.h>
#include <osmocore/protocol/gsm_04_08.h>
#include <osmocore/gsm48.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/gsm48.h>
struct msgb;
struct gsm_bts;
@@ -28,37 +28,37 @@ void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t caus
void gsm0408_clear_all_trans(struct gsm_network *net, int protocol);
int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg);
int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id);
int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id);
int gsm0408_new_conn(struct gsm_subscriber_connection *conn);
enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, u_int8_t ra);
enum gsm_chreq_reason_t get_reason_by_chreq(u_int8_t ra, int neci);
enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, uint8_t ra);
enum gsm_chreq_reason_t get_reason_by_chreq(uint8_t ra, int neci);
void gsm_net_update_ctype(struct gsm_network *net);
int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn);
int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, u_int8_t *rand, int key_seq);
int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand, int key_seq);
int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn);
int gsm48_send_rr_release(struct gsm_lchan *lchan);
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, u_int8_t apdu_id,
u_int8_t apdu_len, const u_int8_t *apdu);
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, u_int8_t power_class);
int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
uint8_t apdu_len, const uint8_t *apdu);
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_class);
int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
u_int8_t power_command, u_int8_t ho_ref);
uint8_t power_command, uint8_t ho_ref);
int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg);
/* convert a ASCII phone number to call-control BCD */
int encode_bcd_number(u_int8_t *bcd_lv, u_int8_t max_len,
int encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len,
int h_len, const char *input);
int decode_bcd_number(char *output, int output_len, const u_int8_t *bcd_lv,
int decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv,
int h_len);
int send_siemens_mrpci(struct gsm_lchan *lchan, u_int8_t *classmark2_lv);
int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv);
int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type);
int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, u_int8_t *mi_type);
int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type);
int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, struct msgb *msg, struct gsm_subscriber *subscr);
int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode);
int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode);
int gsm48_rx_rr_modif_ack(struct msgb *msg);
int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg);

View File

@@ -2,7 +2,7 @@
#define _GSM48_GPRS_H
#include <stdint.h>
#include <osmocore/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
/* Table 10.4 / 10.4a, GPRS Mobility Management (GMM) */
#define GSM48_MT_GMM_ATTACH_REQ 0x01

View File

@@ -1,26 +1,26 @@
#ifndef _GSM_04_11_H
#define _GSM_04_11_H
#include <osmocore/protocol/gsm_04_11.h>
#include <osmocom/gsm/protocol/gsm_04_11.h>
#define UM_SAPI_SMS 3 /* See GSM 04.05/04.06 */
/* SMS deliver PDU */
struct sms_deliver {
u_int8_t mti:2; /* message type indicator */
u_int8_t mms:1; /* more messages to send */
u_int8_t rp:1; /* reply path */
u_int8_t udhi:1; /* user data header indicator */
u_int8_t sri:1; /* status report indication */
u_int8_t *orig_addr; /* originating address */
u_int8_t pid; /* protocol identifier */
u_int8_t dcs; /* data coding scheme */
uint8_t mti:2; /* message type indicator */
uint8_t mms:1; /* more messages to send */
uint8_t rp:1; /* reply path */
uint8_t udhi:1; /* user data header indicator */
uint8_t sri:1; /* status report indication */
uint8_t *orig_addr; /* originating address */
uint8_t pid; /* protocol identifier */
uint8_t dcs; /* data coding scheme */
/* service centre time stamp */
u_int8_t ud_len; /* user data length */
u_int8_t *user_data; /* user data */
uint8_t ud_len; /* user data length */
uint8_t *user_data; /* user data */
u_int8_t msg_ref; /* message reference */
u_int8_t *smsc;
uint8_t msg_ref; /* message reference */
uint8_t *smsc;
};
struct msgb;

View File

@@ -1,9 +1,9 @@
#ifndef _GSM_04_80_H
#define _GSM_04_80_H
#include <osmocore/msgb.h>
#include <osmocore/protocol/gsm_04_80.h>
#include <osmocore/gsm0480.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/protocol/gsm_04_80.h>
#include <osmocom/gsm/gsm0480.h>
struct gsm_subscriber_connection;

View File

@@ -1,97 +1,12 @@
#ifndef _GSM_DATA_H
#define _GSM_DATA_H
#include <sys/types.h>
#include <stdint.h>
struct osmo_msc_data;
struct osmo_bsc_sccp_con;
struct gsm_sms_queue;
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
enum gsm_phys_chan_config {
GSM_PCHAN_NONE,
GSM_PCHAN_CCCH,
GSM_PCHAN_CCCH_SDCCH4,
GSM_PCHAN_TCH_F,
GSM_PCHAN_TCH_H,
GSM_PCHAN_SDCCH8_SACCH8C,
GSM_PCHAN_PDCH, /* GPRS PDCH */
GSM_PCHAN_TCH_F_PDCH, /* TCH/F if used, PDCH otherwise */
GSM_PCHAN_UNKNOWN,
};
enum gsm_chan_t {
GSM_LCHAN_NONE,
GSM_LCHAN_SDCCH,
GSM_LCHAN_TCH_F,
GSM_LCHAN_TCH_H,
GSM_LCHAN_UNKNOWN,
};
/* RRLP mode of operation */
enum rrlp_mode {
RRLP_MODE_NONE,
RRLP_MODE_MS_BASED,
RRLP_MODE_MS_PREF,
RRLP_MODE_ASS_PREF,
};
/* Channel Request reason */
enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_EMERG,
GSM_CHREQ_REASON_PAG,
GSM_CHREQ_REASON_CALL,
GSM_CHREQ_REASON_LOCATION_UPD,
GSM_CHREQ_REASON_OTHER,
};
#include <osmocore/timer.h>
#include <openbsc/system_information.h>
#include <openbsc/rest_octets.h>
#include <openbsc/mncc.h>
#include <osmocore/tlv.h>
#include <osmocore/bitvec.h>
#include <osmocore/statistics.h>
#include <osmocore/gsm_utils.h>
#include <osmocore/utils.h>
#include <osmocore/rxlev_stat.h>
#include <osmocore/protocol/gsm_08_58.h>
#define TRX_NR_TS 8
#define TS_MAX_LCHAN 8
#define HARDCODED_ARFCN 123
#define HARDCODED_TSC 7
#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
/* for multi-drop config */
#define HARDCODED_BTS0_TS 1
#define HARDCODED_BTS1_TS 6
#define HARDCODED_BTS2_TS 11
/* reserved according to GSM 03.03 § 2.4 */
#define GSM_RESERVED_TMSI 0xFFFFFFFF
enum gsm_hooks {
GSM_HOOK_NM_SWLOAD,
GSM_HOOK_RR_PAGING,
GSM_HOOK_RR_SECURITY,
};
enum gsm_paging_event {
GSM_PAGING_SUCCEEDED,
GSM_PAGING_EXPIRED,
GSM_PAGING_OOM,
GSM_PAGING_BUSY,
};
enum bts_gprs_mode {
BTS_GPRS_NONE = 0,
BTS_GPRS_GPRS = 1,
BTS_GPRS_EGPRS = 2,
};
#define OBSC_NM_W_ACK_CB(__msgb) (__msgb)->cb[3]
@@ -104,11 +19,11 @@ struct openbsc_msgb_cb {
unsigned char *bssgp_cell_id;
/* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */
u_int16_t nsei;
u_int16_t bvci;
uint16_t nsei;
uint16_t bvci;
/* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
u_int32_t tlli;
uint32_t tlli;
} __attribute__((packed));
#define OBSC_MSGB_CB(__msgb) ((struct openbsc_msgb_cb *)&((__msgb)->cb[0]))
#define msgb_tlli(__x) OBSC_MSGB_CB(__x)->tlli
@@ -144,32 +59,18 @@ enum gsm_auth_algo {
struct gsm_auth_info {
enum gsm_auth_algo auth_algo;
unsigned int a3a8_ki_len;
u_int8_t a3a8_ki[16];
uint8_t a3a8_ki[16];
};
struct gsm_auth_tuple {
int use_count;
int key_seq;
u_int8_t rand[16];
u_int8_t sres[4];
u_int8_t kc[8];
uint8_t rand[16];
uint8_t sres[4];
uint8_t kc[8];
};
#define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */
struct gsm_lchan;
struct gsm_subscriber;
struct gsm_mncc;
struct rtp_socket;
struct bsc_api;
/* Network Management State */
struct gsm_nm_state {
u_int8_t operational;
u_int8_t administrative;
u_int8_t availability;
};
/*
* LOCATION UPDATING REQUEST state
*
@@ -178,7 +79,7 @@ struct gsm_nm_state {
* - Accept/Reject according to global policy
*/
struct gsm_loc_updating_operation {
struct timer_list updating_timer;
struct osmo_timer_list updating_timer;
unsigned int waiting_for_imsi : 1;
unsigned int waiting_for_imei : 1;
unsigned int key_seq : 4;
@@ -198,7 +99,7 @@ struct gsm_security_operation {
* a couple of seconds to work around MSC issues.
*/
struct gsm_anchor_operation {
struct timer_list timeout;
struct osmo_timer_list timeout;
};
/* Maximum number of neighbor cells whose average we track */
@@ -208,32 +109,11 @@ struct gsm_anchor_operation {
/* processed neighbor measurements for one cell */
struct neigh_meas_proc {
u_int16_t arfcn;
u_int8_t bsic;
u_int8_t rxlev[MAX_WIN_NEIGH_AVG];
uint16_t arfcn;
uint8_t bsic;
uint8_t rxlev[MAX_WIN_NEIGH_AVG];
unsigned int rxlev_cnt;
u_int8_t last_seen_nr;
};
#define MAX_A5_KEY_LEN (128/8)
#define A38_XOR_MIN_KEY_LEN 12
#define A38_XOR_MAX_KEY_LEN 16
#define A38_COMP128_KEY_LEN 16
#define RSL_ENC_ALG_A5(x) (x+1)
/* is the data link established? who established it? */
#define LCHAN_SAPI_UNUSED 0
#define LCHAN_SAPI_MS 1
#define LCHAN_SAPI_NET 2
/* state of a logical channel */
enum gsm_lchan_state {
LCHAN_S_NONE, /* channel is not active */
LCHAN_S_ACT_REQ, /* channel activatin requested */
LCHAN_S_ACTIVE, /* channel is active and operational */
LCHAN_S_REL_REQ, /* channel release has been requested */
LCHAN_S_REL_ERR, /* channel is in an error state */
LCHAN_S_INACTIVE, /* channel is set inactive */
uint8_t last_seen_nr;
};
/* the per subscriber data for lchan */
@@ -264,427 +144,65 @@ struct gsm_subscriber_connection {
struct gsm_bts *bts;
/* for assignment handling */
struct timer_list T10;
struct osmo_timer_list T10;
struct gsm_lchan *secondary_lchan;
};
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
/* The logical subslot number in the TS */
u_int8_t nr;
/* The logical channel type */
enum gsm_chan_t type;
/* RSL channel mode */
enum rsl_cmod_spd rsl_cmode;
/* If TCH, traffic channel mode */
enum gsm48_chan_mode tch_mode;
/* State */
enum gsm_lchan_state state;
/* Power levels for MS and BTS */
u_int8_t bs_power;
u_int8_t ms_power;
/* Encryption information */
struct {
u_int8_t alg_id;
u_int8_t key_len;
u_int8_t key[MAX_A5_KEY_LEN];
} encr;
struct timer_list T3101;
struct timer_list T3111;
struct timer_list error_timer;
#define ROLE_BSC
#include "gsm_data_shared.h"
/* AMR bits */
struct gsm48_multi_rate_conf mr_conf;
/* Established data link layer services */
u_int8_t sapis[8];
int sach_deact;
int release_reason;
/* GSM Random Access data */
struct gsm48_req_ref *rqd_ref;
uint8_t rqd_ta;
/* cache of last measurement reports on this lchan */
struct gsm_meas_rep meas_rep[6];
int meas_rep_idx;
/* table of neighbor cell measurements */
struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
struct {
u_int32_t bound_ip;
u_int32_t connect_ip;
u_int16_t bound_port;
u_int16_t connect_port;
u_int16_t conn_id;
u_int8_t rtp_payload;
u_int8_t rtp_payload2;
u_int8_t speech_mode;
struct rtp_socket *rtp_socket;
} abis_ip;
struct gsm_subscriber_connection *conn;
};
struct gsm_e1_subslot {
/* Number of E1 link */
u_int8_t e1_nr;
/* Number of E1 TS inside E1 link */
u_int8_t e1_ts;
/* Sub-slot within the E1 TS, 0xff if full TS */
u_int8_t e1_ts_ss;
};
#define TS_F_PDCH_MODE 0x1000
/* One Timeslot in a TRX */
struct gsm_bts_trx_ts {
struct gsm_bts_trx *trx;
/* number of this timeslot at the TRX */
u_int8_t nr;
enum gsm_phys_chan_config pchan;
unsigned int flags;
struct gsm_nm_state nm_state;
struct tlv_parsed nm_attr;
u_int8_t nm_chan_comb;
struct {
/* Parameters below are configured by VTY */
int enabled;
u_int8_t maio;
u_int8_t hsn;
struct bitvec arfcns;
u_int8_t arfcns_data[1024/8];
/* This is the pre-computed MA for channel assignments */
struct bitvec ma;
u_int8_t ma_len; /* part of ma_data that is used */
u_int8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
} hopping;
/* To which E1 subslot are we connected */
struct gsm_e1_subslot e1_link;
struct gsm_lchan lchan[TS_MAX_LCHAN];
};
/* One TRX in a BTS */
struct gsm_bts_trx {
/* list header in bts->trx_list */
struct llist_head list;
struct gsm_bts *bts;
/* number of this TRX in the BTS */
u_int8_t nr;
/* human readable name / description */
char *description;
/* how do we talk RSL with this TRX? */
struct gsm_e1_subslot rsl_e1_link;
u_int8_t rsl_tei;
struct e1inp_sign_link *rsl_link;
/* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
struct e1inp_sign_link *oml_link;
struct gsm_nm_state nm_state;
struct tlv_parsed nm_attr;
struct {
struct gsm_nm_state nm_state;
} bb_transc;
u_int16_t arfcn;
int nominal_power; /* in dBm */
unsigned int max_power_red; /* in actual dB */
union {
struct {
struct {
struct gsm_nm_state nm_state;
} bbsig;
struct {
struct gsm_nm_state nm_state;
} pa;
} bs11;
struct {
unsigned int test_state;
u_int8_t test_nr;
struct rxlev_stats rxlev_stat;
} ipaccess;
};
struct gsm_bts_trx_ts ts[TRX_NR_TS];
};
#define GSM_BTS_SI(bts, i) (void *)(bts->si_buf[i])
enum gsm_bts_type {
GSM_BTS_TYPE_UNKNOWN,
GSM_BTS_TYPE_BS11,
GSM_BTS_TYPE_NANOBTS,
GSM_BTS_TYPE_RBS2000,
GSM_BTS_TYPE_HSL_FEMTO,
};
struct vty;
struct gsm_bts_model {
struct llist_head list;
enum gsm_bts_type type;
const char *name;
int (*oml_rcvmsg)(struct msgb *msg);
void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts);
void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx);
void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts);
struct tlv_definition nm_att_tlvdef;
struct bitvec features;
uint8_t _features_data[128/8];
};
enum gsm_bts_features {
BTS_FEAT_HSCSD,
BTS_FEAT_GPRS,
BTS_FEAT_EGPRS,
BTS_FEAT_ECSD,
BTS_FEAT_HOPPING,
};
/*
* This keeps track of the paging status of one BTS. It
* includes a number of pending requests, a back pointer
* to the gsm_bts, a timer and some more state.
*/
struct gsm_bts_paging_state {
/* pending requests */
struct llist_head pending_requests;
struct gsm_bts *bts;
struct timer_list work_timer;
struct timer_list credit_timer;
/* free chans needed */
int free_chans_need;
/* load */
u_int16_t available_slots;
};
struct gsm_envabtse {
struct gsm_nm_state nm_state;
};
struct gsm_bts_gprs_nsvc {
struct gsm_bts *bts;
/* data read via VTY config file, to configure the BTS
* via OML from BSC */
int id;
u_int16_t nsvci;
u_int16_t local_port; /* on the BTS */
u_int16_t remote_port; /* on the SGSN */
u_int32_t remote_ip; /* on the SGSN */
struct gsm_nm_state nm_state;
};
enum neigh_list_manual_mode {
NL_MODE_AUTOMATIC = 0,
NL_MODE_MANUAL = 1,
NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */
};
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
struct llist_head list;
struct gsm_network *network;
/* number of ths BTS in network */
u_int8_t nr;
/* human readable name / description */
char *description;
/* Cell Identity */
u_int16_t cell_identity;
/* location area code of this BTS */
u_int16_t location_area_code;
/* Training Sequence Code */
u_int8_t tsc;
/* Base Station Identification Code (BSIC) */
u_int8_t bsic;
/* type of BTS */
enum gsm_bts_type type;
struct gsm_bts_model *model;
enum gsm_band band;
/* should the channel allocator allocate channels from high TRX to TRX0,
* rather than starting from TRX0 and go upwards? */
int chan_alloc_reverse;
/* maximum Tx power that the MS is permitted to use in this cell */
int ms_max_power;
/* how do we talk OML with this TRX? */
struct gsm_e1_subslot oml_e1_link;
u_int8_t oml_tei;
struct e1inp_sign_link *oml_link;
/* Abis network management O&M handle */
struct abis_nm_h *nmh;
struct gsm_nm_state nm_state;
struct tlv_parsed nm_attr;
/* number of this BTS on given E1 link */
u_int8_t bts_nr;
/* paging state and control */
struct gsm_bts_paging_state paging;
/* CCCH is on C0 */
struct gsm_bts_trx *c0;
struct {
struct gsm_nm_state nm_state;
} site_mgr;
enum neigh_list_manual_mode neigh_list_manual_mode;
/* parameters from which we build SYSTEM INFORMATION */
struct {
struct gsm48_rach_control rach_control;
u_int8_t ncc_permitted;
struct gsm48_cell_sel_par cell_sel_par;
struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */
struct gsm48_cell_options cell_options;
struct gsm48_control_channel_descr chan_desc;
struct bitvec neigh_list;
struct bitvec cell_alloc;
struct bitvec si5_neigh_list;
struct {
/* bitmask large enough for all possible ARFCN's */
u_int8_t neigh_list[1024/8];
u_int8_t cell_alloc[1024/8];
/* If the user wants a different neighbor list in SI5 than in SI2 */
u_int8_t si5_neigh_list[1024/8];
} data;
} si_common;
/* do we use static (user-defined) system information messages? (bitmask) */
uint32_t si_mode_static;
/* bitmask of all SI that are present/valid in si_buf */
uint32_t si_valid;
/* buffers where we put the pre-computed SI */
sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE];
/* ip.accesss Unit ID's have Site/BTS/TRX layout */
union {
struct {
u_int16_t site_id;
u_int16_t bts_id;
u_int32_t flags;
} ip_access;
struct {
struct {
struct gsm_nm_state nm_state;
} cclk;
struct {
struct gsm_nm_state nm_state;
} rack;
struct gsm_envabtse envabtse[4];
} bs11;
struct {
struct {
struct llist_head conn_groups;
} is;
struct {
struct llist_head conn_groups;
} con;
} rbs2000;
struct {
unsigned long serno;
} hsl;
};
/* Not entirely sure how ip.access specific this is */
struct {
enum bts_gprs_mode mode;
struct {
struct gsm_nm_state nm_state;
u_int16_t nsei;
uint8_t timer[7];
} nse;
struct {
struct gsm_nm_state nm_state;
u_int16_t bvci;
uint8_t timer[11];
} cell;
struct gsm_bts_gprs_nsvc nsvc[2];
u_int8_t rac;
} gprs;
/* RACH NM values */
int rach_b_thresh;
int rach_ldavg_slots;
/* transceivers */
int num_trx;
struct llist_head trx_list;
/* Abis NM queue */
struct llist_head abis_queue;
int abis_nm_pend;
};
/* Some statistics of our network */
struct gsmnet_stats {
struct {
struct counter *total;
struct counter *no_channel;
struct osmo_counter *total;
struct osmo_counter *no_channel;
} chreq;
struct {
struct counter *attempted;
struct counter *no_channel; /* no channel available */
struct counter *timeout; /* T3103 timeout */
struct counter *completed; /* HO COMPL received */
struct counter *failed; /* HO FAIL received */
struct osmo_counter *attempted;
struct osmo_counter *no_channel; /* no channel available */
struct osmo_counter *timeout; /* T3103 timeout */
struct osmo_counter *completed; /* HO COMPL received */
struct osmo_counter *failed; /* HO FAIL received */
} handover;
struct {
struct counter *attach;
struct counter *normal;
struct counter *periodic;
struct counter *detach;
struct osmo_counter *attach;
struct osmo_counter *normal;
struct osmo_counter *periodic;
struct osmo_counter *detach;
} loc_upd_type;
struct {
struct counter *reject;
struct counter *accept;
struct osmo_counter *reject;
struct osmo_counter *accept;
} loc_upd_resp;
struct {
struct counter *attempted;
struct counter *detached;
struct counter *completed;
struct counter *expired;
struct osmo_counter *attempted;
struct osmo_counter *detached;
struct osmo_counter *completed;
struct osmo_counter *expired;
} paging;
struct {
struct counter *submitted; /* MO SMS submissions */
struct counter *no_receiver;
struct counter *delivered; /* MT SMS deliveries */
struct counter *rp_err_mem;
struct counter *rp_err_other;
struct osmo_counter *submitted; /* MO SMS submissions */
struct osmo_counter *no_receiver;
struct osmo_counter *delivered; /* MT SMS deliveries */
struct osmo_counter *rp_err_mem;
struct osmo_counter *rp_err_other;
} sms;
struct {
struct counter *mo_setup;
struct counter *mo_connect_ack;
struct counter *mt_setup;
struct counter *mt_connect;
struct osmo_counter *mo_setup;
struct osmo_counter *mo_connect_ack;
struct osmo_counter *mt_setup;
struct osmo_counter *mt_connect;
} call;
struct {
struct counter *rf_fail;
struct counter *rll_err;
struct osmo_counter *rf_fail;
struct osmo_counter *rll_err;
} chan;
struct {
struct counter *oml_fail;
struct counter *rsl_fail;
struct osmo_counter *oml_fail;
struct osmo_counter *rsl_fail;
} bts;
};
@@ -699,8 +217,8 @@ enum gsm_auth_policy {
struct gsm_network {
/* global parameters */
u_int16_t country_code;
u_int16_t network_code;
uint16_t country_code;
uint16_t network_code;
char *name_long;
char *name_short;
enum gsm_auth_policy auth_policy;
@@ -780,50 +298,32 @@ struct gsm_sms {
struct gsm_subscriber *receiver;
unsigned long validity_minutes;
u_int8_t reply_path_req;
u_int8_t status_rep_req;
u_int8_t ud_hdr_ind;
u_int8_t protocol_id;
u_int8_t data_coding_scheme;
u_int8_t msg_ref;
uint8_t reply_path_req;
uint8_t status_rep_req;
uint8_t ud_hdr_ind;
uint8_t protocol_id;
uint8_t data_coding_scheme;
uint8_t msg_ref;
char dest_addr[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes
* BCD == 20 bytes string */
u_int8_t user_data_len;
u_int8_t user_data[SMS_TEXT_SIZE];
uint8_t user_data_len;
uint8_t user_data[SMS_TEXT_SIZE];
char text[SMS_TEXT_SIZE];
};
struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_code,
struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code,
int (*mncc_recv)(struct gsm_network *, struct msgb *));
struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
u_int8_t tsc, u_int8_t bsic);
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
/* Get reference to a neighbor cell on a given BCCH ARFCN */
struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts,
u_int16_t arfcn, u_int8_t bsic);
uint16_t arfcn, uint8_t bsic);
struct gsm_bts_trx *gsm_bts_trx_num(struct gsm_bts *bts, int num);
const char *gsm_pchan_name(enum gsm_phys_chan_config c);
enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
const char *gsm_lchant_name(enum gsm_chan_t c);
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
char *gsm_trx_name(struct gsm_bts_trx *trx);
char *gsm_ts_name(struct gsm_bts_trx_ts *ts);
char *gsm_lchan_name(struct gsm_lchan *lchan);
const char *gsm_lchans_name(enum gsm_lchan_state s);
void set_ts_e1link(struct gsm_bts_trx_ts *ts, u_int8_t e1_nr,
u_int8_t e1_ts, u_int8_t e1_ts_ss);
enum gsm_bts_type parse_btstype(const char *arg);
const char *btstype2str(enum gsm_bts_type type);
struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr);
struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac,
struct gsm_bts *start_bts);
@@ -853,7 +353,6 @@ static inline int is_siemens_bts(struct gsm_bts *bts)
return 0;
}
enum gsm_auth_policy gsm_auth_policy_parse(const char *arg);
const char *gsm_auth_policy_name(enum gsm_auth_policy policy);
@@ -863,17 +362,24 @@ const char *rrlp_mode_name(enum rrlp_mode mode);
enum bts_gprs_mode bts_gprs_mode_parse(const char *arg);
const char *bts_gprs_mode_name(enum bts_gprs_mode mode);
void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked);
int gsm48_ra_id_by_bts(u_int8_t *buf, struct gsm_bts *bts);
int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts);
void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts);
struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan);
int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat);
int gsm_bts_has_feature(struct gsm_bts *bts, enum gsm_bts_features feat);
int gsm_bts_model_register(struct gsm_bts_model *model);
struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan);
void subscr_con_free(struct gsm_subscriber_connection *conn);
#endif
struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net,
enum gsm_bts_type type,
uint8_t tsc, uint8_t bsic);
void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
uint8_t e1_ts, uint8_t e1_ts_ss);
void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked);
int gsm_bts_has_feature(struct gsm_bts *bts, enum gsm_bts_features feat);
struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr);
#endif /* _GSM_DATA_H */

View File

@@ -0,0 +1,590 @@
#ifndef _GSM_DATA_SHAREDH
#define _GSM_DATA_SHAREDH
#include <stdbool.h>
#include <stdint.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/bitvec.h>
#include <osmocom/core/statistics.h>
#include <osmocom/core/utils.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/rxlev_stat.h>
#include <osmocom/gsm/sysinfo.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
struct osmo_msc_data;
struct osmo_bsc_sccp_con;
struct gsm_sms_queue;
/* RRLP mode of operation */
enum rrlp_mode {
RRLP_MODE_NONE,
RRLP_MODE_MS_BASED,
RRLP_MODE_MS_PREF,
RRLP_MODE_ASS_PREF,
};
/* Channel Request reason */
enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_EMERG,
GSM_CHREQ_REASON_PAG,
GSM_CHREQ_REASON_CALL,
GSM_CHREQ_REASON_LOCATION_UPD,
GSM_CHREQ_REASON_OTHER,
};
#define TRX_NR_TS 8
#define TS_MAX_LCHAN 8
#define HARDCODED_ARFCN 123
#define HARDCODED_TSC 7
#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
/* for multi-drop config */
#define HARDCODED_BTS0_TS 1
#define HARDCODED_BTS1_TS 6
#define HARDCODED_BTS2_TS 11
/* reserved according to GSM 03.03 § 2.4 */
#define GSM_RESERVED_TMSI 0xFFFFFFFF
enum gsm_hooks {
GSM_HOOK_NM_SWLOAD,
GSM_HOOK_RR_PAGING,
GSM_HOOK_RR_SECURITY,
};
enum gsm_paging_event {
GSM_PAGING_SUCCEEDED,
GSM_PAGING_EXPIRED,
GSM_PAGING_OOM,
GSM_PAGING_BUSY,
};
enum bts_gprs_mode {
BTS_GPRS_NONE = 0,
BTS_GPRS_GPRS = 1,
BTS_GPRS_EGPRS = 2,
};
struct gsm_lchan;
struct gsm_subscriber;
struct gsm_mncc;
struct rtp_socket;
struct bsc_api;
/* Network Management State */
struct gsm_nm_state {
uint8_t operational;
uint8_t administrative;
uint8_t availability;
};
struct gsm_abis_mo {
uint8_t obj_class;
struct abis_om_obj_inst obj_inst;
const char *name;
struct gsm_nm_state nm_state;
struct tlv_parsed *nm_attr;
struct gsm_bts *bts;
};
#define MAX_A5_KEY_LEN (128/8)
#define A38_XOR_MIN_KEY_LEN 12
#define A38_XOR_MAX_KEY_LEN 16
#define A38_COMP128_KEY_LEN 16
#define RSL_ENC_ALG_A5(x) (x+1)
/* is the data link established? who established it? */
#define LCHAN_SAPI_UNUSED 0
#define LCHAN_SAPI_MS 1
#define LCHAN_SAPI_NET 2
/* state of a logical channel */
enum gsm_lchan_state {
LCHAN_S_NONE, /* channel is not active */
LCHAN_S_ACT_REQ, /* channel activatin requested */
LCHAN_S_ACTIVE, /* channel is active and operational */
LCHAN_S_REL_REQ, /* channel release has been requested */
LCHAN_S_REL_ERR, /* channel is in an error state */
LCHAN_S_INACTIVE, /* channel is set inactive */
};
/* BTS ONLY */
#define MAX_NUM_UL_MEAS 104
#define LC_UL_M_F_L1_VALID (1 << 0)
#define LC_UL_M_F_RES_VALID (1 << 1)
struct bts_ul_meas {
/* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */
uint16_t ber10k;
/* timing advance offset (in quarter bits) */
int16_t ta_offs_qbits;
/* C/I ratio in dB */
float c_i;
/* flags */
uint8_t is_sub:1;
/* RSSI in dBm * -1 */
uint8_t inv_rssi;
};
/* /BTS ONLY */
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
/* The logical subslot number in the TS */
uint8_t nr;
/* The logical channel type */
enum gsm_chan_t type;
/* RSL channel mode */
enum rsl_cmod_spd rsl_cmode;
/* If TCH, traffic channel mode */
enum gsm48_chan_mode tch_mode;
/* State */
enum gsm_lchan_state state;
/* Power levels for MS and BTS */
uint8_t bs_power;
uint8_t ms_power;
/* Encryption information */
struct {
uint8_t alg_id;
uint8_t key_len;
uint8_t key[MAX_A5_KEY_LEN];
} encr;
/* AMR bits */
struct gsm48_multi_rate_conf mr_conf;
/* Established data link layer services */
uint8_t sapis[8];
int sach_deact;
int release_reason;
struct {
uint32_t bound_ip;
uint32_t connect_ip;
uint16_t bound_port;
uint16_t connect_port;
uint16_t conn_id;
uint8_t rtp_payload;
uint8_t rtp_payload2;
uint8_t speech_mode;
struct rtp_socket *rtp_socket;
} abis_ip;
uint8_t rqd_ta;
#ifdef ROLE_BSC
struct osmo_timer_list T3101;
struct osmo_timer_list T3111;
struct osmo_timer_list error_timer;
/* table of neighbor cell measurements */
struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
/* cache of last measurement reports on this lchan */
struct gsm_meas_rep meas_rep[6];
int meas_rep_idx;
/* GSM Random Access data */
struct gsm48_req_ref *rqd_ref;
struct gsm_subscriber_connection *conn;
#else
struct lapdm_channel lapdm_ch;
struct {
/* bitmask of all SI that are present/valid in si_buf */
uint32_t valid;
uint32_t last;
/* buffers where we put the pre-computed SI */
sysinfo_buf_t buf[_MAX_SYSINFO_TYPE];
} si;
struct {
uint8_t flags;
/* RSL measurment result number, 0 at lchan_act */
uint8_t res_nr;
/* current Tx power level of the BTS */
uint8_t bts_tx_pwr;
/* number of measurements stored in array below */
uint8_t num_ul_meas;
struct bts_ul_meas uplink[MAX_NUM_UL_MEAS];
/* last L1 header from the MS */
uint8_t l1_info[2];
struct {
uint8_t rxlev_full;
uint8_t rxlev_sub;
uint8_t rxqual_full;
uint8_t rxqual_sub;
} res;
} meas;
#endif
};
struct gsm_e1_subslot {
/* Number of E1 link */
uint8_t e1_nr;
/* Number of E1 TS inside E1 link */
uint8_t e1_ts;
/* Sub-slot within the E1 TS, 0xff if full TS */
uint8_t e1_ts_ss;
};
#define TS_F_PDCH_MODE 0x1000
/* One Timeslot in a TRX */
struct gsm_bts_trx_ts {
struct gsm_bts_trx *trx;
/* number of this timeslot at the TRX */
uint8_t nr;
enum gsm_phys_chan_config pchan;
unsigned int flags;
struct gsm_abis_mo mo;
struct tlv_parsed nm_attr;
uint8_t nm_chan_comb;
int tsc; /* -1 == use BTS TSC */
struct {
/* Parameters below are configured by VTY */
int enabled;
uint8_t maio;
uint8_t hsn;
struct bitvec arfcns;
uint8_t arfcns_data[1024/8];
/* This is the pre-computed MA for channel assignments */
struct bitvec ma;
uint8_t ma_len; /* part of ma_data that is used */
uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
} hopping;
/* To which E1 subslot are we connected */
struct gsm_e1_subslot e1_link;
struct gsm_lchan lchan[TS_MAX_LCHAN];
};
/* One TRX in a BTS */
struct gsm_bts_trx {
/* list header in bts->trx_list */
struct llist_head list;
struct gsm_bts *bts;
/* number of this TRX in the BTS */
uint8_t nr;
/* human readable name / description */
char *description;
/* how do we talk RSL with this TRX? */
struct gsm_e1_subslot rsl_e1_link;
uint8_t rsl_tei;
struct e1inp_sign_link *rsl_link;
/* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
struct e1inp_sign_link *oml_link;
struct gsm_abis_mo mo;
struct tlv_parsed nm_attr;
struct {
struct gsm_abis_mo mo;
} bb_transc;
uint16_t arfcn;
int nominal_power; /* in dBm */
unsigned int max_power_red; /* in actual dB */
struct {
void *l1h;
} role_bts;
union {
struct {
struct {
struct gsm_abis_mo mo;
} bbsig;
struct {
struct gsm_abis_mo mo;
} pa;
} bs11;
struct {
unsigned int test_state;
uint8_t test_nr;
struct rxlev_stats rxlev_stat;
} ipaccess;
};
struct gsm_bts_trx_ts ts[TRX_NR_TS];
};
#define GSM_BTS_SI(bts, i) (void *)(bts->si_buf[i])
enum gsm_bts_type {
GSM_BTS_TYPE_UNKNOWN,
GSM_BTS_TYPE_BS11,
GSM_BTS_TYPE_NANOBTS,
GSM_BTS_TYPE_RBS2000,
GSM_BTS_TYPE_HSL_FEMTO,
};
struct vty;
struct gsm_bts_model {
struct llist_head list;
enum gsm_bts_type type;
const char *name;
bool started;
int (*start)(struct gsm_network *net);
int (*oml_rcvmsg)(struct msgb *msg);
void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts);
void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx);
void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts);
struct tlv_definition nm_att_tlvdef;
struct bitvec features;
uint8_t _features_data[128/8];
};
enum gsm_bts_features {
BTS_FEAT_HSCSD,
BTS_FEAT_GPRS,
BTS_FEAT_EGPRS,
BTS_FEAT_ECSD,
BTS_FEAT_HOPPING,
};
/*
* This keeps track of the paging status of one BTS. It
* includes a number of pending requests, a back pointer
* to the gsm_bts, a timer and some more state.
*/
struct gsm_bts_paging_state {
/* pending requests */
struct llist_head pending_requests;
struct gsm_bts *bts;
struct osmo_timer_list work_timer;
struct osmo_timer_list credit_timer;
/* free chans needed */
int free_chans_need;
/* load */
uint16_t available_slots;
};
struct gsm_envabtse {
struct gsm_abis_mo mo;
};
struct gsm_bts_gprs_nsvc {
struct gsm_bts *bts;
/* data read via VTY config file, to configure the BTS
* via OML from BSC */
int id;
uint16_t nsvci;
uint16_t local_port; /* on the BTS */
uint16_t remote_port; /* on the SGSN */
uint32_t remote_ip; /* on the SGSN */
struct gsm_abis_mo mo;
};
enum neigh_list_manual_mode {
NL_MODE_AUTOMATIC = 0,
NL_MODE_MANUAL = 1,
NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */
};
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
struct llist_head list;
/* number of ths BTS in network */
uint8_t nr;
/* human readable name / description */
char *description;
/* Cell Identity */
uint16_t cell_identity;
/* location area code of this BTS */
uint16_t location_area_code;
/* Training Sequence Code */
uint8_t tsc;
/* Base Station Identification Code (BSIC) */
uint8_t bsic;
/* type of BTS */
enum gsm_bts_type type;
struct gsm_bts_model *model;
enum gsm_band band;
/* maximum Tx power that the MS is permitted to use in this cell */
int ms_max_power;
/* how do we talk OML with this TRX? */
struct gsm_e1_subslot oml_e1_link;
uint8_t oml_tei;
struct e1inp_sign_link *oml_link;
/* Abis network management O&M handle */
struct abis_nm_h *nmh;
struct gsm_abis_mo mo;
/* number of this BTS on given E1 link */
uint8_t bts_nr;
/* paging state and control */
struct gsm_bts_paging_state paging;
/* CCCH is on C0 */
struct gsm_bts_trx *c0;
struct {
struct gsm_abis_mo mo;
} site_mgr;
/* bitmask of all SI that are present/valid in si_buf */
uint32_t si_valid;
/* buffers where we put the pre-computed SI */
sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE];
/* ip.accesss Unit ID's have Site/BTS/TRX layout */
union {
struct {
uint16_t site_id;
uint16_t bts_id;
uint32_t flags;
} ip_access;
struct {
struct {
struct gsm_abis_mo mo;
} cclk;
struct {
struct gsm_abis_mo mo;
} rack;
struct gsm_envabtse envabtse[4];
} bs11;
struct {
struct {
struct gsm_abis_mo mo;
struct llist_head conn_groups;
} is;
struct {
struct gsm_abis_mo mo;
struct llist_head conn_groups;
} con;
struct {
struct gsm_abis_mo mo;
} dp;
struct {
struct gsm_abis_mo mo;
} tf;
} rbs2000;
struct {
unsigned long serno;
} hsl;
};
/* Not entirely sure how ip.access specific this is */
struct {
enum bts_gprs_mode mode;
struct {
struct gsm_abis_mo mo;
uint16_t nsei;
uint8_t timer[7];
} nse;
struct {
struct gsm_abis_mo mo;
uint16_t bvci;
uint8_t timer[11];
} cell;
struct gsm_bts_gprs_nsvc nsvc[2];
uint8_t rac;
} gprs;
/* RACH NM values */
int rach_b_thresh;
int rach_ldavg_slots;
/* transceivers */
int num_trx;
struct llist_head trx_list;
#ifdef ROLE_BSC
/* Abis NM queue */
struct llist_head abis_queue;
int abis_nm_pend;
struct gsm_network *network;
/* should the channel allocator allocate channels from high TRX to TRX0,
* rather than starting from TRX0 and go upwards? */
int chan_alloc_reverse;
enum neigh_list_manual_mode neigh_list_manual_mode;
/* parameters from which we build SYSTEM INFORMATION */
struct {
struct gsm48_rach_control rach_control;
uint8_t ncc_permitted;
struct gsm48_cell_sel_par cell_sel_par;
struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */
struct gsm48_cell_options cell_options;
struct gsm48_control_channel_descr chan_desc;
struct bitvec neigh_list;
struct bitvec cell_alloc;
struct bitvec si5_neigh_list;
struct {
/* bitmask large enough for all possible ARFCN's */
uint8_t neigh_list[1024/8];
uint8_t cell_alloc[1024/8];
/* If the user wants a different neighbor list in SI5 than in SI2 */
uint8_t si5_neigh_list[1024/8];
} data;
} si_common;
/* do we use static (user-defined) system information messages? (bitmask) */
uint32_t si_mode_static;
#endif /* ROLE_BSC */
void *role;
};
struct gsm_bts *gsm_bts_alloc(void *talloc_ctx);
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
struct gsm_bts_trx *gsm_bts_trx_num(struct gsm_bts *bts, int num);
const char *gsm_pchan_name(enum gsm_phys_chan_config c);
enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
const char *gsm_lchant_name(enum gsm_chan_t c);
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
char *gsm_trx_name(struct gsm_bts_trx *trx);
char *gsm_ts_name(struct gsm_bts_trx_ts *ts);
char *gsm_lchan_name(struct gsm_lchan *lchan);
const char *gsm_lchans_name(enum gsm_lchan_state s);
void gsm_abis_mo_reset(struct gsm_abis_mo *mo);
struct gsm_abis_mo *
gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class,
struct abis_om_obj_inst *obj_inst);
struct gsm_nm_state *
gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class,
struct abis_om_obj_inst *obj_inst);
void *
gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
struct abis_om_obj_inst *obj_inst);
/* reset the state of all MO in the BTS */
void gsm_bts_mo_reset(struct gsm_bts *bts);
uint8_t gsm_ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr);
uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
#endif

View File

@@ -1,9 +1,8 @@
#ifndef _GSM_SUBSCR_H
#define _GSM_SUBSCR_H
#include <sys/types.h>
#include "gsm_data.h"
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
#define GSM_IMEI_LENGTH 17
#define GSM_IMSI_LENGTH 17
@@ -24,24 +23,24 @@ struct gsm_equipment {
char name[GSM_NAME_LENGTH];
struct gsm48_classmark1 classmark1;
u_int8_t classmark2_len;
u_int8_t classmark2[3];
u_int8_t classmark3_len;
u_int8_t classmark3[14];
uint8_t classmark2_len;
uint8_t classmark2[3];
uint8_t classmark3_len;
uint8_t classmark3[14];
};
struct gsm_subscriber {
struct gsm_network *net;
long long unsigned int id;
char imsi[GSM_IMSI_LENGTH];
u_int32_t tmsi;
u_int16_t lac;
uint32_t tmsi;
uint16_t lac;
char name[GSM_NAME_LENGTH];
char extension[GSM_EXTENSION_LENGTH];
int authorized;
/* Temporary field which is not stored in the DB/HLR */
u_int32_t flags;
uint32_t flags;
/* Every user can only have one equipment in use at any given
* point in time */
@@ -72,7 +71,7 @@ enum gsm_subscriber_update_reason {
struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);
struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr);
struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
u_int32_t tmsi);
uint32_t tmsi);
struct gsm_subscriber *subscr_get_by_imsi(struct gsm_network *net,
const char *imsi);
struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net,

View File

@@ -3,56 +3,8 @@
#include "e1_input.h"
#include "gsm_subscriber.h"
#include <osmocore/linuxlist.h>
#define IPA_TCP_PORT_OML 3002
#define IPA_TCP_PORT_RSL 3003
struct ipaccess_head {
u_int16_t len; /* network byte order */
u_int8_t proto;
u_int8_t data[0];
} __attribute__ ((packed));
struct ipaccess_head_ext {
uint8_t proto;
uint8_t data[0];
} __attribute__ ((packed));
enum ipaccess_proto {
IPAC_PROTO_RSL = 0x00,
IPAC_PROTO_IPACCESS = 0xfe,
IPAC_PROTO_SCCP = 0xfd,
IPAC_PROTO_OML = 0xff,
/* OpenBSC extensions */
IPAC_PROTO_OSMO = 0xee,
IPAC_PROTO_MGCP_OLD = 0xfc,
};
enum ipaccess_msgtype {
IPAC_MSGT_PING = 0x00,
IPAC_MSGT_PONG = 0x01,
IPAC_MSGT_ID_GET = 0x04,
IPAC_MSGT_ID_RESP = 0x05,
IPAC_MSGT_ID_ACK = 0x06,
/* OpenBSC extension */
IPAC_MSGT_SCCP_OLD = 0xff,
};
enum ipaccess_id_tags {
IPAC_IDTAG_SERNR = 0x00,
IPAC_IDTAG_UNITNAME = 0x01,
IPAC_IDTAG_LOCATION1 = 0x02,
IPAC_IDTAG_LOCATION2 = 0x03,
IPAC_IDTAG_EQUIPVERS = 0x04,
IPAC_IDTAG_SWVERSION = 0x05,
IPAC_IDTAG_IPADDR = 0x06,
IPAC_IDTAG_MACADDR = 0x07,
IPAC_IDTAG_UNIT = 0x08,
};
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/protocol/ipaccess.h>
struct ipac_msgt_sccp_state {
uint8_t src_ref[3];
@@ -62,54 +14,38 @@ struct ipac_msgt_sccp_state {
char imsi[GSM_IMSI_LENGTH];
} __attribute__((packed));
/*
* @add_remove 0 for remove, 1 for add, 3 to asK
* @nr_lacs Number of extra lacs inside this package
* @lac One lac entry
*/
struct ipac_ext_lac_cmd {
uint8_t add_remove;
uint8_t nr_extra_lacs;
uint16_t lac;
uint8_t data[0];
} __attribute__((packed));
int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa);
/*
* methods for parsing and sending a message
*/
int ipaccess_rcvmsg_base(struct msgb *msg, struct bsc_fd *bfd);
struct msgb *ipaccess_read_msg(struct bsc_fd *bfd, int *error);
int ipaccess_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd);
struct msgb *ipaccess_read_msg(struct osmo_fd *bfd, int *error);
void ipaccess_prepend_header(struct msgb *msg, int proto);
void ipaccess_prepend_header_ext(struct msgb *msg, int proto);
int ipaccess_send_pong(int fd);
int ipaccess_send_id_ack(int fd);
int ipaccess_send_id_req(int fd);
const char *ipaccess_idtag_name(uint8_t tag);
int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len);
int ipaccess_parse_unitid(const char *str, uint16_t *site_id, uint16_t *bts_id, uint16_t *trx_id);
int ipaccess_drop_oml(struct gsm_bts *bts);
int ipaccess_drop_rsl(struct gsm_bts_trx *trx);
/*
* Firmware specific header
*/
struct sdp_firmware {
char magic[4];
char more_magic[2];
u_int16_t more_more_magic;
u_int32_t header_length;
u_int32_t file_length;
char sw_part[20];
char text1[64];
char time[12];
char date[14];
char text2[10];
char version[20];
u_int16_t table_offset;
/* stuff i don't know */
} __attribute__((packed));
struct sdp_header_entry {
u_int16_t something1;
char text1[64];
char time[12];
char date[14];
char text2[10];
char version[20];
u_int32_t length;
u_int32_t addr1;
u_int32_t addr2;
u_int32_t start;
} __attribute__((packed));
struct sdp_header_item {
struct sdp_header_entry header_entry;
struct llist_head entry;

View File

@@ -1,21 +1,23 @@
#ifndef _MEAS_REP_H
#define _MEAS_REP_H
#include <stdint.h>
#define MRC_F_PROCESSED 0x0001
/* extracted from a L3 measurement report IE */
struct gsm_meas_rep_cell {
u_int8_t rxlev;
u_int8_t bsic;
u_int8_t neigh_idx;
u_int16_t arfcn;
uint8_t rxlev;
uint8_t bsic;
uint8_t neigh_idx;
uint16_t arfcn;
unsigned int flags;
};
/* RX Level and RX Quality */
struct gsm_rx_lev_qual {
u_int8_t rx_lev;
u_int8_t rx_qual;
uint8_t rx_lev;
uint8_t rx_qual;
};
/* unidirectional measumrement report */
@@ -38,7 +40,7 @@ struct gsm_meas_rep {
struct gsm_lchan *lchan;
/* number of the measurement report */
u_int8_t nr;
uint8_t nr;
/* flags, see MEAS_REP_F_* */
unsigned int flags;
@@ -46,11 +48,11 @@ struct gsm_meas_rep {
struct gsm_meas_rep_unidir ul;
struct gsm_meas_rep_unidir dl;
u_int8_t bs_power;
u_int8_t ms_timing_offset;
uint8_t bs_power;
uint8_t ms_timing_offset;
struct {
int8_t pwr; /* MS power in dBm */
u_int8_t ta; /* MS timing advance */
uint8_t ta; /* MS timing advance */
} ms_l1;
/* neighbor measurement reports for up to 6 cells */

View File

@@ -23,8 +23,8 @@
#ifndef OPENBSC_MGCP_H
#define OPENBSC_MGCP_H
#include <osmocore/msgb.h>
#include <osmocore/write_queue.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/write_queue.h>
#include "debug.h"
@@ -135,7 +135,7 @@ struct mgcp_config {
struct in_addr transcoder_in;
int transcoder_remote_base;
struct write_queue gw_fd;
struct osmo_wqueue gw_fd;
struct mgcp_port_range bts_ports;
struct mgcp_port_range net_ports;

View File

@@ -23,7 +23,7 @@
#ifndef OPENBSC_MGCP_DATA_H
#define OPENBSC_MGCP_DATA_H
#include <osmocore/select.h>
#include <osmocom/core/select.h>
#define CI_UNUSED 0
@@ -66,8 +66,8 @@ struct mgcp_rtp_end {
/*
* Each end has a socket...
*/
struct bsc_fd rtp;
struct bsc_fd rtcp;
struct osmo_fd rtp;
struct osmo_fd rtcp;
int local_port;
int local_alloc;

View File

@@ -24,8 +24,8 @@
#ifndef _MNCC_H
#define _MNCC_H
#include <osmocore/linuxlist.h>
#include <osmocore/mncc.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/mncc.h>
#include <stdint.h>

View File

@@ -16,8 +16,8 @@ struct osmo_bsc_sccp_con {
/* SCCP connection realted */
struct sccp_connection *sccp;
struct bsc_msc_connection *msc_con;
struct timer_list sccp_it_timeout;
struct timer_list sccp_cc_timeout;
struct osmo_timer_list sccp_it_timeout;
struct osmo_timer_list sccp_cc_timeout;
struct llist_head sccp_queue;
unsigned int sccp_queue_size;

View File

@@ -1,32 +1,32 @@
#ifndef OSMO_BSC_RF
#define OSMO_BSC_RF
#include <osmocore/write_queue.h>
#include <osmocore/timer.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/timer.h>
struct gsm_network;
struct osmo_bsc_rf {
/* the value of signal.h */
int policy;
struct bsc_fd listen;
struct osmo_fd listen;
struct gsm_network *gsm_network;
const char *last_state_command;
/* delay the command */
char last_request;
struct timer_list delay_cmd;
struct osmo_timer_list delay_cmd;
/* verify that RF is up as it should be */
struct timer_list rf_check;
struct osmo_timer_list rf_check;
/* some handling for the automatic grace switch */
struct timer_list grace_timeout;
struct osmo_timer_list grace_timeout;
};
struct osmo_bsc_rf_conn {
struct write_queue queue;
struct osmo_wqueue queue;
struct osmo_bsc_rf *rf;
};

View File

@@ -25,7 +25,7 @@
#include "bsc_msc.h"
#include <osmocore/timer.h>
#include <osmocom/core/timer.h>
struct osmo_bsc_rf;
struct gsm_network;
@@ -36,15 +36,15 @@ struct gsm_audio_support {
};
struct osmo_msc_data {
/* Back pointer */
struct gsm_network *network;
/* Connection data */
char *bsc_token;
int msc_port;
int msc_ip_dscp;
char *msc_ip;
int ping_timeout;
int pong_timeout;
struct timer_list ping_timer;
struct timer_list pong_timer;
struct osmo_timer_list ping_timer;
struct osmo_timer_list pong_timer;
struct bsc_msc_connection *msc_con;
int core_ncc;
int core_mcc;
@@ -54,13 +54,17 @@ struct osmo_msc_data {
struct gsm_audio_support **audio_support;
int audio_length;
/* destinations */
struct llist_head dests;
/* mgcp agent */
struct write_queue mgcp_agent;
struct osmo_wqueue mgcp_agent;
/* rf ctl related bits */
char *mid_call_txt;
int mid_call_timeout;
char *rf_ctrl_name;
struct osmo_bsc_rf *rf_ctl;
/* ussd welcome text */

View File

@@ -23,10 +23,10 @@
#include <stdlib.h>
#include <string.h>
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
#include "gsm_data.h"
#include "gsm_subscriber.h"
#include <osmocore/timer.h>
#include <osmocom/core/timer.h>
/**
* A pending paging request
@@ -43,7 +43,7 @@ struct gsm_paging_request {
int chan_type;
/* Timer 3113: how long do we try to page? */
struct timer_list T3113;
struct osmo_timer_list T3113;
/* How often did we ask the BTS to page? */
int attempts;
@@ -53,9 +53,6 @@ struct gsm_paging_request {
void *cbfn_param;
};
/* call once for every gsm_bts... */
void paging_init(struct gsm_bts *bts);
/* schedule paging request */
int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
int type, gsm_cbfn *cbfn, void *data);
@@ -66,6 +63,9 @@ void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr,
struct msgb *msg);
/* update paging load */
void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t);
void paging_update_buffer_space(struct gsm_bts *bts, uint16_t);
/* pending paging requests */
unsigned int paging_pending_requests_nr(struct gsm_bts *bts);
#endif

View File

@@ -1,14 +1,13 @@
#ifndef _REST_OCTETS_H
#define _REST_OCTETS_H
#include <sys/types.h>
#include <openbsc/gsm_04_08.h>
/* generate SI1 rest octets */
int rest_octets_si1(u_int8_t *data, u_int8_t *nch_pos);
int rest_octets_si1(uint8_t *data, uint8_t *nch_pos);
struct gsm48_si_selection_params {
u_int16_t penalty_time:5,
uint16_t penalty_time:5,
temp_offs:3,
cell_resel_off:6,
cbq:1,
@@ -16,18 +15,18 @@ struct gsm48_si_selection_params {
};
struct gsm48_si_power_offset {
u_int8_t power_offset:2,
uint8_t power_offset:2,
present:1;
};
struct gsm48_si3_gprs_ind {
u_int8_t si13_position:1,
uint8_t si13_position:1,
ra_colour:3,
present:1;
};
struct gsm48_lsa_params {
u_int32_t prio_thr:3,
uint32_t prio_thr:3,
lsa_offset:3,
mcc:12,
mnc:12;
@@ -37,26 +36,26 @@ struct gsm48_lsa_params {
struct gsm48_si_ro_info {
struct gsm48_si_selection_params selection_params;
struct gsm48_si_power_offset power_offset;
u_int8_t si2ter_indicator;
u_int8_t early_cm_ctrl;
uint8_t si2ter_indicator;
uint8_t early_cm_ctrl;
struct {
u_int8_t where:3,
uint8_t where:3,
present:1;
} scheduling;
struct gsm48_si3_gprs_ind gprs_ind;
/* SI 4 specific */
struct gsm48_lsa_params lsa_params;
u_int16_t cell_id;
u_int8_t break_ind; /* do we have SI7 + SI8 ? */
uint16_t cell_id;
uint8_t break_ind; /* do we have SI7 + SI8 ? */
};
/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */
int rest_octets_si3(u_int8_t *data, const struct gsm48_si_ro_info *si3);
int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3);
/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */
int rest_octets_si4(u_int8_t *data, const struct gsm48_si_ro_info *si4);
int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4);
enum pbcch_carrier_type {
PBCCH_BCCH,
@@ -75,59 +74,59 @@ enum gprs_nmo {
struct gprs_cell_options {
enum gprs_nmo nmo;
/* T3168: wait for packet uplink assignment message */
u_int32_t t3168; /* in milliseconds */
uint32_t t3168; /* in milliseconds */
/* T3192: wait for release of the TBF after reception of the final block */
u_int32_t t3192; /* in milliseconds */
u_int32_t drx_timer_max;/* in seconds */
u_int32_t bs_cv_max;
uint32_t t3192; /* in milliseconds */
uint32_t drx_timer_max;/* in seconds */
uint32_t bs_cv_max;
u_int8_t ext_info_present;
uint8_t ext_info_present;
struct {
u_int8_t egprs_supported;
u_int8_t use_egprs_p_ch_req;
u_int8_t bep_period;
u_int8_t pfc_supported;
u_int8_t dtm_supported;
u_int8_t bss_paging_coordination;
uint8_t egprs_supported;
uint8_t use_egprs_p_ch_req;
uint8_t bep_period;
uint8_t pfc_supported;
uint8_t dtm_supported;
uint8_t bss_paging_coordination;
} ext_info;
};
/* TS 04.60 Table 12.9.2 */
struct gprs_power_ctrl_pars {
u_int8_t alpha;
u_int8_t t_avg_w;
u_int8_t t_avg_t;
u_int8_t pc_meas_chan;
u_int8_t n_avg_i;
uint8_t alpha;
uint8_t t_avg_w;
uint8_t t_avg_t;
uint8_t pc_meas_chan;
uint8_t n_avg_i;
};
struct gsm48_si13_info {
struct gprs_cell_options cell_opts;
struct gprs_power_ctrl_pars pwr_ctrl_pars;
u_int8_t bcch_change_mark;
u_int8_t si_change_field;
u_int8_t pbcch_present;
uint8_t bcch_change_mark;
uint8_t si_change_field;
uint8_t pbcch_present;
union {
struct {
u_int8_t rac;
u_int8_t spgc_ccch_sup;
u_int8_t net_ctrl_ord;
u_int8_t prio_acc_thr;
uint8_t rac;
uint8_t spgc_ccch_sup;
uint8_t net_ctrl_ord;
uint8_t prio_acc_thr;
} no_pbcch;
struct {
u_int8_t psi1_rep_per;
u_int8_t pb;
u_int8_t tsc;
u_int8_t tn;
uint8_t psi1_rep_per;
uint8_t pb;
uint8_t tsc;
uint8_t tn;
enum pbcch_carrier_type carrier_type;
u_int16_t arfcn;
u_int8_t maio;
uint16_t arfcn;
uint8_t maio;
} pbcch;
};
};
/* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */
int rest_octets_si13(u_int8_t *data, const struct gsm48_si13_info *si13);
int rest_octets_si13(uint8_t *data, const struct gsm48_si13_info *si13);
#endif /* _REST_OCTETS_H */

View File

@@ -24,8 +24,10 @@
#include <netinet/in.h>
#include <osmocore/linuxlist.h>
#include <osmocore/select.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/select.h>
#include <openbsc/mncc.h>
#define RTP_PT_GSM_FULL 3
#define RTP_PT_GSM_HALF 96
@@ -48,7 +50,7 @@ struct rtp_sub_socket {
struct sockaddr_in sin_local;
struct sockaddr_in sin_remote;
struct bsc_fd bfd;
struct osmo_fd bfd;
/* linked list of to-be-transmitted msgb's */
struct llist_head tx_queue;
};
@@ -67,23 +69,23 @@ struct rtp_socket {
} proxy;
struct {
struct gsm_network *net;
u_int32_t callref;
uint32_t callref;
} receive;
};
enum rtp_tx_action tx_action;
struct {
u_int16_t sequence;
u_int32_t timestamp;
u_int32_t ssrc;
uint16_t sequence;
uint32_t timestamp;
uint32_t ssrc;
struct timeval last_tv;
} transmit;
};
struct rtp_socket *rtp_socket_create(void);
int rtp_socket_bind(struct rtp_socket *rs, u_int32_t ip);
int rtp_socket_connect(struct rtp_socket *rs, u_int32_t ip, u_int16_t port);
int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip);
int rtp_socket_connect(struct rtp_socket *rs, uint32_t ip, uint16_t port);
int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other);
int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, u_int32_t callref);
int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, uint32_t callref);
int rtp_socket_free(struct rtp_socket *rs);
int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame);

View File

@@ -1,9 +1,8 @@
#ifndef _SGSN_H
#define _SGSN_H
#include <sys/types.h>
#include <osmocore/msgb.h>
#include <osmocom/core/msgb.h>
#include <openbsc/gprs_ns.h>
#include <openbsc/gprs_sgsn.h>
@@ -22,11 +21,11 @@ struct sgsn_instance {
char *config_file;
struct sgsn_config cfg;
/* File descriptor wrappers for LibGTP */
struct bsc_fd gtp_fd0;
struct bsc_fd gtp_fd1c;
struct bsc_fd gtp_fd1u;
struct osmo_fd gtp_fd0;
struct osmo_fd gtp_fd1c;
struct osmo_fd gtp_fd1u;
/* Timer for libGTP */
struct timer_list gtp_timer;
struct osmo_timer_list gtp_timer;
/* GSN instance for libgtp */
struct gsn_t *gsn;
};

View File

@@ -27,7 +27,7 @@
#include <openbsc/gsm_data.h>
#include <osmocore/signal.h>
#include <osmocom/core/signal.h>
/*
* Signalling subsystems
@@ -84,6 +84,7 @@ enum signal_nm {
S_NM_TEST_REP, /* GSM 12.21 Test Report */
S_NM_STATECHG_OPER, /* Operational State changed*/
S_NM_STATECHG_ADM, /* Administrative State changed */
S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */
};
/* SS_LCHAN signals */
@@ -169,15 +170,30 @@ struct scall_signal_data {
struct ipacc_ack_signal_data {
struct gsm_bts_trx *trx;
u_int8_t msg_type;
uint8_t msg_type;
};
struct abis_om2k_mo;
struct nm_statechg_signal_data {
u_int8_t obj_class;
struct gsm_bts *bts;
uint8_t obj_class;
void *obj;
struct gsm_nm_state *old_state;
struct gsm_nm_state *new_state;
/* This pointer is vaold for TS 12.21 MO */
struct abis_om_obj_inst *obj_inst;
/* This pointer is vaold for RBS2000 MO */
struct abis_om2k_mo *om2k_mo;
};
struct nm_om2k_signal_data {
struct gsm_bts *bts;
void *obj;
struct abis_om2k_mo *om2k_mo;
uint8_t accordance_ind;
};
struct nm_nack_signal_data {

View File

@@ -1,14 +1,14 @@
#ifndef _BSC_SOCKET_H
#define _BSC_SOCKET_H
#include <sys/types.h>
#include <osmocore/select.h>
#include <osmocom/core/select.h>
#ifndef IPPROTO_GRE
#define IPPROTO_GRE 47
#endif
int make_sock(struct bsc_fd *bfd, int proto, u_int32_t ip, u_int16_t port,
int (*cb)(struct bsc_fd *fd, unsigned int what));
int make_sock(struct osmo_fd *bfd, int proto,
uint32_t ip, uint16_t port, int priv_nr,
int (*cb)(struct osmo_fd *fd, unsigned int what), void *data);
#endif /* _BSC_SOCKET_H */

View File

@@ -20,8 +20,8 @@
*
*/
#include <sys/types.h>
#include <osmocore/linuxlist.h>
#include <stdint.h>
#include <osmocom/core/linuxlist.h>
#define NR_SUBCH 4
#define TRAU_FRAME_SIZE 40
@@ -32,8 +32,8 @@
/***********************************************************************/
struct demux_subch {
u_int8_t out_bitbuf[TRAU_FRAME_BITS];
u_int16_t out_idx; /* next bit to be written in out_bitbuf */
uint8_t out_bitbuf[TRAU_FRAME_BITS];
uint16_t out_idx; /* next bit to be written in out_bitbuf */
/* number of consecutive zeros that we have received (for sync) */
unsigned int consecutive_zeros;
/* are we in TRAU frame sync or not? */
@@ -42,12 +42,12 @@ struct demux_subch {
struct subch_demux {
/* bitmask of currently active subchannels */
u_int8_t chan_activ;
uint8_t chan_activ;
/* one demux_subch struct for every subchannel */
struct demux_subch subch[NR_SUBCH];
/* callback to be called once we have received a complete
* frame on a given subchannel */
int (*out_cb)(struct subch_demux *dmx, int ch, u_int8_t *data, int len,
int (*out_cb)(struct subch_demux *dmx, int ch, uint8_t *data, int len,
void *);
/* user-provided data, transparently passed to out_cb() */
void *data;
@@ -57,7 +57,7 @@ struct subch_demux {
int subch_demux_init(struct subch_demux *dmx);
/* feed 'len' number of muxed bytes into the demultiplexer */
int subch_demux_in(struct subch_demux *dmx, u_int8_t *data, int len);
int subch_demux_in(struct subch_demux *dmx, uint8_t *data, int len);
/* activate decoding/processing for one subchannel */
int subch_demux_activate(struct subch_demux *dmx, int subch);
@@ -76,7 +76,7 @@ struct subch_txq_entry {
unsigned int bit_len; /* total number of bits in 'bits' */
unsigned int next_bit; /* next bit to be transmitted */
u_int8_t bits[0]; /* one bit per byte */
uint8_t bits[0]; /* one bit per byte */
};
struct mux_subch {
@@ -92,10 +92,10 @@ struct subch_mux {
int subchan_mux_init(struct subch_mux *mx);
/* request the output of 'len' multiplexed bytes */
int subchan_mux_out(struct subch_mux *mx, u_int8_t *data, int len);
int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len);
/* enqueue some data into one sub-channel of the muxer */
int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const u_int8_t *data,
int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
int len);
#endif /* _SUBCH_DEMUX_H */

View File

@@ -1,45 +1,10 @@
#ifndef _SYSTEM_INFO_H
#define _SYSTEM_INFO_H
#include <osmocore/utils.h>
#define GSM_MACBLOCK_LEN 23
#include <osmocom/gsm/sysinfo.h>
struct gsm_bts;
enum osmo_sysinfo_type {
SYSINFO_TYPE_NONE,
SYSINFO_TYPE_1,
SYSINFO_TYPE_2,
SYSINFO_TYPE_3,
SYSINFO_TYPE_4,
SYSINFO_TYPE_5,
SYSINFO_TYPE_6,
SYSINFO_TYPE_7,
SYSINFO_TYPE_8,
SYSINFO_TYPE_9,
SYSINFO_TYPE_10,
SYSINFO_TYPE_13,
SYSINFO_TYPE_16,
SYSINFO_TYPE_17,
SYSINFO_TYPE_18,
SYSINFO_TYPE_19,
SYSINFO_TYPE_20,
SYSINFO_TYPE_2bis,
SYSINFO_TYPE_2ter,
SYSINFO_TYPE_2quater,
SYSINFO_TYPE_5bis,
SYSINFO_TYPE_5ter,
/* FIXME all the various bis and ter */
_MAX_SYSINFO_TYPE
};
typedef u_int8_t sysinfo_buf_t[GSM_MACBLOCK_LEN];
extern const struct value_string osmo_sitype_strs[_MAX_SYSINFO_TYPE];
uint8_t gsm_sitype2rsl(enum osmo_sysinfo_type si_type);
const char *gsm_sitype_name(enum osmo_sysinfo_type si_type);
int gsm_generate_si(struct gsm_bts *bts, enum osmo_sysinfo_type type);
#endif

View File

@@ -3,8 +3,9 @@
#include <openbsc/gsm_data.h>
#include <openbsc/gsm_subscriber.h>
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
#include <openbsc/gsm_04_11.h>
#include <openbsc/mncc.h>
/* One transaction */
struct gsm_trans {
@@ -12,10 +13,10 @@ struct gsm_trans {
struct llist_head entry;
/* The protocol within which we live */
u_int8_t protocol;
uint8_t protocol;
/* The current transaction ID */
u_int8_t transaction_id;
uint8_t transaction_id;
/* To whom we belong, unique identifier of remote MM entity */
struct gsm_subscriber *subscr;
@@ -24,7 +25,7 @@ struct gsm_trans {
struct gsm_subscriber_connection *conn;
/* reference from MNCC or other application */
u_int32_t callref;
uint32_t callref;
/* if traffic channel receive was requested */
int tch_recv;
@@ -41,14 +42,14 @@ struct gsm_trans {
/* current timer and message queue */
int Tcurrent; /* current CC timer */
int T308_second; /* used to send release again */
struct timer_list timer;
struct osmo_timer_list timer;
struct gsm_mncc msg; /* stores setup/disconnect/release message */
} cc;
struct {
u_int8_t link_id; /* RSL Link ID to be used for this trans */
uint8_t link_id; /* RSL Link ID to be used for this trans */
int is_mt; /* is this a MO (0) or MT (1) transfer */
enum gsm411_cp_state cp_state;
struct timer_list cp_timer;
struct osmo_timer_list cp_timer;
enum gsm411_rp_state rp_state;
@@ -60,16 +61,16 @@ struct gsm_trans {
struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
u_int8_t proto, u_int8_t trans_id);
uint8_t proto, uint8_t trans_id);
struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
u_int32_t callref);
uint32_t callref);
struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t trans_id,
u_int32_t callref);
uint8_t protocol, uint8_t trans_id,
uint32_t callref);
void trans_free(struct gsm_trans *trans);
int trans_assign_trans_id(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t ti_flag);
uint8_t protocol, uint8_t ti_flag);
#endif

View File

@@ -20,7 +20,7 @@
*
*/
#include <sys/types.h>
#include <stdint.h>
/* 21 for FR/EFR, 25 for AMR, 15 for OM, 15 for data, 13 for E-data, 21 idle */
#define MAX_C_BITS 25
@@ -34,11 +34,11 @@
#define MAX_M_BITS 2
struct decoded_trau_frame {
u_int8_t c_bits[MAX_C_BITS];
u_int8_t d_bits[MAX_D_BITS];
u_int8_t t_bits[MAX_T_BITS];
u_int8_t s_bits[MAX_S_BITS];
u_int8_t m_bits[MAX_M_BITS];
uint8_t c_bits[MAX_C_BITS];
uint8_t d_bits[MAX_D_BITS];
uint8_t t_bits[MAX_T_BITS];
uint8_t s_bits[MAX_S_BITS];
uint8_t m_bits[MAX_M_BITS];
};
#define TRAU_FT_FR_UP 0x02 /* 0 0 0 1 0 - 3.5.1.1.1 */
@@ -55,10 +55,10 @@ struct decoded_trau_frame {
#define TRAU_FT_IDLE_DOWN 0x0e /* 0 1 1 1 0 - 3.5.5 */
int decode_trau_frame(struct decoded_trau_frame *fr, const u_int8_t *trau_bits);
int encode_trau_frame(u_int8_t *trau_bits, const struct decoded_trau_frame *fr);
int decode_trau_frame(struct decoded_trau_frame *fr, const uint8_t *trau_bits);
int encode_trau_frame(uint8_t *trau_bits, const struct decoded_trau_frame *fr);
int trau_frame_up2down(struct decoded_trau_frame *fr);
u_int8_t *trau_idle_frame(void);
uint8_t *trau_idle_frame(void);
#endif /* _TRAU_FRAME_H */

View File

@@ -28,6 +28,10 @@
* optimization to routing them externally.
*/
#include <stdint.h>
#include <openbsc/gsm_data.h>
#include <openbsc/mncc.h>
/* map a TRAU mux map entry */
int trau_mux_map(const struct gsm_e1_subslot *src,
const struct gsm_e1_subslot *dst);
@@ -35,14 +39,14 @@ int trau_mux_map_lchan(const struct gsm_lchan *src,
const struct gsm_lchan *dst);
/* unmap a TRAU mux map entry */
int trau_mux_unmap(const struct gsm_e1_subslot *ss, u_int32_t callref);
int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref);
/* we get called by subchan_demux */
int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
const u_int8_t *trau_bits, int num_bits);
const uint8_t *trau_bits, int num_bits);
/* add a trau receiver */
int trau_recv_lchan(struct gsm_lchan *lchan, u_int32_t callref);
int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref);
/* send trau from application */
int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame);

View File

@@ -3,7 +3,7 @@
/* Handler function for mobile-originated USSD messages */
#include <osmocore/msgb.h>
#include <osmocom/core/msgb.h>
int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg);

View File

@@ -35,12 +35,14 @@ enum bsc_vty_node {
MSC_NODE,
OM2K_NODE,
TRUNK_NODE,
PGROUP_NODE,
};
extern int bsc_vty_is_config_node(struct vty *vty, int node);
extern void bsc_replace_string(void *ctx, char **dst, const char *newstr);
int bsc_vty_init(void);
struct log_info;
int bsc_vty_init(const struct log_info *cat);
int bsc_vty_init_extra(void);
#endif

View File

@@ -1,6 +1,6 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
SUBDIRS = libcommon libabis libmgcp libbsc libmsc libtrau osmo-nitb osmo-bsc_mgcp utils ipaccess libgb gprs

View File

@@ -38,7 +38,7 @@ POST_UNINSTALL = :
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -129,6 +129,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
@@ -198,8 +200,8 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
SUBDIRS = libcommon libabis libmgcp libbsc libmsc libtrau osmo-nitb \
osmo-bsc_mgcp utils ipaccess libgb gprs $(am__append_1) \
$(am__append_2)

View File

@@ -1,6 +1,6 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS=-Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS=-Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
noinst_HEADERS = gprs_sndcp.h

View File

@@ -40,7 +40,7 @@ subdir = src/gprs
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -120,6 +120,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
@@ -189,8 +191,8 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
noinst_HEADERS = gprs_sndcp.h
osmo_gbproxy_SOURCES = gb_proxy.c gb_proxy_main.c gb_proxy_vty.c
osmo_gbproxy_LDADD = $(top_builddir)/src/libgb/libgb.a \

View File

@@ -19,11 +19,10 @@
*
*/
#include <sys/types.h>
#include <openbsc/crc24.h>
/* CRC24 table - FCS */
static const u_int32_t tbl_crc24[256] = {
static const uint32_t tbl_crc24[256] = {
0x00000000, 0x00d6a776, 0x00f64557, 0x0020e221, 0x00b78115, 0x00612663, 0x0041c442, 0x00976334,
0x00340991, 0x00e2aee7, 0x00c24cc6, 0x0014ebb0, 0x00838884, 0x00552ff2, 0x0075cdd3, 0x00a36aa5,
0x00681322, 0x00beb454, 0x009e5675, 0x0048f103, 0x00df9237, 0x00093541, 0x0029d760, 0x00ff7016,
@@ -60,7 +59,7 @@ static const u_int32_t tbl_crc24[256] = {
#define INIT_CRC24 0xffffff
u_int32_t crc24_calc(u_int32_t fcs, u_int8_t *cp, unsigned int len)
uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len)
{
while (len--)
fcs = (fcs >> 8) ^ tbl_crc24[(fcs ^ *cp++) & 0xff];

View File

@@ -27,11 +27,10 @@
#include <errno.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <osmocore/talloc.h>
#include <osmocore/select.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <openbsc/signal.h>
#include <openbsc/debug.h>

View File

@@ -28,15 +28,15 @@
#include <signal.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocore/talloc.h>
#include <osmocore/select.h>
#include <osmocore/rate_ctr.h>
#include <osmocore/process.h>
#include <osmocom/core/application.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/process.h>
#include <openbsc/signal.h>
#include <openbsc/debug.h>
@@ -47,6 +47,7 @@
#include <osmocom/vty/command.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
#include "../../bscconfig.h"
@@ -64,7 +65,6 @@ const char *openbsc_copyright =
"This is free software: you are free to change and redistribute it.\r\n"
"There is NO WARRANTY, to the extent permitted by law.\r\n";
static struct log_target *stderr_target;
static char *config_file = "osmo_gbproxy.cfg";
struct gbproxy_config gbcfg;
static int daemonize = 0;
@@ -74,7 +74,7 @@ extern struct gbprox_peer *gbprox_peer_sgsn;
/* call-back function for the NS protocol */
static int proxy_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
struct msgb *msg, u_int16_t bvci)
struct msgb *msg, uint16_t bvci)
{
int rc = 0;
@@ -98,7 +98,7 @@ static void signal_handler(int signal)
switch (signal) {
case SIGINT:
dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
sleep(1);
exit(0);
break;
@@ -162,10 +162,10 @@ static void handle_options(int argc, char **argv)
print_help();
exit(0);
case 's':
log_set_use_color(stderr_target, 0);
log_set_use_color(osmo_stderr_target, 0);
break;
case 'd':
log_parse_category_mask(stderr_target, optarg);
log_parse_category_mask(osmo_stderr_target, optarg);
break;
case 'D':
daemonize = 1;
@@ -174,10 +174,10 @@ static void handle_options(int argc, char **argv)
config_file = strdup(optarg);
break;
case 'T':
log_set_print_timestamp(stderr_target, 1);
log_set_print_timestamp(osmo_stderr_target, 1);
break;
case 'e':
log_set_log_level(stderr_target, atoi(optarg));
log_set_log_level(osmo_stderr_target, atoi(optarg));
break;
case 'V':
print_version(1);
@@ -212,16 +212,13 @@ int main(int argc, char **argv)
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);
signal(SIGUSR2, &signal_handler);
signal(SIGPIPE, SIG_IGN);
osmo_init_ignore_signals();
log_init(&log_info);
stderr_target = log_target_create_stderr();
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
osmo_init_logging(&log_info);
vty_info.copyright = openbsc_copyright;
vty_init(&vty_info);
logging_vty_add_cmds();
logging_vty_add_cmds(&log_info);
gbproxy_vty_init();
handle_options(argc, argv);
@@ -239,7 +236,7 @@ int main(int argc, char **argv)
}
gbcfg.nsi = bssgp_nsi;
gprs_ns_vty_init(bssgp_nsi);
register_signal_handler(SS_NS, &gbprox_signal, NULL);
osmo_signal_register_handler(SS_NS, &gbprox_signal, NULL);
rc = gbproxy_parse_config(config_file, &gbcfg);
if (rc < 0) {
@@ -279,7 +276,7 @@ int main(int argc, char **argv)
gbprox_reset_persistent_nsvcs(bssgp_nsi);
while (1) {
rc = bsc_select_main(0);
rc = osmo_select_main(0);
if (rc < 0)
exit(3);
}

View File

@@ -18,12 +18,11 @@
*
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocore/talloc.h>
#include <osmocom/core/talloc.h>
#include <openbsc/debug.h>
#include <openbsc/gb_proxy.h>

View File

@@ -31,12 +31,12 @@
#include <arpa/inet.h>
#include <openbsc/db.h>
#include <osmocore/msgb.h>
#include <osmocore/tlv.h>
#include <osmocore/gsm_utils.h>
#include <osmocore/signal.h>
#include <osmocore/talloc.h>
#include <osmocore/rate_ctr.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/core/signal.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
@@ -208,7 +208,7 @@ static void mmctx_timer_cb(void *_mm);
static void mmctx_timer_start(struct sgsn_mm_ctx *mm, unsigned int T,
unsigned int seconds)
{
if (bsc_timer_pending(&mm->timer))
if (osmo_timer_pending(&mm->timer))
LOGP(DMM, LOGL_ERROR, "Starting MM timer %u while old "
"timer %u pending\n", T, mm->T);
mm->T = T;
@@ -218,7 +218,7 @@ static void mmctx_timer_start(struct sgsn_mm_ctx *mm, unsigned int T,
mm->timer.data = mm;
mm->timer.cb = &mmctx_timer_cb;
bsc_schedule_timer(&mm->timer, seconds, 0);
osmo_timer_schedule(&mm->timer, seconds, 0);
}
static void mmctx_timer_stop(struct sgsn_mm_ctx *mm, unsigned int T)
@@ -226,7 +226,7 @@ static void mmctx_timer_stop(struct sgsn_mm_ctx *mm, unsigned int T)
if (mm->T != T)
LOGP(DMM, LOGL_ERROR, "Stopping MM timer %u but "
"%u is running\n", T, mm->T);
bsc_del_timer(&mm->timer);
osmo_timer_del(&mm->timer);
}
/* Send a message through the underlying layer */
@@ -463,7 +463,7 @@ static int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm, uint8_t *rand,
uint8_t *m_rand, *m_cksn;
DEBUGP(DMM, "<- GPRS AUTH AND CIPHERING REQ (rand = %s)\n",
hexdump(rand, 16));
osmo_hexdump(rand, 16));
mmctx2msgid(msg, mm);
@@ -1087,7 +1087,7 @@ static void mmctx_timer_cb(void *_mm)
/* FIXME */
break;
}
bsc_schedule_timer(&mm->timer, GSM0408_T3350_SECS, 0);
osmo_timer_schedule(&mm->timer, GSM0408_T3350_SECS, 0);
break;
case 3360: /* waiting for AUTH AND CIPH RESP */
if (mm->num_T_exp >= 5) {
@@ -1096,7 +1096,7 @@ static void mmctx_timer_cb(void *_mm)
break;
}
/* FIXME: re-transmit the respective msg and re-start timer */
bsc_schedule_timer(&mm->timer, GSM0408_T3360_SECS, 0);
osmo_timer_schedule(&mm->timer, GSM0408_T3360_SECS, 0);
break;
case 3370: /* waiting for IDENTITY RESPONSE */
if (mm->num_T_exp >= 5) {
@@ -1107,7 +1107,7 @@ static void mmctx_timer_cb(void *_mm)
}
/* re-tranmit IDENTITY REQUEST and re-start timer */
gsm48_tx_gmm_id_req(mm, mm->t3370_id_type);
bsc_schedule_timer(&mm->timer, GSM0408_T3370_SECS, 0);
osmo_timer_schedule(&mm->timer, GSM0408_T3370_SECS, 0);
break;
default:
LOGP(DMM, LOGL_ERROR, "timer expired in unknown mode %u\n",
@@ -1122,7 +1122,7 @@ static void pdpctx_timer_cb(void *_mm);
static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T,
unsigned int seconds)
{
if (bsc_timer_pending(&pdp->timer))
if (osmo_timer_pending(&pdp->timer))
LOGP(DMM, LOGL_ERROR, "Starting MM timer %u while old "
"timer %u pending\n", T, pdp->T);
pdp->T = T;
@@ -1132,7 +1132,7 @@ static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T,
pdp->timer.data = pdp;
pdp->timer.cb = &pdpctx_timer_cb;
bsc_schedule_timer(&pdp->timer, seconds, 0);
osmo_timer_schedule(&pdp->timer, seconds, 0);
}
@@ -1457,7 +1457,7 @@ static void pdpctx_timer_cb(void *_pdp)
break;
}
gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL);
bsc_schedule_timer(&pdp->timer, GSM0408_T3395_SECS, 0);
osmo_timer_schedule(&pdp->timer, GSM0408_T3395_SECS, 0);
break;
default:
LOGP(DMM, LOGL_ERROR, "timer expired in unknown mode %u\n",

View File

@@ -22,10 +22,10 @@
#include <errno.h>
#include <stdint.h>
#include <osmocore/msgb.h>
#include <osmocore/linuxlist.h>
#include <osmocore/timer.h>
#include <osmocore/talloc.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/talloc.h>
#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>

View File

@@ -27,11 +27,11 @@
#include <arpa/inet.h>
#include <openbsc/gsm_data.h>
#include <osmocore/msgb.h>
#include <osmocore/tlv.h>
#include <osmocore/talloc.h>
#include <osmocore/select.h>
#include <osmocore/rate_ctr.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/signal.h>
#include <openbsc/gprs_llc.h>

View File

@@ -21,10 +21,10 @@
#include <stdint.h>
#include <osmocore/linuxlist.h>
#include <osmocore/talloc.h>
#include <osmocore/timer.h>
#include <osmocore/rate_ctr.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/rate_ctr.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/debug.h>
#include <openbsc/gprs_sgsn.h>

View File

@@ -23,10 +23,10 @@
#include <errno.h>
#include <stdint.h>
#include <osmocore/msgb.h>
#include <osmocore/linuxlist.h>
#include <osmocore/timer.h>
#include <osmocore/talloc.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/talloc.h>
#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>

View File

@@ -2,7 +2,7 @@
#define _INT_SNDCP_H
#include <stdint.h>
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
/* A fragment queue header, maintaining list of fragments for one N-PDU */
struct defrag_state {
@@ -20,7 +20,7 @@ struct defrag_state {
/* linked list of defrag_queue_entry: one for each fragment */
struct llist_head frag_list;
struct timer_list timer;
struct osmo_timer_list timer;
};
/* See 6.7.1.2 Reassembly */

View File

@@ -27,11 +27,11 @@
#include <arpa/inet.h>
#include <openbsc/gsm_data.h>
#include <osmocore/msgb.h>
#include <osmocore/tlv.h>
#include <osmocore/talloc.h>
#include <osmocore/select.h>
#include <osmocore/rate_ctr.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/signal.h>
#include <openbsc/gprs_llc.h>

View File

@@ -29,14 +29,13 @@
#include <signal.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocore/talloc.h>
#include <osmocore/select.h>
#include <osmocore/rate_ctr.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/signal.h>
@@ -506,7 +505,7 @@ int sgsn_rx_sndcp_ud_ind(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
}
/* libgtp select loop integration */
static int sgsn_gtp_fd_cb(struct bsc_fd *fd, unsigned int what)
static int sgsn_gtp_fd_cb(struct osmo_fd *fd, unsigned int what)
{
struct sgsn_instance *sgi = fd->data;
int rc;
@@ -539,7 +538,7 @@ static void sgsn_gtp_tmr_start(struct sgsn_instance *sgi)
gtp_retranstimeout(sgi->gsn, &next);
/* re-schedule the timer */
bsc_schedule_timer(&sgi->gtp_timer, next.tv_sec, next.tv_usec/1000);
osmo_timer_schedule(&sgi->gtp_timer, next.tv_sec, next.tv_usec/1000);
}
/* timer callback for libgtp retransmissions and ping */
@@ -571,7 +570,7 @@ int sgsn_gtp_init(struct sgsn_instance *sgi)
sgi->gtp_fd0.data = sgi;
sgi->gtp_fd0.when = BSC_FD_READ;
sgi->gtp_fd0.cb = sgsn_gtp_fd_cb;
rc = bsc_register_fd(&sgi->gtp_fd0);
rc = osmo_fd_register(&sgi->gtp_fd0);
if (rc < 0)
return rc;
@@ -580,7 +579,7 @@ int sgsn_gtp_init(struct sgsn_instance *sgi)
sgi->gtp_fd1c.data = sgi;
sgi->gtp_fd1c.when = BSC_FD_READ;
sgi->gtp_fd1c.cb = sgsn_gtp_fd_cb;
bsc_register_fd(&sgi->gtp_fd1c);
osmo_fd_register(&sgi->gtp_fd1c);
if (rc < 0)
return rc;
@@ -589,7 +588,7 @@ int sgsn_gtp_init(struct sgsn_instance *sgi)
sgi->gtp_fd1u.data = sgi;
sgi->gtp_fd1u.when = BSC_FD_READ;
sgi->gtp_fd1u.cb = sgsn_gtp_fd_cb;
bsc_register_fd(&sgi->gtp_fd1u);
osmo_fd_register(&sgi->gtp_fd1u);
if (rc < 0)
return rc;

View File

@@ -28,18 +28,19 @@
#include <signal.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocore/talloc.h>
#include <osmocore/select.h>
#include <osmocore/rate_ctr.h>
#include <osmocore/logging.h>
#include <osmocore/process.h>
#include <osmocom/core/application.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/process.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
#include <openbsc/signal.h>
#include <openbsc/debug.h>
@@ -62,7 +63,6 @@ void subscr_put() { abort(); }
void *tall_bsc_ctx;
struct gprs_ns_inst *sgsn_nsi;
static struct log_target *stderr_target;
static int daemonize = 0;
const char *openbsc_copyright =
"Copyright (C) 2010 Harald Welte and On-Waves\r\n"
@@ -80,7 +80,7 @@ struct sgsn_instance *sgsn = &sgsn_inst;
/* call-back function for the NS protocol */
static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
struct msgb *msg, u_int16_t bvci)
struct msgb *msg, uint16_t bvci)
{
int rc = 0;
@@ -105,7 +105,7 @@ static void signal_handler(int signal)
switch (signal) {
case SIGINT:
dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
sleep(1);
exit(0);
break;
@@ -174,10 +174,10 @@ static void handle_options(int argc, char **argv)
print_help();
exit(0);
case 's':
log_set_use_color(stderr_target, 0);
log_set_use_color(osmo_stderr_target, 0);
break;
case 'd':
log_parse_category_mask(stderr_target, optarg);
log_parse_category_mask(osmo_stderr_target, optarg);
break;
case 'D':
daemonize = 1;
@@ -186,10 +186,10 @@ static void handle_options(int argc, char **argv)
sgsn_inst.config_file = strdup(optarg);
break;
case 'T':
log_set_print_timestamp(stderr_target, 1);
log_set_print_timestamp(osmo_stderr_target, 1);
break;
case 'e':
log_set_log_level(stderr_target, atoi(optarg));
log_set_log_level(osmo_stderr_target, atoi(optarg));
break;
default:
/* ignore */
@@ -211,16 +211,13 @@ int main(int argc, char **argv)
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);
signal(SIGUSR2, &signal_handler);
signal(SIGPIPE, SIG_IGN);
log_init(&log_info);
stderr_target = log_target_create_stderr();
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
osmo_init_ignore_signals();
osmo_init_logging(&log_info);
vty_info.copyright = openbsc_copyright;
vty_init(&vty_info);
logging_vty_add_cmds();
logging_vty_add_cmds(&log_info);
sgsn_vty_init();
handle_options(argc, argv);
@@ -279,7 +276,7 @@ int main(int argc, char **argv)
}
while (1) {
rc = bsc_select_main(0);
rc = osmo_select_main(0);
if (rc < 0)
exit(3);
}

View File

@@ -18,14 +18,13 @@
*
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocore/talloc.h>
#include <osmocore/utils.h>
#include <osmocore/rate_ctr.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/sgsn.h>
@@ -36,6 +35,7 @@
#include <osmocom/vty/command.h>
#include <osmocom/vty/vty.h>
#include <osmocom/vty/misc.h>
#include <pdp.h>

View File

@@ -1,9 +1,15 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
bin_PROGRAMS = ipaccess-find ipaccess-config ipaccess-proxy
ipaccess_find_LDADD = $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libabis/libabis.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a
ipaccess_find_SOURCES = ipaccess-find.c
ipaccess_config_SOURCES = ipaccess-config.c ipaccess-firmware.c network_listen.c
@@ -18,4 +24,9 @@ ipaccess_config_LDADD = $(top_builddir)/src/libbsc/libbsc.a \
-ldl -ldbi $(LIBCRYPT)
ipaccess_proxy_SOURCES = ipaccess-proxy.c
ipaccess_proxy_LDADD = $(top_builddir)/src/libcommon/libcommon.a
ipaccess_proxy_LDADD = $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libabis/libabis.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a

View File

@@ -37,7 +37,7 @@ bin_PROGRAMS = ipaccess-find$(EXEEXT) ipaccess-config$(EXEEXT) \
subdir = src/ipaccess
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -57,10 +57,19 @@ ipaccess_config_DEPENDENCIES = $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon/libcommon.a
am_ipaccess_find_OBJECTS = ipaccess-find.$(OBJEXT)
ipaccess_find_OBJECTS = $(am_ipaccess_find_OBJECTS)
ipaccess_find_LDADD = $(LDADD)
ipaccess_find_DEPENDENCIES = $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libabis/libabis.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a
am_ipaccess_proxy_OBJECTS = ipaccess-proxy.$(OBJEXT)
ipaccess_proxy_OBJECTS = $(am_ipaccess_proxy_OBJECTS)
ipaccess_proxy_DEPENDENCIES = \
ipaccess_proxy_DEPENDENCIES = $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libabis/libabis.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -122,6 +131,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
@@ -191,8 +202,15 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
ipaccess_find_LDADD = $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libabis/libabis.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a
ipaccess_find_SOURCES = ipaccess-find.c
ipaccess_config_SOURCES = ipaccess-config.c ipaccess-firmware.c network_listen.c
@@ -206,7 +224,13 @@ ipaccess_config_LDADD = $(top_builddir)/src/libbsc/libbsc.a \
-ldl -ldbi $(LIBCRYPT)
ipaccess_proxy_SOURCES = ipaccess-proxy.c
ipaccess_proxy_LDADD = $(top_builddir)/src/libcommon/libcommon.a
ipaccess_proxy_LDADD = $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libabis/libabis.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a
all: all-am
.SUFFIXES:

View File

@@ -1,7 +1,7 @@
/* ip.access nanoBTS configuration tool */
/* (C) 2009-2010 by Harald Welte <laforge@gnumonks.org>
* (C) 2009-2010 by Holger Hans Peter Freyther
* (C) 2009-2011 by Holger Hans Peter Freyther
* (C) 2009-2010 by On-Waves
* All Rights Reserved
*
@@ -28,15 +28,15 @@
#include <errno.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocore/select.h>
#include <osmocore/timer.h>
#include <osmocom/core/application.h>
#include <osmocom/core/select.h>
#include <osmocom/core/timer.h>
#include <openbsc/ipaccess.h>
#include <openbsc/gsm_data.h>
#include <openbsc/e1_input.h>
@@ -44,7 +44,7 @@
#include <openbsc/signal.h>
#include <openbsc/debug.h>
#include <openbsc/network_listen.h>
#include <osmocore/talloc.h>
#include <osmocom/core/talloc.h>
static struct gsm_network *gsmnet;
@@ -53,21 +53,22 @@ static int restart;
static char *prim_oml_ip;
static char *bts_ip_addr, *bts_ip_mask, *bts_ip_gw;
static char *unit_id;
static u_int16_t nv_flags;
static u_int16_t nv_mask;
static uint16_t nv_flags;
static uint16_t nv_mask;
static char *software = NULL;
static int sw_load_state = 0;
static int oml_state = 0;
static int dump_files = 0;
static char *firmware_analysis = NULL;
static int found_trx = 0;
static int loop_tests = 0;
struct sw_load {
u_int8_t file_id[255];
u_int8_t file_id_len;
uint8_t file_id[255];
uint8_t file_id_len;
u_int8_t file_version[255];
u_int8_t file_version_len;
uint8_t file_version[255];
uint8_t file_version_len;
};
static void *tall_ctx_config = NULL;
@@ -75,8 +76,8 @@ static struct sw_load *sw_load1 = NULL;
static struct sw_load *sw_load2 = NULL;
/*
static u_int8_t prim_oml_attr[] = { 0x95, 0x00, 7, 0x88, 192, 168, 100, 11, 0x00, 0x00 };
static u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', '/', '0', 0x00 };
static uint8_t prim_oml_attr[] = { 0x95, 0x00, 7, 0x88, 192, 168, 100, 11, 0x00, 0x00 };
static uint8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', '/', '0', 0x00 };
*/
/*
@@ -86,7 +87,7 @@ static u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0',
* result. The nanoBTS will send us a NACK when we did something the
* BTS didn't like.
*/
static int ipacc_msg_nack(u_int8_t mt)
static int ipacc_msg_nack(uint8_t mt)
{
fprintf(stderr, "Failure to set attribute. This seems fatal\n");
exit(-1);
@@ -102,7 +103,7 @@ static void check_restart_or_exit(struct gsm_bts_trx *trx)
}
}
static int ipacc_msg_ack(u_int8_t mt, struct gsm_bts_trx *trx)
static int ipacc_msg_ack(uint8_t mt, struct gsm_bts_trx *trx)
{
if (sw_load_state == 1) {
fprintf(stderr, "The new software is activaed.\n");
@@ -129,7 +130,7 @@ static uint16_t build_physconf(uint8_t *physconf_buf, const struct rxlev_stats *
num_arfcn = ipac_rxlevstat2whitelist(whitelist, st, 0, 100);
arfcnlist_size = num_arfcn * 2;
*((uint16_t *) (physconf_buf+2)) = htons(arfcnlist_size);
DEBUGP(DNM, "physconf_buf (%s)\n", hexdump(physconf_buf, arfcnlist_size+4));
DEBUGP(DNM, "physconf_buf (%s)\n", osmo_hexdump(physconf_buf, arfcnlist_size+4));
return arfcnlist_size+4;
}
@@ -166,14 +167,14 @@ static int nwl_sig_cb(unsigned int subsys, unsigned int signal,
physconf_buf, physconf_len);
break;
case NM_IPACC_TESTNO_BCCH_INFO:
#if 0
/* re-start full process with CHAN_USAGE */
DEBUGP(DNM, "starting next test cycle\n");
ipac_nwl_test_start(trx, net_listen_testnr, phys_conf_min,
sizeof(phys_conf_min));
#else
exit(0);
#endif
if (loop_tests) {
DEBUGP(DNM, "starting next test cycle\n");
ipac_nwl_test_start(trx, net_listen_testnr, phys_conf_min,
sizeof(phys_conf_min));
} else {
exit(0);
}
break;
}
break;
@@ -181,7 +182,7 @@ static int nwl_sig_cb(unsigned int subsys, unsigned int signal,
return 0;
}
static int nm_state_event(int evt, u_int8_t obj_class, void *obj,
static int nm_state_event(int evt, uint8_t obj_class, void *obj,
struct gsm_nm_state *old_state, struct gsm_nm_state *new_state,
struct abis_om_obj_inst *obj_inst);
@@ -348,6 +349,36 @@ static void nv_put_flags(struct msgb *nmsg, uint16_t nv_flags, uint16_t nv_mask)
msgb_put_u8(nmsg, nv_mask >> 8);
}
/* human-readable test names for the ip.access tests */
static const struct value_string ipa_test_strs[] = {
{ 64, "ccch-usage" },
{ 65, "bcch-usage" },
{ 66, "freq-sync" },
{ 67, "rtp-usage" },
{ 68, "rtp-perf" },
{ 69, "gprs-ccch" },
{ 70, "pccch-usage" },
{ 71, "gprs-usage" },
{ 72, "esta-mf" },
{ 73, "uplink-mf" },
{ 74, "dolink-mf" },
{ 75, "tbf-details" },
{ 76, "tbf-usage" },
{ 77, "llc-data" },
{ 78, "pdch-usage" },
{ 79, "power-control" },
{ 80, "link-adaption" },
{ 81, "tch-usage" },
{ 82, "amr-mf" },
{ 83, "rtp-multiplex-perf" },
{ 84, "rtp-multiplex-usage" },
{ 85, "srtp-multiplex-usage" },
{ 86, "abis-traffic" },
{ 89, "gprs-multiplex-perf" },
{ 90, "gprs-multiplex-usage" },
{ 0, NULL },
};
/* human-readable names for the ip.access nanoBTS NVRAM Flags */
static const struct value_string ipa_nvflag_strs[] = {
{ 0x0001, "static-ip" },
@@ -464,7 +495,7 @@ out_err:
msgb_free(nmsg);
}
static int nm_state_event(int evt, u_int8_t obj_class, void *obj,
static int nm_state_event(int evt, uint8_t obj_class, void *obj,
struct gsm_nm_state *old_state, struct gsm_nm_state *new_state,
struct abis_om_obj_inst *obj_inst)
{
@@ -691,13 +722,37 @@ static void print_help(void)
printf(" -S --nvattr-set FLAG\tSet one additional NVRAM attribute\n");
printf(" -U --nvattr-unset FLAG\tSet one additional NVRAM attribute\n");
printf(" -l --listen TESTNR\t\tPerform specified test number\n");
printf(" -L --Listen TEST_NAME\t\tPerform specified test\n");
printf(" -s --stream-id ID\t\tSet the IPA Stream Identifier for OML\n");
printf(" -d --software FIRMWARE\tDownload firmware into BTS\n");
printf("\n");
printf("Miscellaneous commands:\n");
printf(" -h --help\t\t\tthis text\n");
printf(" -H --HELP\t\t\tPrint parameter details.\n");
printf(" -f --firmware FIRMWARE\tProvide firmware information\n");
printf(" -w --write-firmware\t\tThis will dump the firmware parts to the filesystem. Use with -f.\n");
printf(" -p --loop\t\t\tLoop the tests executed with the --listen command.\n");
}
static void print_value_string(const struct value_string *val, int size)
{
int i;
for (i = 0; i < size - 1; ++i) {
char sep = val[i + 1].str == NULL ? '.' : ',';
printf("%s%c ", val[i].str, sep);
}
printf("\n");
}
static void print_options(void)
{
printf("Options for NVRAM (-S,-U):\n ");
print_value_string(&ipa_nvflag_strs[0], ARRAY_SIZE(ipa_nvflag_strs));
printf("Options for Tests (-L):\n ");
print_value_string(&ipa_test_strs[0], ARRAY_SIZE(ipa_test_strs));
}
extern void bts_model_nanobts_init();
@@ -707,14 +762,9 @@ int main(int argc, char **argv)
struct gsm_bts *bts;
struct sockaddr_in sin;
int rc, option_index = 0, stream_id = 0xff;
struct log_target *stderr_target;
log_init(&log_info);
stderr_target = log_target_create_stderr();
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
log_set_log_level(stderr_target, 0);
log_parse_category_mask(stderr_target, "DNM,0");
osmo_init_logging(&log_info);
log_parse_category_mask(osmo_stderr_target, "DNM,0");
bts_model_nanobts_init();
printf("ipaccess-config (C) 2009-2010 by Harald Welte and others\n");
@@ -734,16 +784,19 @@ int main(int argc, char **argv)
{ "nvattr-set", 1, 0, 'S' },
{ "nvattr-unset", 1, 0, 'U' },
{ "help", 0, 0, 'h' },
{ "HELP", 0, 0, 'H' },
{ "listen", 1, 0, 'l' },
{ "Listen", 1, 0, 'L' },
{ "stream-id", 1, 0, 's' },
{ "software", 1, 0, 'd' },
{ "firmware", 1, 0, 'f' },
{ "write-firmware", 0, 0, 'w' },
{ "disable-color", 0, 0, 'c'},
{ "loop", 0, 0, 'p' },
{ 0, 0, 0, 0 },
};
c = getopt_long(argc, argv, "u:o:i:g:rn:S:U:l:hs:d:f:wc", long_options,
c = getopt_long(argc, argv, "u:o:i:g:rn:S:U:l:L:hs:d:f:wcpH", long_options,
&option_index);
if (c == -1)
@@ -790,6 +843,15 @@ int main(int argc, char **argv)
case 'l':
net_listen_testnr = atoi(optarg);
break;
case 'L':
net_listen_testnr = get_string_value(ipa_test_strs,
optarg);
if (net_listen_testnr < 0) {
fprintf(stderr,
"The test '%s' is not known. Use -H to"
" see available tests.\n", optarg);
exit(2);
}
case 's':
stream_id = atoi(optarg);
break;
@@ -805,12 +867,18 @@ int main(int argc, char **argv)
dump_files = 1;
break;
case 'c':
log_set_use_color(stderr_target, 0);
log_set_use_color(osmo_stderr_target, 0);
break;
case 'p':
loop_tests = 1;
break;
case 'h':
print_usage();
print_help();
exit(0);
case 'H':
print_options();
exit(0);
}
};
@@ -828,16 +896,16 @@ int main(int argc, char **argv)
if (!gsmnet)
exit(1);
bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_NANOBTS, HARDCODED_TSC,
HARDCODED_BSIC);
bts = gsm_bts_alloc_register(gsmnet, GSM_BTS_TYPE_NANOBTS, HARDCODED_TSC,
HARDCODED_BSIC);
/* ip.access supports up to 4 chained TRX */
gsm_bts_trx_alloc(bts);
gsm_bts_trx_alloc(bts);
gsm_bts_trx_alloc(bts);
bts->oml_tei = stream_id;
register_signal_handler(SS_NM, nm_sig_cb, NULL);
register_signal_handler(SS_IPAC_NWL, nwl_sig_cb, NULL);
osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL);
osmo_signal_register_handler(SS_IPAC_NWL, nwl_sig_cb, NULL);
ipac_nwl_init();
@@ -855,7 +923,7 @@ int main(int argc, char **argv)
bts->oml_link->ts->sign.delay = 10;
bts->c0->rsl_link->ts->sign.delay = 10;
while (1) {
rc = bsc_select_main(0);
rc = osmo_select_main(0);
if (rc < 0)
exit(3);
}

View File

@@ -21,37 +21,16 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocore/select.h>
#include <osmocore/timer.h>
#include <osmocom/core/select.h>
#include <osmocom/core/timer.h>
#include <openbsc/ipaccess.h>
#include <openbsc/gsm_data.h>
static const char *idtag_names[] = {
[IPAC_IDTAG_SERNR] = "Serial Number",
[IPAC_IDTAG_UNITNAME] = "Unit Name",
[IPAC_IDTAG_LOCATION1] = "Location 1",
[IPAC_IDTAG_LOCATION2] = "Location 2",
[IPAC_IDTAG_EQUIPVERS] = "Equipment Version",
[IPAC_IDTAG_SWVERSION] = "Software Version",
[IPAC_IDTAG_IPADDR] = "IP Address",
[IPAC_IDTAG_MACADDR] = "MAC Address",
[IPAC_IDTAG_UNIT] = "Unit ID",
};
static const char *ipac_idtag_name(int tag)
{
if (tag >= ARRAY_SIZE(idtag_names))
return "unknown";
return idtag_names[tag];
}
static int udp_sock(const char *ifname)
{
int fd, rc, bc = 1;
@@ -125,15 +104,15 @@ static int bcast_find(int fd)
static int parse_response(unsigned char *buf, int len)
{
u_int8_t t_len;
u_int8_t t_tag;
u_int8_t *cur = buf;
uint8_t t_len;
uint8_t t_tag;
uint8_t *cur = buf;
while (cur < buf + len) {
t_len = *cur++;
t_tag = *cur++;
printf("%s='%s' ", ipac_idtag_name(t_tag), cur);
printf("%s='%s' ", ipaccess_idtag_name(t_tag), cur);
cur += t_len;
}
@@ -162,7 +141,7 @@ static int read_response(int fd)
return parse_response(buf+6, len-6);
}
static int bfd_cb(struct bsc_fd *bfd, unsigned int flags)
static int bfd_cb(struct osmo_fd *bfd, unsigned int flags)
{
if (flags & BSC_FD_READ)
return read_response(bfd->fd);
@@ -173,21 +152,21 @@ static int bfd_cb(struct bsc_fd *bfd, unsigned int flags)
return 0;
}
static struct timer_list timer;
static struct osmo_timer_list timer;
static void timer_cb(void *_data)
{
struct bsc_fd *bfd = _data;
struct osmo_fd *bfd = _data;
bfd->when |= BSC_FD_WRITE;
bsc_schedule_timer(&timer, 5, 0);
osmo_timer_schedule(&timer, 5, 0);
}
int main(int argc, char **argv)
{
struct bsc_fd bfd;
char *ifname;
struct osmo_fd bfd;
char *ifname = NULL;
int rc;
printf("ipaccess-find (C) 2009 by Harald Welte\n");
@@ -196,9 +175,10 @@ int main(int argc, char **argv)
if (argc < 2) {
fprintf(stdout, "you might need to specify the outgoing\n"
" network interface, e.g. ``%s eth0''\n", argv[0]);
} else {
ifname = argv[1];
}
ifname = argv[1];
bfd.cb = bfd_cb;
bfd.when = BSC_FD_READ | BSC_FD_WRITE;
bfd.fd = udp_sock(ifname);
@@ -207,17 +187,17 @@ int main(int argc, char **argv)
exit(1);
}
bsc_register_fd(&bfd);
osmo_fd_register(&bfd);
timer.cb = timer_cb;
timer.data = &bfd;
bsc_schedule_timer(&timer, 5, 0);
osmo_timer_schedule(&timer, 5, 0);
printf("Trying to find ip.access BTS by broadcast UDP...\n");
while (1) {
rc = bsc_select_main(0);
rc = osmo_select_main(0);
if (rc < 0)
exit(3);
}

View File

@@ -20,7 +20,7 @@
#include <openbsc/debug.h>
#include <openbsc/ipaccess.h>
#include <osmocore/talloc.h>
#include <osmocom/core/talloc.h>
#include <stdio.h>
#include <stdlib.h>
@@ -29,8 +29,8 @@
#define PART_LENGTH 138
static_assert(sizeof(struct sdp_header_entry) == 138, right_entry);
static_assert(sizeof(struct sdp_firmware) == 158, _right_header_length);
osmo_static_assert(sizeof(struct sdp_header_entry) == 138, right_entry);
osmo_static_assert(sizeof(struct sdp_firmware) == 158, _right_header_length);
/* more magic, the second "int" in the header */
static char more_magic[] = { 0x10, 0x02 };
@@ -41,8 +41,8 @@ int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned int
struct sdp_header *header;
char buf[4096];
int rc, i;
u_int16_t table_size;
u_int16_t table_offset;
uint16_t table_size;
uint16_t table_offset;
off_t table_start;

View File

@@ -29,7 +29,6 @@
#include <signal.h>
#include <time.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
@@ -39,25 +38,25 @@
#include <getopt.h>
#include <openbsc/gsm_data.h>
#include <osmocore/select.h>
#include <osmocore/tlv.h>
#include <osmocore/msgb.h>
#include <osmocom/core/application.h>
#include <osmocom/core/select.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/msgb.h>
#include <openbsc/debug.h>
#include <openbsc/ipaccess.h>
#include <osmocore/talloc.h>
static struct log_target *stderr_target;
#include <openbsc/socket.h>
#include <osmocom/core/talloc.h>
/* one instance of an ip.access protocol proxy */
struct ipa_proxy {
/* socket where we listen for incoming OML from BTS */
struct bsc_fd oml_listen_fd;
struct osmo_fd oml_listen_fd;
/* socket where we listen for incoming RSL from BTS */
struct bsc_fd rsl_listen_fd;
struct osmo_fd rsl_listen_fd;
/* list of BTS's (struct ipa_bts_conn */
struct llist_head bts_list;
/* the BSC reconnect timer */
struct timer_list reconn_timer;
struct osmo_timer_list reconn_timer;
/* global GPRS NS data */
struct in_addr gprs_addr;
struct in_addr listen_addr;
@@ -67,7 +66,7 @@ struct ipa_proxy {
static struct ipa_proxy *ipp;
struct ipa_proxy_conn {
struct bsc_fd fd;
struct osmo_fd fd;
struct llist_head tx_queue;
struct ipa_bts_conn *bts_conn;
};
@@ -81,8 +80,8 @@ struct ipa_bts_conn {
struct ipa_proxy *ipp;
/* the unit ID as determined by CCM */
struct {
u_int16_t site_id;
u_int16_t bts_id;
uint16_t site_id;
uint16_t bts_id;
} unit_id;
/* incoming connections from BTS */
@@ -94,18 +93,18 @@ struct ipa_bts_conn {
struct ipa_proxy_conn *bsc_rsl_conn[MAX_TRX];
/* UDP sockets for BTS and BSC injection */
struct bsc_fd udp_bts_fd;
struct bsc_fd udp_bsc_fd;
struct osmo_fd udp_bts_fd;
struct osmo_fd udp_bsc_fd;
/* NS data */
struct in_addr bts_addr;
struct bsc_fd gprs_ns_fd;
struct osmo_fd gprs_ns_fd;
int gprs_local_port;
uint16_t gprs_orig_port;
uint32_t gprs_orig_ip;
char *id_tags[0xff];
u_int8_t *id_resp;
uint8_t *id_resp;
unsigned int id_resp_len;
};
@@ -125,104 +124,13 @@ static char *listen_ipaddr;
static char *bsc_ipaddr;
static char *gprs_ns_ipaddr;
static int make_gprs_sock(struct bsc_fd *bfd, int (*cb)(struct bsc_fd*,unsigned int), void *);
static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what);
static int gprs_ns_cb(struct osmo_fd *bfd, unsigned int what);
#define PROXY_ALLOC_SIZE 1200
static const u_int8_t pong[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_PONG };
static const u_int8_t id_ack[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_ACK };
static const u_int8_t id_req[] = { 0, 17, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_GET,
0x01, IPAC_IDTAG_UNIT,
0x01, IPAC_IDTAG_MACADDR,
0x01, IPAC_IDTAG_LOCATION1,
0x01, IPAC_IDTAG_LOCATION2,
0x01, IPAC_IDTAG_EQUIPVERS,
0x01, IPAC_IDTAG_SWVERSION,
0x01, IPAC_IDTAG_UNITNAME,
0x01, IPAC_IDTAG_SERNR,
};
static const char *idtag_names[] = {
[IPAC_IDTAG_SERNR] = "Serial_Number",
[IPAC_IDTAG_UNITNAME] = "Unit_Name",
[IPAC_IDTAG_LOCATION1] = "Location_1",
[IPAC_IDTAG_LOCATION2] = "Location_2",
[IPAC_IDTAG_EQUIPVERS] = "Equipment_Version",
[IPAC_IDTAG_SWVERSION] = "Software_Version",
[IPAC_IDTAG_IPADDR] = "IP_Address",
[IPAC_IDTAG_MACADDR] = "MAC_Address",
[IPAC_IDTAG_UNIT] = "Unit_ID",
};
static const char *ipac_idtag_name(int tag)
{
if (tag >= ARRAY_SIZE(idtag_names))
return "unknown";
return idtag_names[tag];
}
static int ipac_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len)
{
u_int8_t t_len;
u_int8_t t_tag;
u_int8_t *cur = buf;
while (cur < buf + len) {
t_len = *cur++;
t_tag = *cur++;
DEBUGPC(DMI, "%s='%s' ", ipac_idtag_name(t_tag), cur);
dec->lv[t_tag].len = t_len;
dec->lv[t_tag].val = cur;
cur += t_len;
}
return 0;
}
static int parse_unitid(const char *str, u_int16_t *site_id, u_int16_t *bts_id,
u_int16_t *trx_id)
{
unsigned long ul;
char *endptr;
const char *nptr;
nptr = str;
ul = strtoul(nptr, &endptr, 10);
if (endptr <= nptr)
return -EINVAL;
if (site_id)
*site_id = ul & 0xffff;
if (*endptr++ != '/')
return -EINVAL;
nptr = endptr;
ul = strtoul(nptr, &endptr, 10);
if (endptr <= nptr)
return -EINVAL;
if (bts_id)
*bts_id = ul & 0xffff;
if (*endptr++ != '/')
return -EINVAL;
nptr = endptr;
ul = strtoul(nptr, &endptr, 10);
if (endptr <= nptr)
return -EINVAL;
if (trx_id)
*trx_id = ul & 0xffff;
return 0;
}
static struct ipa_bts_conn *find_bts_by_unitid(struct ipa_proxy *ipp,
u_int16_t site_id,
u_int16_t bts_id)
uint16_t site_id,
uint16_t bts_id)
{
struct ipa_bts_conn *ipbc;
@@ -279,7 +187,7 @@ static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, v
#define logp_ipbc_uid(ss, lvl, ipbc, trx_id) _logp_ipbc_uid(ss, lvl, __FILE__, __LINE__, ipbc, trx_id)
static void _logp_ipbc_uid(unsigned int ss, unsigned int lvl, char *file, int line,
struct ipa_bts_conn *ipbc, u_int8_t trx_id)
struct ipa_bts_conn *ipbc, uint8_t trx_id)
{
if (ipbc)
logp2(ss, lvl, file, line, 0, "(%u/%u/%u) ", ipbc->unit_id.site_id,
@@ -288,44 +196,7 @@ static void _logp_ipbc_uid(unsigned int ss, unsigned int lvl, char *file, int li
logp2(ss, lvl, file, line, 0, "unknown ");
}
/* UDP socket handling */
static int make_sock(struct bsc_fd *bfd, u_int16_t port, int proto, int priv_nr,
int (*cb)(struct bsc_fd *fd, unsigned int what),
void *data)
{
struct sockaddr_in addr;
int ret, on = 1;
bfd->fd = socket(AF_INET, SOCK_DGRAM, proto);
bfd->cb = cb;
bfd->when = BSC_FD_READ;
bfd->data = data;
bfd->priv_nr = priv_nr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = INADDR_ANY;
setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr));
if (ret < 0) {
LOGP(DINP, LOGL_ERROR, "could not bind socket: %s\n",
strerror(errno));
return -EIO;
}
ret = bsc_register_fd(bfd);
if (ret < 0) {
perror("register UDP fd");
return ret;
}
return 0;
}
static int handle_udp_read(struct bsc_fd *bfd)
static int handle_udp_read(struct osmo_fd *bfd)
{
struct ipa_bts_conn *ipbc = bfd->data;
struct ipa_proxy_conn *other_conn = NULL;
@@ -345,7 +216,7 @@ static int handle_udp_read(struct bsc_fd *bfd)
}
if (ret == 0) {
DEBUGP(DINP, "UDP peer disappeared, dead socket\n");
bsc_unregister_fd(bfd);
osmo_fd_unregister(bfd);
close(bfd->fd);
bfd->fd = -1;
msgb_free(msg);
@@ -358,7 +229,7 @@ static int handle_udp_read(struct bsc_fd *bfd)
}
msgb_put(msg, ret);
msg->l2h = msg->data + sizeof(*hh);
DEBUGP(DMI, "UDP RX: %s\n", hexdump(msg->data, msg->len));
DEBUGP(DMI, "UDP RX: %s\n", osmo_hexdump(msg->data, msg->len));
if (hh->len != msg->len - sizeof(*hh)) {
DEBUGP(DINP, "length (%u/%u) disagrees with header(%u)\n",
@@ -416,7 +287,7 @@ static int handle_udp_read(struct bsc_fd *bfd)
return 0;
}
static int handle_udp_write(struct bsc_fd *bfd)
static int handle_udp_write(struct osmo_fd *bfd)
{
/* not implemented yet */
bfd->when &= ~BSC_FD_WRITE;
@@ -425,7 +296,7 @@ static int handle_udp_write(struct bsc_fd *bfd)
}
/* callback from select.c in case one of the fd's can be read/written */
static int udp_fd_cb(struct bsc_fd *bfd, unsigned int what)
static int udp_fd_cb(struct osmo_fd *bfd, unsigned int what)
{
int rc = 0;
@@ -438,13 +309,13 @@ static int udp_fd_cb(struct bsc_fd *bfd, unsigned int what)
}
static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd,
u_int16_t site_id, u_int16_t bts_id,
u_int16_t trx_id, struct tlv_parsed *tlvp,
static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct osmo_fd *bfd,
uint16_t site_id, uint16_t bts_id,
uint16_t trx_id, struct tlv_parsed *tlvp,
struct msgb *msg)
{
struct ipa_bts_conn *ipbc;
u_int16_t udp_port;
uint16_t udp_port;
int ret = 0;
struct sockaddr_in sin;
@@ -494,7 +365,7 @@ static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd,
/* Create UDP socket for BTS packet injection */
udp_port = 10000 + (site_id % 1000)*100 + (bts_id % 100);
ret = make_sock(&ipbc->udp_bts_fd, udp_port, IPPROTO_UDP,
ret = make_sock(&ipbc->udp_bts_fd, IPPROTO_UDP, INADDR_ANY, udp_port,
UDP_TO_BTS, udp_fd_cb, ipbc);
if (ret < 0)
goto err_udp_bts;
@@ -503,7 +374,7 @@ static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd,
/* Create UDP socket for BSC packet injection */
udp_port = 20000 + (site_id % 1000)*100 + (bts_id % 100);
ret = make_sock(&ipbc->udp_bsc_fd, udp_port, IPPROTO_UDP,
ret = make_sock(&ipbc->udp_bsc_fd, IPPROTO_UDP, INADDR_ANY, udp_port,
UDP_TO_BSC, udp_fd_cb, ipbc);
if (ret < 0)
goto err_udp_bsc;
@@ -515,7 +386,13 @@ static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd,
if (gprs_ns_ipaddr) {
struct sockaddr_in sock;
socklen_t len = sizeof(sock);
ret = make_gprs_sock(&ipbc->gprs_ns_fd, gprs_ns_cb, ipbc);
struct in_addr addr;
uint32_t ip;
inet_aton(listen_ipaddr, &addr);
ip = ntohl(addr.s_addr); /* make_sock() needs host byte order */
ret = make_sock(&ipbc->gprs_ns_fd, IPPROTO_UDP, ip, 0, 0,
gprs_ns_cb, ipbc);
if (ret < 0) {
LOGP(DINP, LOGL_ERROR, "Creating the GPRS socket failed.\n");
goto err_udp_bsc;
@@ -536,9 +413,9 @@ static int ipbc_alloc_connect(struct ipa_proxy_conn *ipc, struct bsc_fd *bfd,
return 0;
err_udp_bsc:
bsc_unregister_fd(&ipbc->udp_bts_fd);
osmo_fd_unregister(&ipbc->udp_bts_fd);
err_udp_bts:
bsc_unregister_fd(&ipbc->bsc_oml_conn->fd);
osmo_fd_unregister(&ipbc->bsc_oml_conn->fd);
close(ipbc->bsc_oml_conn->fd.fd);
talloc_free(ipbc->bsc_oml_conn);
ipbc->bsc_oml_conn = NULL;
@@ -546,7 +423,7 @@ err_bsc_conn:
talloc_free(ipbc->id_resp);
talloc_free(ipbc);
#if 0
bsc_unregister_fd(bfd);
osmo_fd_unregister(bfd);
close(bfd->fd);
talloc_free(bfd);
#endif
@@ -555,23 +432,17 @@ err_out:
}
static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
struct bsc_fd *bfd)
struct osmo_fd *bfd)
{
struct tlv_parsed tlvp;
u_int8_t msg_type = *(msg->l2h);
u_int16_t site_id, bts_id, trx_id;
uint8_t msg_type = *(msg->l2h);
uint16_t site_id, bts_id, trx_id;
struct ipa_bts_conn *ipbc;
int ret = 0;
switch (msg_type) {
case IPAC_MSGT_PING:
ret = write(bfd->fd, pong, sizeof(pong));
if (ret < 0)
return ret;
if (ret < sizeof(pong)) {
DEBUGP(DINP, "short write\n");
return -EIO;
}
ret = ipaccess_send_pong(bfd->fd);
break;
case IPAC_MSGT_PONG:
DEBUGP(DMI, "PONG!\n");
@@ -579,8 +450,8 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
case IPAC_MSGT_ID_RESP:
DEBUGP(DMI, "ID_RESP ");
/* parse tags, search for Unit ID */
ipac_idtag_parse(&tlvp, (u_int8_t *)msg->l2h + 2,
msgb_l2len(msg)-2);
ipaccess_idtag_parse(&tlvp, (uint8_t *)msg->l2h + 2,
msgb_l2len(msg)-2);
DEBUGP(DMI, "\n");
if (!TLVP_PRESENT(&tlvp, IPAC_IDTAG_UNIT)) {
@@ -590,8 +461,8 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
/* lookup BTS, create sign_link, ... */
site_id = bts_id = trx_id = 0;
parse_unitid((char *)TLVP_VAL(&tlvp, IPAC_IDTAG_UNIT),
&site_id, &bts_id, &trx_id);
ipaccess_parse_unitid((char *)TLVP_VAL(&tlvp, IPAC_IDTAG_UNIT),
&site_id, &bts_id, &trx_id);
ipbc = find_bts_by_unitid(ipp, site_id, bts_id);
if (!ipbc) {
/* We have not found an ipbc (per-bts proxy instance)
@@ -654,7 +525,7 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
break;
case IPAC_MSGT_ID_ACK:
DEBUGP(DMI, "ID_ACK? -> ACK!\n");
ret = write(bfd->fd, id_ack, sizeof(id_ack));
ret = ipaccess_send_id_ack(bfd->fd);
break;
default:
LOGP(DMI, LOGL_ERROR, "Unhandled IPA type; %d\n", msg_type);
@@ -664,7 +535,7 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
return 0;
}
struct msgb *ipaccess_read_msg(struct bsc_fd *bfd, int *error)
struct msgb *ipaccess_proxy_read_msg(struct osmo_fd *bfd, int *error)
{
struct msgb *msg = msgb_alloc(PROXY_ALLOC_SIZE, "Abis/IP");
struct ipaccess_head *hh;
@@ -785,10 +656,10 @@ static void reconn_tmr_cb(void *data)
return;
reschedule:
bsc_schedule_timer(&ipp->reconn_timer, 5, 0);
osmo_timer_schedule(&ipp->reconn_timer, 5, 0);
}
static void handle_dead_socket(struct bsc_fd *bfd)
static void handle_dead_socket(struct osmo_fd *bfd)
{
struct ipa_proxy_conn *ipc = bfd->data; /* local conn */
struct ipa_proxy_conn *bsc_conn; /* remote conn */
@@ -796,7 +667,7 @@ static void handle_dead_socket(struct bsc_fd *bfd)
unsigned int trx_id = bfd->priv_nr >> 8;
struct msgb *msg, *msg2;
bsc_unregister_fd(bfd);
osmo_fd_unregister(bfd);
close(bfd->fd);
bfd->fd = -1;
@@ -806,10 +677,15 @@ static void handle_dead_socket(struct bsc_fd *bfd)
switch (bfd->priv_nr & 0xff) {
case OML_FROM_BTS: /* incoming OML data from BTS, forward to BSC OML */
/* The BTS started a connection with us but we got no
* IPAC_MSGT_ID_RESP message yet, in that scenario we did not
* allocate the ipa_bts_conn structure. */
if (ipbc == NULL)
break;
ipbc->oml_conn = NULL;
bsc_conn = ipbc->bsc_oml_conn;
/* close the connection to the BSC */
bsc_unregister_fd(&bsc_conn->fd);
osmo_fd_unregister(&bsc_conn->fd);
close(bsc_conn->fd.fd);
llist_for_each_entry_safe(msg, msg2, &bsc_conn->tx_queue, list)
msgb_free(msg);
@@ -821,7 +697,7 @@ static void handle_dead_socket(struct bsc_fd *bfd)
ipbc->rsl_conn[trx_id] = NULL;
bsc_conn = ipbc->bsc_rsl_conn[trx_id];
/* close the connection to the BSC */
bsc_unregister_fd(&bsc_conn->fd);
osmo_fd_unregister(&bsc_conn->fd);
close(bsc_conn->fd.fd);
llist_for_each_entry_safe(msg, msg2, &bsc_conn->tx_queue, list)
msgb_free(msg);
@@ -832,13 +708,13 @@ static void handle_dead_socket(struct bsc_fd *bfd)
ipbc->bsc_oml_conn = NULL;
bsc_conn = ipbc->oml_conn;
/* start reconnect timer */
bsc_schedule_timer(&ipp->reconn_timer, 5, 0);
osmo_timer_schedule(&ipp->reconn_timer, 5, 0);
break;
case RSL_TO_BSC: /* incoming RSL data from BSC, forward to BTS RSL */
ipbc->bsc_rsl_conn[trx_id] = NULL;
bsc_conn = ipbc->rsl_conn[trx_id];
/* start reconnect timer */
bsc_schedule_timer(&ipp->reconn_timer, 5, 0);
osmo_timer_schedule(&ipp->reconn_timer, 5, 0);
break;
default:
bsc_conn = NULL;
@@ -871,20 +747,20 @@ static void patch_gprs_msg(struct ipa_bts_conn *ipbc, int priv_nr, struct msgb *
msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 &&
msg->l2h[18] == 0xf5 && msg->l2h[19] == 0xf2) {
nsvci = &msg->l2h[23];
ipbc->gprs_orig_port = *(u_int16_t *)(nsvci+8);
ipbc->gprs_orig_ip = *(u_int32_t *)(nsvci+10);
*(u_int16_t *)(nsvci+8) = htons(ipbc->gprs_local_port);
*(u_int32_t *)(nsvci+10) = ipbc->ipp->listen_addr.s_addr;
ipbc->gprs_orig_port = *(uint16_t *)(nsvci+8);
ipbc->gprs_orig_ip = *(uint32_t *)(nsvci+10);
*(uint16_t *)(nsvci+8) = htons(ipbc->gprs_local_port);
*(uint32_t *)(nsvci+10) = ipbc->ipp->listen_addr.s_addr;
} else if (msg->l2h[0] == 0x10 && msg->l2h[1] == 0x80 &&
msg->l2h[2] == 0x00 && msg->l2h[3] == 0x15 &&
msg->l2h[18] == 0xf6 && msg->l2h[19] == 0xf2) {
nsvci = &msg->l2h[23];
*(u_int16_t *)(nsvci+8) = ipbc->gprs_orig_port;
*(u_int32_t *)(nsvci+10) = ipbc->gprs_orig_ip;
*(uint16_t *)(nsvci+8) = ipbc->gprs_orig_port;
*(uint32_t *)(nsvci+10) = ipbc->gprs_orig_ip;
}
}
static int handle_tcp_read(struct bsc_fd *bfd)
static int handle_tcp_read(struct osmo_fd *bfd)
{
struct ipa_proxy_conn *ipc = bfd->data;
struct ipa_bts_conn *ipbc = ipc->bts_conn;
@@ -899,7 +775,7 @@ static int handle_tcp_read(struct bsc_fd *bfd)
else
btsbsc = "BSC";
msg = ipaccess_read_msg(bfd, &ret);
msg = ipaccess_proxy_read_msg(bfd, &ret);
if (!msg) {
if (ret == 0) {
logp_ipbc_uid(DINP, LOGL_NOTICE, ipbc, bfd->priv_nr >> 8);
@@ -912,13 +788,13 @@ static int handle_tcp_read(struct bsc_fd *bfd)
msgb_put(msg, ret);
logp_ipbc_uid(DMI, LOGL_DEBUG, ipbc, bfd->priv_nr >> 8);
DEBUGPC(DMI, "RX<-%s: %s\n", btsbsc, hexdump(msg->data, msg->len));
DEBUGPC(DMI, "RX<-%s: %s\n", btsbsc, osmo_hexdump(msg->data, msg->len));
hh = (struct ipaccess_head *) msg->data;
if (hh->proto == IPAC_PROTO_IPACCESS) {
ret = ipaccess_rcvmsg(ipc, msg, bfd);
if (ret < 0) {
bsc_unregister_fd(bfd);
osmo_fd_unregister(bfd);
close(bfd->fd);
bfd->fd = -1;
talloc_free(bfd);
@@ -958,7 +834,7 @@ static int handle_tcp_read(struct bsc_fd *bfd)
}
/* a TCP socket is ready to be written to */
static int handle_tcp_write(struct bsc_fd *bfd)
static int handle_tcp_write(struct osmo_fd *bfd)
{
struct ipa_proxy_conn *ipc = bfd->data;
struct ipa_bts_conn *ipbc = ipc->bts_conn;
@@ -984,7 +860,7 @@ static int handle_tcp_write(struct bsc_fd *bfd)
logp_ipbc_uid(DMI, LOGL_DEBUG, ipbc, bfd->priv_nr >> 8);
DEBUGPC(DMI, "TX %04x: %s\n", bfd->priv_nr,
hexdump(msg->data, msg->len));
osmo_hexdump(msg->data, msg->len));
ret = send(bfd->fd, msg->data, msg->len, 0);
msgb_free(msg);
@@ -999,7 +875,7 @@ static int handle_tcp_write(struct bsc_fd *bfd)
}
/* callback from select.c in case one of the fd's can be read/written */
static int ipaccess_fd_cb(struct bsc_fd *bfd, unsigned int what)
static int ipaccess_fd_cb(struct osmo_fd *bfd, unsigned int what)
{
int rc = 0;
@@ -1015,11 +891,11 @@ static int ipaccess_fd_cb(struct bsc_fd *bfd, unsigned int what)
}
/* callback of the listening filedescriptor */
static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what)
static int listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what)
{
int ret;
struct ipa_proxy_conn *ipc;
struct bsc_fd *bfd;
struct osmo_fd *bfd;
struct sockaddr_in sa;
socklen_t sa_len = sizeof(sa);
@@ -1047,7 +923,7 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what)
bfd->priv_nr = listen_bfd->priv_nr;
bfd->cb = ipaccess_fd_cb;
bfd->when = BSC_FD_READ;
ret = bsc_register_fd(bfd);
ret = osmo_fd_register(bfd);
if (ret < 0) {
LOGP(DINP, LOGL_ERROR, "could not register FD\n");
close(bfd->fd);
@@ -1056,7 +932,7 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what)
}
/* Request ID. FIXME: request LOCATION, HW/SW VErsion, Unit Name, Serno */
ret = write(bfd->fd, id_req, sizeof(id_req));
ret = ipaccess_send_id_req(bfd->fd);
return 0;
}
@@ -1078,7 +954,7 @@ static void send_ns(int fd, const char *buf, int size, struct in_addr ip, int po
}
}
static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what)
static int gprs_ns_cb(struct osmo_fd *bfd, unsigned int what)
{
struct ipa_bts_conn *bts;
char buf[4096];
@@ -1109,85 +985,11 @@ static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what)
return 0;
}
static int make_listen_sock(struct bsc_fd *bfd, u_int16_t port, int priv_nr,
int (*cb)(struct bsc_fd *fd, unsigned int what))
{
struct sockaddr_in addr;
int ret, on = 1;
bfd->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
bfd->cb = cb;
bfd->when = BSC_FD_READ;
bfd->priv_nr = priv_nr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
if (!listen_ipaddr)
addr.sin_addr.s_addr = INADDR_ANY;
else
inet_aton(listen_ipaddr, &addr.sin_addr);
setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr));
if (ret < 0) {
LOGP(DINP, LOGL_ERROR,
"Could not bind listen socket for IP %s with error: %s.\n",
listen_ipaddr, strerror(errno));
return -EIO;
}
ret = listen(bfd->fd, 1);
if (ret < 0) {
perror("listen");
return ret;
}
ret = bsc_register_fd(bfd);
if (ret < 0) {
perror("register_listen_fd");
return ret;
}
return 0;
}
static int make_gprs_sock(struct bsc_fd *bfd, int (*cb)(struct bsc_fd*,unsigned int), void *data)
{
struct sockaddr_in addr;
int ret;
bfd->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
bfd->cb = cb;
bfd->data = data;
bfd->when = BSC_FD_READ;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = 0;
inet_aton(listen_ipaddr, &addr.sin_addr);
ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr));
if (ret < 0) {
LOGP(DINP, LOGL_ERROR,
"Could not bind n socket for IP %s with error: %s.\n",
listen_ipaddr, strerror(errno));
return -EIO;
}
ret = bsc_register_fd(bfd);
if (ret < 0) {
perror("register_listen_fd");
return ret;
}
return 0;
}
/* Actively connect to a BSC. */
static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, void *data)
{
struct ipa_proxy_conn *ipc;
struct bsc_fd *bfd;
struct osmo_fd *bfd;
int ret, on = 1;
ipc = alloc_conn();
@@ -1215,7 +1017,7 @@ static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, v
}
/* pre-fill tx_queue with identity request */
ret = bsc_register_fd(bfd);
ret = osmo_fd_register(bfd);
if (ret < 0) {
close(bfd->fd);
talloc_free(ipc);
@@ -1237,14 +1039,14 @@ static int ipaccess_proxy_setup(void)
ipp->reconn_timer.data = ipp;
/* Listen for OML connections */
ret = make_listen_sock(&ipp->oml_listen_fd, IPA_TCP_PORT_OML,
OML_FROM_BTS, listen_fd_cb);
ret = make_sock(&ipp->oml_listen_fd, IPPROTO_TCP, INADDR_ANY,
IPA_TCP_PORT_OML, OML_FROM_BTS, listen_fd_cb, NULL);
if (ret < 0)
return ret;
/* Listen for RSL connections */
ret = make_listen_sock(&ipp->rsl_listen_fd, IPA_TCP_PORT_RSL,
RSL_FROM_BTS, listen_fd_cb);
ret = make_sock(&ipp->rsl_listen_fd, IPPROTO_TCP, INADDR_ANY,
IPA_TCP_PORT_RSL, RSL_FROM_BTS, listen_fd_cb, NULL);
if (ret < 0)
return ret;
@@ -1290,11 +1092,22 @@ static void print_help()
static void print_usage()
{
printf("Usage: ipaccess-proxy\n");
printf("Usage: ipaccess-proxy [options]\n");
}
enum {
IPA_PROXY_OPT_LISTEN_NONE = 0,
IPA_PROXY_OPT_LISTEN_IP = (1 << 0),
IPA_PROXY_OPT_BSC_IP = (1 << 1),
};
static void handle_options(int argc, char** argv)
{
int options_mask = 0;
/* disable explicit missing arguments error output from getopt_long */
opterr = 0;
while (1) {
int option_index = 0, c;
static struct option long_options[] = {
@@ -1304,7 +1117,6 @@ static void handle_options(int argc, char** argv)
{"log-level", 1, 0, 'e'},
{"listen", 1, 0, 'l'},
{"bsc", 1, 0, 'b'},
{"udp", 1, 0, 'u'},
{0, 0, 0, 0}
};
@@ -1320,43 +1132,59 @@ static void handle_options(int argc, char** argv)
exit(0);
case 'l':
listen_ipaddr = optarg;
options_mask |= IPA_PROXY_OPT_LISTEN_IP;
break;
case 'b':
bsc_ipaddr = optarg;
options_mask |= IPA_PROXY_OPT_BSC_IP;
break;
case 'g':
gprs_ns_ipaddr = optarg;
break;
case 's':
log_set_use_color(stderr_target, 0);
log_set_use_color(osmo_stderr_target, 0);
break;
case 'T':
log_set_print_timestamp(stderr_target, 1);
log_set_print_timestamp(osmo_stderr_target, 1);
break;
case 'e':
log_set_log_level(stderr_target, atoi(optarg));
log_set_log_level(osmo_stderr_target, atoi(optarg));
break;
case '?':
if (optopt) {
printf("ERROR: missing mandatory argument "
"for `%s' option\n", argv[optind-1]);
} else {
printf("ERROR: unknown option `%s'\n",
argv[optind-1]);
}
print_usage();
print_help();
exit(EXIT_FAILURE);
break;
default:
/* ignore */
break;
}
}
if ((options_mask & (IPA_PROXY_OPT_LISTEN_IP | IPA_PROXY_OPT_BSC_IP))
!= (IPA_PROXY_OPT_LISTEN_IP | IPA_PROXY_OPT_BSC_IP)) {
printf("ERROR: You have to specify `--listen' and `--bsc' "
"options at least.\n");
print_usage();
print_help();
exit(EXIT_FAILURE);
}
}
int main(int argc, char **argv)
{
int rc;
listen_ipaddr = "192.168.100.11";
bsc_ipaddr = "192.168.100.239";
tall_bsc_ctx = talloc_named_const(NULL, 1, "ipaccess-proxy");
log_init(&log_info);
stderr_target = log_target_create_stderr();
log_add_target(stderr_target);
log_set_all_filter(stderr_target, 1);
log_parse_category_mask(stderr_target, "DINP:DMI");
osmo_init_logging(&log_info);
log_parse_category_mask(osmo_stderr_target, "DINP:DMI");
handle_options(argc, argv);
@@ -1366,8 +1194,9 @@ int main(int argc, char **argv)
signal(SIGUSR1, &signal_handler);
signal(SIGABRT, &signal_handler);
osmo_init_ignore_signals();
while (1) {
bsc_select_main(0);
osmo_select_main(0);
}
}

View File

@@ -28,10 +28,10 @@
#include <arpa/inet.h>
#include <osmocore/talloc.h>
#include <osmocore/timer.h>
#include <osmocore/rxlev_stat.h>
#include <osmocore/gsm48_ie.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/timer.h>
#include <osmocom/gsm/rxlev_stat.h>
#include <osmocom/gsm/gsm48_ie.h>
#include <openbsc/gsm_data.h>
#include <openbsc/abis_nm.h>
@@ -191,17 +191,17 @@ static int test_rep(void *_msg)
last_arfcn = binfo.arfcn;
}
if (binfo.info_type & IPAC_BINF_NEIGH_BA_SI2) {
DEBUGP(DNM, "BA SI2: %s\n", hexdump(binfo.ba_list_si2, sizeof(binfo.ba_list_si2)));
DEBUGP(DNM, "BA SI2: %s\n", osmo_hexdump(binfo.ba_list_si2, sizeof(binfo.ba_list_si2)));
gsm48_decode_freq_list(nwl_si_freq, binfo.ba_list_si2, sizeof(binfo.ba_list_si2),
0x8c, FREQ_TYPE_NCELL_2);
}
if (binfo.info_type & IPAC_BINF_NEIGH_BA_SI2bis) {
DEBUGP(DNM, "BA SI2bis: %s\n", hexdump(binfo.ba_list_si2bis, sizeof(binfo.ba_list_si2bis)));
DEBUGP(DNM, "BA SI2bis: %s\n", osmo_hexdump(binfo.ba_list_si2bis, sizeof(binfo.ba_list_si2bis)));
gsm48_decode_freq_list(nwl_si_freq, binfo.ba_list_si2bis, sizeof(binfo.ba_list_si2bis),
0x8e, FREQ_TYPE_NCELL_2bis);
}
if (binfo.info_type & IPAC_BINF_NEIGH_BA_SI2ter) {
DEBUGP(DNM, "BA SI2ter: %s\n", hexdump(binfo.ba_list_si2ter, sizeof(binfo.ba_list_si2ter)));
DEBUGP(DNM, "BA SI2ter: %s\n", osmo_hexdump(binfo.ba_list_si2ter, sizeof(binfo.ba_list_si2ter)));
gsm48_decode_freq_list(nwl_si_freq, binfo.ba_list_si2ter, sizeof(binfo.ba_list_si2ter),
0x8e, FREQ_TYPE_NCELL_2ter);
}
@@ -222,7 +222,7 @@ static int test_rep(void *_msg)
msg->trx->ipaccess.test_state = IPAC_TEST_S_IDLE;
/* Send signal to notify higher layers of test completion */
DEBUGP(DNM, "dispatching S_IPAC_NWL_COMPLETE signal\n");
dispatch_signal(SS_IPAC_NWL, S_IPAC_NWL_COMPLETE, msg->trx);
osmo_signal_dispatch(SS_IPAC_NWL, S_IPAC_NWL_COMPLETE, msg->trx);
break;
case NM_IPACC_TESTRES_PARTIAL:
msg->trx->ipaccess.test_state = IPAC_TEST_S_PARTIAL;
@@ -247,5 +247,5 @@ static int nwl_sig_cb(unsigned int subsys, unsigned int signal,
void ipac_nwl_init(void)
{
register_signal_handler(SS_NM, nwl_sig_cb, NULL);
osmo_signal_register_handler(SS_NM, nwl_sig_cb, NULL);
}

View File

@@ -1,6 +1,6 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
noinst_LIBRARIES = libabis.a

View File

@@ -35,7 +35,7 @@ POST_UNINSTALL = :
subdir = src/libabis
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -115,6 +115,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
@@ -184,8 +186,8 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(COVERAGE_LDFLAGS)
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
noinst_LIBRARIES = libabis.a
libabis_a_SOURCES = e1_input.c e1_input_vty.c \
input/misdn.c \

View File

@@ -26,7 +26,6 @@
#include <string.h>
#include <time.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
@@ -39,18 +38,18 @@
#define PF_ISDN AF_ISDN
#endif
#include <osmocore/select.h>
#include <osmocore/msgb.h>
#include <osmocom/core/select.h>
#include <osmocom/core/msgb.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
#include <openbsc/e1_input.h>
#include <openbsc/abis_nm.h>
#include <openbsc/abis_rsl.h>
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
#include <openbsc/subchan_demux.h>
#include <openbsc/trau_frame.h>
#include <openbsc/trau_mux.h>
#include <osmocore/talloc.h>
#include <osmocom/core/talloc.h>
#include <openbsc/signal.h>
#include <openbsc/misdn.h>
@@ -75,44 +74,44 @@ static void *tall_sigl_ctx;
#define PCAP_OUTPUT 1
struct pcap_hdr {
u_int32_t magic_number;
u_int16_t version_major;
u_int16_t version_minor;
uint32_t magic_number;
uint16_t version_major;
uint16_t version_minor;
int32_t thiszone;
u_int32_t sigfigs;
u_int32_t snaplen;
u_int32_t network;
uint32_t sigfigs;
uint32_t snaplen;
uint32_t network;
} __attribute__((packed));
struct pcaprec_hdr {
u_int32_t ts_sec;
u_int32_t ts_usec;
u_int32_t incl_len;
u_int32_t orig_len;
uint32_t ts_sec;
uint32_t ts_usec;
uint32_t incl_len;
uint32_t orig_len;
} __attribute__((packed));
struct fake_linux_lapd_header {
u_int16_t pkttype;
u_int16_t hatype;
u_int16_t halen;
u_int64_t addr;
uint16_t pkttype;
uint16_t hatype;
uint16_t halen;
uint64_t addr;
int16_t protocol;
} __attribute__((packed));
struct lapd_header {
u_int8_t ea1 : 1;
u_int8_t cr : 1;
u_int8_t sapi : 6;
u_int8_t ea2 : 1;
u_int8_t tei : 7;
u_int8_t control_foo; /* fake UM's ... */
uint8_t ea1 : 1;
uint8_t cr : 1;
uint8_t sapi : 6;
uint8_t ea2 : 1;
uint8_t tei : 7;
uint8_t control_foo; /* fake UM's ... */
} __attribute__((packed));
static_assert(offsetof(struct fake_linux_lapd_header, hatype) == 2, hatype_offset);
static_assert(offsetof(struct fake_linux_lapd_header, halen) == 4, halen_offset);
static_assert(offsetof(struct fake_linux_lapd_header, addr) == 6, addr_offset);
static_assert(offsetof(struct fake_linux_lapd_header, protocol) == 14, proto_offset);
static_assert(sizeof(struct fake_linux_lapd_header) == 16, lapd_header_size);
osmo_static_assert(offsetof(struct fake_linux_lapd_header, hatype) == 2, hatype_offset);
osmo_static_assert(offsetof(struct fake_linux_lapd_header, halen) == 4, halen_offset);
osmo_static_assert(offsetof(struct fake_linux_lapd_header, addr) == 6, addr_offset);
osmo_static_assert(offsetof(struct fake_linux_lapd_header, protocol) == 14, proto_offset);
osmo_static_assert(sizeof(struct fake_linux_lapd_header) == 16, lapd_header_size);
static int pcap_fd = -1;
@@ -207,7 +206,7 @@ const char *e1inp_tstype_name(enum e1inp_ts_type tp)
}
/* callback when a TRAU frame was received */
static int subch_cb(struct subch_demux *dmx, int ch, u_int8_t *data, int len,
static int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len,
void *_priv)
{
struct e1inp_ts *e1i_ts = _priv;
@@ -230,19 +229,19 @@ int abis_rsl_sendmsg(struct msgb *msg)
if (!msg->trx) {
LOGP(DRSL, LOGL_ERROR, "rsl_sendmsg: msg->trx == NULL: %s\n",
hexdump(msg->data, msg->len));
osmo_hexdump(msg->data, msg->len));
talloc_free(msg);
return -EINVAL;
} else if (!msg->trx->rsl_link) {
LOGP(DRSL, LOGL_ERROR, "rsl_sendmsg: msg->trx->rsl_link == NULL: %s\n",
hexdump(msg->data, msg->len));
osmo_hexdump(msg->data, msg->len));
talloc_free(msg);
return -EIO;
}
sign_link = msg->trx->rsl_link;
e1i_ts = sign_link->ts;
if (!bsc_timer_pending(&e1i_ts->sign.tx_timer)) {
if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) {
/* notify the driver we have something to write */
e1inp_driver = sign_link->ts->line->driver;
e1inp_driver->want_write(e1i_ts);
@@ -277,7 +276,7 @@ int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml)
sign_link = msg->trx->bts->oml_link;
e1i_ts = sign_link->ts;
if (!bsc_timer_pending(&e1i_ts->sign.tx_timer)) {
if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) {
/* notify the driver we have something to write */
e1inp_driver = sign_link->ts->line->driver;
e1inp_driver->want_write(e1i_ts);
@@ -324,7 +323,7 @@ int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line,
return 0;
}
struct e1inp_line *e1inp_line_get(u_int8_t e1_nr)
struct e1inp_line *e1inp_line_get(uint8_t e1_nr)
{
struct e1inp_line *e1i_line;
@@ -336,7 +335,7 @@ struct e1inp_line *e1inp_line_get(u_int8_t e1_nr)
return NULL;
}
struct e1inp_line *e1inp_line_create(u_int8_t e1_nr, const char *driver_name)
struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name)
{
struct e1inp_driver *driver;
struct e1inp_line *line;
@@ -373,7 +372,7 @@ struct e1inp_line *e1inp_line_create(u_int8_t e1_nr, const char *driver_name)
}
#if 0
struct e1inp_line *e1inp_line_get_create(u_int8_t e1_nr)
struct e1inp_line *e1inp_line_get_create(uint8_t e1_nr)
{
struct e1inp_line *line;
int i;
@@ -397,7 +396,7 @@ struct e1inp_line *e1inp_line_get_create(u_int8_t e1_nr)
}
#endif
static struct e1inp_ts *e1inp_ts_get(u_int8_t e1_nr, u_int8_t ts_nr)
static struct e1inp_ts *e1inp_ts_get(uint8_t e1_nr, uint8_t ts_nr)
{
struct e1inp_line *e1i_line;
@@ -408,7 +407,7 @@ static struct e1inp_ts *e1inp_ts_get(u_int8_t e1_nr, u_int8_t ts_nr)
return &e1i_line->ts[ts_nr-1];
}
struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr)
struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr)
{
struct e1inp_ts *e1i_ts = e1inp_ts_get(e1_nr, ts_nr);
@@ -421,7 +420,7 @@ struct subch_mux *e1inp_get_mux(u_int8_t e1_nr, u_int8_t ts_nr)
/* Signalling Link */
struct e1inp_sign_link *e1inp_lookup_sign_link(struct e1inp_ts *e1i,
u_int8_t tei, u_int8_t sapi)
uint8_t tei, uint8_t sapi)
{
struct e1inp_sign_link *link;
@@ -437,8 +436,8 @@ struct e1inp_sign_link *e1inp_lookup_sign_link(struct e1inp_ts *e1i,
struct e1inp_sign_link *
e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
struct gsm_bts_trx *trx, u_int8_t tei,
u_int8_t sapi)
struct gsm_bts_trx *trx, uint8_t tei,
uint8_t sapi)
{
struct e1inp_sign_link *link;
@@ -472,14 +471,14 @@ void e1inp_sign_link_destroy(struct e1inp_sign_link *link)
}
if (link->ts->type == E1INP_TS_TYPE_SIGN)
bsc_del_timer(&link->ts->sign.tx_timer);
osmo_timer_del(&link->ts->sign.tx_timer);
talloc_free(link);
}
/* the E1 driver tells us he has received something on a TS */
int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg,
u_int8_t tei, u_int8_t sapi)
uint8_t tei, uint8_t sapi)
{
struct e1inp_sign_link *link;
struct gsm_bts *bts;
@@ -562,7 +561,7 @@ struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts,
}
/* called by driver in case some kind of link state event */
int e1inp_event(struct e1inp_ts *ts, int evt, u_int8_t tei, u_int8_t sapi)
int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi)
{
struct e1inp_sign_link *link;
struct input_signal_data isd;
@@ -577,7 +576,7 @@ int e1inp_event(struct e1inp_ts *ts, int evt, u_int8_t tei, u_int8_t sapi)
isd.sapi = sapi;
/* report further upwards */
dispatch_signal(SS_INPUT, evt, &isd);
osmo_signal_dispatch(SS_INPUT, evt, &isd);
return 0;
}
@@ -613,7 +612,7 @@ int e1inp_line_update(struct e1inp_line *line)
* configured */
memset(&isd, 0, sizeof(isd));
isd.line = line;
dispatch_signal(SS_INPUT, S_INP_LINE_INIT, &isd);
osmo_signal_dispatch(SS_INPUT, S_INP_LINE_INIT, &isd);
return rc;
}
@@ -635,15 +634,19 @@ static int e1i_sig_cb(unsigned int subsys, unsigned int signal,
void e1inp_misdn_init(void);
void e1inp_dahdi_init(void);
void e1inp_ipaccess_init(void);
void e1inp_hsl_init(void);
void e1inp_init(void)
{
tall_sigl_ctx = talloc_named_const(tall_bsc_ctx, 1,
"e1inp_sign_link");
register_signal_handler(SS_GLOBAL, e1i_sig_cb, NULL);
osmo_signal_register_handler(SS_GLOBAL, e1i_sig_cb, NULL);
e1inp_misdn_init();
#ifdef HAVE_DAHDI_USER_H
e1inp_dahdi_init();
#endif
e1inp_ipaccess_init();
e1inp_hsl_init();
}

View File

@@ -19,7 +19,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/buffer.h>
@@ -27,12 +26,12 @@
#include <osmocom/vty/logging.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocore/linuxlist.h>
#include <osmocom/core/linuxlist.h>
#include <openbsc/gsm_data.h>
#include <openbsc/e1_input.h>
#include <osmocore/utils.h>
#include <osmocore/gsm_utils.h>
#include <osmocore/talloc.h>
#include <osmocom/core/utils.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/core/talloc.h>
#include <openbsc/vty.h>
#include <openbsc/debug.h>
@@ -77,6 +76,9 @@ static int e1inp_config_write(struct vty *vty)
{
struct e1inp_line *line;
if (llist_empty(&e1inp_line_list))
return CMD_SUCCESS;
vty_out(vty, "e1_input%s", VTY_NEWLINE);
llist_for_each_entry(line, &e1inp_line_list, list) {

View File

@@ -33,14 +33,13 @@
#include <string.h>
#include <time.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <dahdi/user.h>
#include <osmocore/select.h>
#include <osmocore/msgb.h>
#include <osmocom/core/select.h>
#include <osmocom/core/msgb.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
#include <openbsc/abis_nm.h>
@@ -48,7 +47,7 @@
#include <openbsc/subchan_demux.h>
#include <openbsc/e1_input.h>
#include <openbsc/signal.h>
#include <osmocore/talloc.h>
#include <osmocom/core/talloc.h>
#include "lapd.h"
@@ -84,16 +83,16 @@ static void handle_dahdi_exception(struct e1inp_ts *ts)
switch (evt) {
case DAHDI_EVENT_ALARM:
/* we should notify the code that the line is gone */
dispatch_signal(SS_INPUT, S_INP_LINE_ALARM, &isd);
osmo_signal_dispatch(SS_INPUT, S_INP_LINE_ALARM, &isd);
break;
case DAHDI_EVENT_NOALARM:
/* alarm has gone, we should re-start the SABM requests */
dispatch_signal(SS_INPUT, S_INP_LINE_NOALARM, &isd);
osmo_signal_dispatch(SS_INPUT, S_INP_LINE_NOALARM, &isd);
break;
}
}
static int handle_ts1_read(struct bsc_fd *bfd)
static int handle_ts1_read(struct osmo_fd *bfd)
{
struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr;
@@ -148,7 +147,7 @@ static int handle_ts1_read(struct bsc_fd *bfd)
msg->l2h = msg->data + 2;
else
msg->l2h = msg->data + 1;
DEBUGP(DMI, "RX: %s\n", hexdump(msgb_l2(msg), ret));
DEBUGP(DMI, "RX: %s\n", osmo_hexdump(msgb_l2(msg), ret));
ret = e1inp_rx_ts(e1i_ts, msg, tei, sapi);
break;
default:
@@ -185,7 +184,7 @@ static void timeout_ts1_write(void *data)
static void dahdi_write_msg(uint8_t *data, int len, void *cbdata)
{
struct bsc_fd *bfd = cbdata;
struct osmo_fd *bfd = cbdata;
struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr;
struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
@@ -198,7 +197,7 @@ static void dahdi_write_msg(uint8_t *data, int len, void *cbdata)
LOGP(DMI, LOGL_NOTICE, "%s write failed %d\n", __func__, ret);
}
static int handle_ts1_write(struct bsc_fd *bfd)
static int handle_ts1_write(struct osmo_fd *bfd)
{
struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr;
@@ -215,7 +214,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
return 0;
}
DEBUGP(DMI, "TX: %s\n", hexdump(msg->data, msg->len));
DEBUGP(DMI, "TX: %s\n", osmo_hexdump(msg->data, msg->len));
lapd_transmit(e1i_ts->driver.dahdi.lapd, sign_link->tei,
sign_link->sapi, msg->data, msg->len);
msgb_free(msg);
@@ -223,7 +222,7 @@ static int handle_ts1_write(struct bsc_fd *bfd)
/* set tx delay timer for next event */
e1i_ts->sign.tx_timer.cb = timeout_ts1_write;
e1i_ts->sign.tx_timer.data = e1i_ts;
bsc_schedule_timer(&e1i_ts->sign.tx_timer, 0, 50000);
osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, 50000);
return 0;
}
@@ -231,14 +230,14 @@ static int handle_ts1_write(struct bsc_fd *bfd)
static int invertbits = 1;
static u_int8_t flip_table[256];
static uint8_t flip_table[256];
static void init_flip_bits(void)
{
int i,k;
for (i = 0 ; i < 256 ; i++) {
u_int8_t sample = 0 ;
uint8_t sample = 0 ;
for (k = 0; k<8; k++) {
if ( i & 1 << k ) sample |= 0x80 >> k;
}
@@ -246,13 +245,13 @@ static void init_flip_bits(void)
}
}
static u_int8_t * flip_buf_bits ( u_int8_t * buf , int len)
static uint8_t * flip_buf_bits ( uint8_t * buf , int len)
{
int i;
u_int8_t * start = buf;
uint8_t * start = buf;
for (i = 0 ; i < len; i++) {
buf[i] = flip_table[(u_int8_t)buf[i]];
buf[i] = flip_table[(uint8_t)buf[i]];
}
return start;
@@ -260,12 +259,12 @@ static u_int8_t * flip_buf_bits ( u_int8_t * buf , int len)
#define D_BCHAN_TX_GRAN 160
/* write to a B channel TS */
static int handle_tsX_write(struct bsc_fd *bfd)
static int handle_tsX_write(struct osmo_fd *bfd)
{
struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr;
struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];
u_int8_t tx_buf[D_BCHAN_TX_GRAN];
uint8_t tx_buf[D_BCHAN_TX_GRAN];
struct subch_mux *mx = &e1i_ts->trau.mux;
int ret;
@@ -278,7 +277,7 @@ static int handle_tsX_write(struct bsc_fd *bfd)
}
DEBUGP(DMIB, "BCHAN TX: %s\n",
hexdump(tx_buf, D_BCHAN_TX_GRAN));
osmo_hexdump(tx_buf, D_BCHAN_TX_GRAN));
if (invertbits) {
flip_buf_bits(tx_buf, ret);
@@ -294,7 +293,7 @@ static int handle_tsX_write(struct bsc_fd *bfd)
#define D_TSX_ALLOC_SIZE (D_BCHAN_TX_GRAN)
/* FIXME: read from a B channel TS */
static int handle_tsX_read(struct bsc_fd *bfd)
static int handle_tsX_read(struct osmo_fd *bfd)
{
struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr;
@@ -319,7 +318,7 @@ static int handle_tsX_read(struct bsc_fd *bfd)
msg->l2h = msg->data;
DEBUGP(DMIB, "BCHAN RX: %s\n",
hexdump(msgb_l2(msg), ret));
osmo_hexdump(msgb_l2(msg), ret));
ret = e1inp_rx_ts(e1i_ts, msg, 0, 0);
/* physical layer indicates that data has been sent,
* we thus can send some more data */
@@ -330,7 +329,7 @@ static int handle_tsX_read(struct bsc_fd *bfd)
}
/* callback from select.c in case one of the fd's can be read/written */
static int dahdi_fd_cb(struct bsc_fd *bfd, unsigned int what)
static int dahdi_fd_cb(struct osmo_fd *bfd, unsigned int what)
{
struct e1inp_line *line = bfd->data;
unsigned int ts_nr = bfd->priv_nr;
@@ -421,7 +420,7 @@ static int dahdi_e1_setup(struct e1inp_line *line)
unsigned int idx = ts-1;
char openstr[128];
struct e1inp_ts *e1i_ts = &line->ts[idx];
struct bsc_fd *bfd = &e1i_ts->driver.dahdi.fd;
struct osmo_fd *bfd = &e1i_ts->driver.dahdi.fd;
bfd->data = line;
bfd->priv_nr = ts;
@@ -464,7 +463,7 @@ static int dahdi_e1_setup(struct e1inp_line *line)
return bfd->fd;
}
ret = bsc_register_fd(bfd);
ret = osmo_fd_register(bfd);
if (ret < 0) {
fprintf(stderr, "could not register FD: %s\n",
strerror(ret));

Some files were not shown because too many files have changed in this diff Show More