create libosmoisdn sub-library

There are some parts of libosmogsm which are not really GSM specific,
but rather ISDN bits that were inherited by GSM.  This includes the
I.460 multiplex as well as the core LAPD protocol.

Let's move those bits to its own libosmoisdn library, before we add
more ISDN specific bits to the wrong place.

Backwards-compatibility is created by making libosmogsm depend on
libosmoisdn, and by providing wrapper include files for source
compatibility.

Change-Id: Ib1a6c762322fd5047be3188b1df22408ef06aa50
This commit is contained in:
Harald Welte 2022-11-29 22:33:54 +01:00 committed by Harald Welte
parent 88955fb550
commit d55a209d1c
35 changed files with 2223 additions and 311 deletions

2
.gitignore vendored
View File

@ -37,6 +37,7 @@ libosmocore-*.tar.*
Doxyfile.core
Doxyfile.ctrl
Doxyfile.gsm
Doxyfile.isdn
Doxyfile.vty
Doxyfile.codec
Doxyfile.coding
@ -80,6 +81,7 @@ doc/vty/latex
doc/vty/html
doc/vty/doxygen_sqlite3.db
doc/gsm
doc/isdn
doc/gb
doc/html.tar
doc/*.tag

View File

@ -1485,7 +1485,7 @@ SKIP_FUNCTION_MACROS = YES
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmoisdn.tag=../../isdn/html doc/libosmovty.tag=../../vty/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.

View File

@ -1485,7 +1485,7 @@ SKIP_FUNCTION_MACROS = YES
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmoisdn.tag=../../isdn/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.

View File

@ -1485,7 +1485,7 @@ SKIP_FUNCTION_MACROS = YES
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES = doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
TAGFILES = doc/libosmogsm.tag=../../gsm/html doc/libosmoisdn.tag=../../isdn/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.

View File

@ -1485,7 +1485,7 @@ SKIP_FUNCTION_MACROS = YES
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmogb.tag=../../gb/html
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmoisdn.tag=../../isdn/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmogb.tag=../../gb/html
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.

View File

@ -1485,7 +1485,7 @@ SKIP_FUNCTION_MACROS = YES
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmoisdn.tag=../../isdn/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.

View File

@ -1485,7 +1485,7 @@ SKIP_FUNCTION_MACROS = YES
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmoisdn.tag=../../isdn/html doc/libosmovty.tag=../../vty/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.

1716
Doxyfile.isdn.in Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1485,7 +1485,7 @@ SKIP_FUNCTION_MACROS = YES
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
TAGFILES = doc/libosmocore.tag=../../core/html doc/libosmogsm.tag=../../gsm/html doc/libosmoisdn.tag=../../isdn/html doc/libosmocodec.tag=../../codec/html doc/libosmocoding.tag=../../coding/html doc/libosmoctrl.tag=../../ctrl/html doc/libosmogb.tag=../../gb/html
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.

View File

@ -12,7 +12,7 @@ SUBDIRS = \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \
libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc \
libosmousb.pc
libosmousb.pc libosmoisdn.pc
aclocaldir = $(datadir)/aclocal
dist_aclocal_DATA = m4/osmo_ac_code_coverage.m4 \
@ -47,6 +47,7 @@ EXTRA_DIST = \
HTML = \
$(top_builddir)/doc/core/html/index.html \
$(top_builddir)/doc/gsm/html/index.html \
$(top_builddir)/doc/isdn/html/index.html \
$(top_builddir)/doc/vty/html/index.html \
$(top_builddir)/doc/codec/html/index.html \
$(top_builddir)/doc/coding/html/index.html \
@ -100,6 +101,14 @@ $(top_builddir)/doc/libosmogsm.tag.prep: $(top_builddir)/Doxyfile.gsm \
-$(DOXYGEN) $(top_builddir)/Doxyfile.gsm
touch "$@"
$(top_builddir)/doc/libosmoisdn.tag.prep: $(top_builddir)/Doxyfile.isdn \
$(top_srcdir)/include/osmocom/isdn/*.h \
$(top_srcdir)/src/isdn/*.c
rm -rf $(top_builddir)/doc/isdn; mkdir -p $(top_builddir)/doc/isdn
rm -rf $(top_builddir)/doc/libosmoisdn.map
-$(DOXYGEN) $(top_builddir)/Doxyfile.isdn
touch "$@"
# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
$(top_builddir)/doc/libosmovty.tag.prep: $(top_builddir)/Doxyfile.vty \
$(top_srcdir)/include/osmocom/vty/*.h \
@ -155,6 +164,7 @@ $(top_builddir)/doc/libosmogb.tag.prep: $(top_builddir)/Doxyfile.gb \
$(top_builddir)/doc/core/html/index.html: $(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmocoding.tag.prep \
@ -165,6 +175,7 @@ $(top_builddir)/doc/core/html/index.html: $(top_builddir)/doc/libosmocore.tag.pr
$(top_builddir)/doc/gsm/html/index.html: $(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmocoding.tag.prep \
@ -173,10 +184,22 @@ $(top_builddir)/doc/gsm/html/index.html: $(top_builddir)/doc/libosmogsm.tag.prep
rm -rf $(top_builddir)/doc/gsm; mkdir -p $(top_builddir)/doc/gsm
$(DOXYGEN) Doxyfile.gsm
$(top_builddir)/doc/isdn/html/index.html: $(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmocoding.tag.prep \
$(top_builddir)/doc/libosmoctrl.tag.prep \
$(top_builddir)/doc/libosmogb.tag.prep
rm -rf $(top_builddir)/doc/isdn; mkdir -p $(top_builddir)/doc/isdn
$(DOXYGEN) Doxyfile.isdn
# Don't delete the entire doc/vty, it contains example.xml and vtydoc.xsd (OS#3986)
$(top_builddir)/doc/vty/html/index.html: $(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmocoding.tag.prep \
$(top_builddir)/doc/libosmoctrl.tag.prep \
@ -187,6 +210,7 @@ $(top_builddir)/doc/vty/html/index.html: $(top_builddir)/doc/libosmovty.tag.prep
$(top_builddir)/doc/codec/html/index.html: $(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocoding.tag.prep \
$(top_builddir)/doc/libosmoctrl.tag.prep \
@ -197,6 +221,7 @@ $(top_builddir)/doc/codec/html/index.html: $(top_builddir)/doc/libosmocodec.tag.
$(top_builddir)/doc/coding/html/index.html: $(top_builddir)/doc/libosmocoding.tag.prep \
$(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmoctrl.tag.prep \
@ -207,6 +232,7 @@ $(top_builddir)/doc/coding/html/index.html: $(top_builddir)/doc/libosmocoding.ta
$(top_builddir)/doc/ctrl/html/index.html: $(top_builddir)/doc/libosmoctrl.tag.prep \
$(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmocoding.tag.prep \
@ -217,6 +243,7 @@ $(top_builddir)/doc/ctrl/html/index.html: $(top_builddir)/doc/libosmoctrl.tag.pr
$(top_builddir)/doc/gb/html/index.html: $(top_builddir)/doc/libosmogb.tag.prep \
$(top_builddir)/doc/libosmocore.tag.prep \
$(top_builddir)/doc/libosmogsm.tag.prep \
$(top_builddir)/doc/libosmoisdn.tag.prep \
$(top_builddir)/doc/libosmovty.tag.prep \
$(top_builddir)/doc/libosmocodec.tag.prep \
$(top_builddir)/doc/libosmocoding.tag.prep \
@ -229,9 +256,9 @@ install-data-hook:
cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar
uninstall-hook:
cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding,ctrl,gb}
cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,isdn,vty,codec,coding,ctrl,gb}
DX_CLEAN = doc/{core,gsm,vty,codec,coding,ctrl,gb}/html/search/* doc/{core,gsm,vty,codec,coding,ctrl,gb}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding,ctrl,gb}/doxygen_sqlite3.db doc/*.tag doc/*.tag.prep
DX_CLEAN = doc/{core,gsm,isdn,vty,codec,coding,ctrl,gb}/html/search/* doc/{core,gsm,isdn,vty,codec,coding,ctrl,gb}/{html,latex}/* doc/html.tar doc/{core,gsm,isdn,vty,codec,coding,ctrl,gb}/doxygen_sqlite3.db doc/*.tag doc/*.tag.prep
endif
MOSTLYCLEANFILES = $(DX_CLEAN)

View File

@ -53,12 +53,14 @@ case $host in
*)
LTLDFLAGS_OSMOGB='-Wl,--version-script=$(srcdir)/libosmogb.map'
LTLDFLAGS_OSMOGSM='-Wl,--version-script=$(srcdir)/libosmogsm.map'
LTLDFLAGS_OSMOISDN='-Wl,--version-script=$(srcdir)/libosmoisdn.map'
LTLDFLAGS_OSMOCODING='-Wl,--version-script=$(srcdir)/libosmocoding.map'
LTLDFLAGS_OSMOCTRL='-Wl,--version-script=$(srcdir)/libosmoctrl.map'
;;
esac
AC_SUBST(LTLDFLAGS_OSMOGB)
AC_SUBST(LTLDFLAGS_OSMOGSM)
AC_SUBST(LTLDFLAGS_OSMOISDN)
AC_SUBST(LTLDFLAGS_OSMOCODING)
AC_SUBST(LTLDFLAGS_OSMOCTRL)
@ -580,6 +582,7 @@ AC_OUTPUT(
libosmocoding.pc
libosmovty.pc
libosmogsm.pc
libosmoisdn.pc
libosmogb.pc
libosmoctrl.pc
libosmosim.pc
@ -595,6 +598,7 @@ AC_OUTPUT(
include/osmocom/gprs/protocol/Makefile
include/osmocom/gsm/Makefile
include/osmocom/gsm/protocol/Makefile
include/osmocom/isdn/Makefile
include/osmocom/sim/Makefile
include/osmocom/usb/Makefile
include/osmocom/vty/Makefile
@ -606,6 +610,7 @@ AC_OUTPUT(
src/sim/Makefile
src/usb/Makefile
src/gsm/Makefile
src/isdn/Makefile
src/gb/Makefile
src/ctrl/Makefile
src/pseudotalloc/Makefile
@ -616,6 +621,7 @@ AC_OUTPUT(
utils/osmo-stat-dummy/Makefile
Doxyfile.core
Doxyfile.gsm
Doxyfile.isdn
Doxyfile.vty
Doxyfile.codec
Doxyfile.coding

View File

@ -211,6 +211,8 @@ License: GPL-2.0-or-later AND AGPL-3.0-or-later
Group: Development/Libraries/C and C++
Requires: libosmocore-devel = %version
Requires: libosmogsm18 = %version
Requires: libosmoisdn-devel = %version
Requires: libosmoisdn0 = %version
%description -n libosmogsm-devel
The libosmogsm library in particular is a collection of common code
@ -222,6 +224,34 @@ protocol definitions for a series of protocols.
This subpackage contains libraries and header files for developing
applications that want to make use of libosmogsm.
%package -n libosmoisdn0
Summary: Osmocom ISDN utility library
License: GPL-2.0-or-later
Group: System/Libraries
%description -n libosmoisdn0
libosmocore is a package with various utility functions that were
originally developed as part of the OpenBSC project.
The libosmoisdn library in particular is a collection of common code used in
various ISDN related sub-projects inside the Osmocom family of projects. It
includes an I.460 sub-channel multiplex and a generic LAPD core.
%package -n libosmoisdn-devel
Summary: Development files for the Osmocom ISDN utility library
License: GPL-2.0-or-later
Group: Development/Libraries/C and C++
Requires: libosmocore-devel = %version
Requires: libosmoisdn0 = %version
%description -n libosmoisdn-devel
The libosmoisdn library in particular is a collection of common code used in
various ISDN related sub-projects inside the Osmocom family of projects. It
includes an I.460 sub-channel multiplex and a generic LAPD core.
This subpackage contains libraries and header files for developing
applications that want to make use of libosmogsm.
%package -n libosmosim2
Summary: Osmocom SIM card related utility library
License: GPL-2.0-or-later
@ -332,6 +362,8 @@ make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
%postun -n libosmogb14 -p /sbin/ldconfig
%post -n libosmogsm18 -p /sbin/ldconfig
%postun -n libosmogsm18 -p /sbin/ldconfig
%post -n libosmoisdn0 -p /sbin/ldconfig
%postun -n libosmoisdn0 -p /sbin/ldconfig
%post -n libosmosim2 -p /sbin/ldconfig
%postun -n libosmosim2 -p /sbin/ldconfig
%post -n libosmovty9 -p /sbin/ldconfig
@ -418,6 +450,18 @@ make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
%_libdir/libosmogsm.so
%_libdir/pkgconfig/libosmogsm.pc
%files -n libosmoisdn0
%defattr(-,root,root)
%_libdir/libosmoisdn.so.0*
%files -n libosmoisdn-devel
%defattr(-,root,root)
%dir %_includedir/%name
%dir %_includedir/%name/osmocom
%_includedir/%name/osmocom/isdn/
%_libdir/libosmoisdn.so
%_libdir/pkgconfig/libosmoisdn.pc
%files -n libosmosim2
%defattr(-,root,root)
%_libdir/libosmosim.so.2*

35
debian/control vendored
View File

@ -34,6 +34,7 @@ Depends: libosmocodec0 (= ${binary:Version}),
libosmocore19 (= ${binary:Version}),
libosmogb14 (= ${binary:Version}),
libosmogsm18 (= ${binary:Version}),
libosmoisdn0 (= ${binary:Version}),
libosmovty9 (= ${binary:Version}),
libosmoctrl0 (= ${binary:Version}),
libosmosim2 (= ${binary:Version}),
@ -141,6 +142,7 @@ Depends: ${misc:Depends},
libosmocodec-doc,
libosmocoding-doc,
libosmogsm-doc,
libosmoisdn-doc,
libosmovty-doc
Description: Documentation for the Osmo Core library
This is part of the libosmocore "meta"-library. The libosmocore library
@ -218,6 +220,39 @@ Description: Documentation for the Osmo GSM utility library
.
This package contains the documentation for the libosmogsm library.
Package: libosmoisdn0
Section: libs
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends}
Pre-Depends: ${misc:Pre-Depends}
Description: Osmo ISDN utility library
This is part of the libosmocore "meta"-library. The libosmocore library
contains various utility functions that were originally developed as part of
the OpenBSC project, but which are of a more generic nature and thus useful to
(at least) other programs that are developed in the sphere of Free Software /
Open Source mobile communication.
.
The libosmoisdn library in particular is a collection of common code used in
various ISDN related sub-projects inside the Osmocom family of projects. It
includes an I.460 sub-channel multiplex and a generic LAPD core.
Package: libosmoisdn-doc
Architecture: all
Section: doc
Depends: ${misc:Depends},
libosmoisdn0,
libjs-jquery
Description: Documentation for the Osmo ISDN utility library
This is part of the libosmocore "meta"-library. The libosmocore library
contains various utility functions that were originally developed as part of
the OpenBSC project, but which are of a more generic nature and thus useful to
(at least) other programs that are developed in the sphere of Free Software /
Open Source mobile communication.
.
This package contains the documentation for the libosmoisdnm library.
Package: libosmovty9
Section: libs
Architecture: any

2
debian/copyright vendored
View File

@ -36,7 +36,7 @@ Copyright: 2011 Harald Welte <laforge@gnumonks.org>
License: GPL-2+
Files: src/gsm/gsm48_ie.c
src/gsm/lapd_core.c
src/isdn/lapd_core.c
src/gsm/lapdm.c
Copyright: 2008,2010-2011 Harald Welte <laforge@gnumonks.org>
2009-2011 Andreas Eversberg <jolly@eversberg.eu>

View File

@ -5,4 +5,5 @@ usr/include/osmocom/codec
usr/include/osmocom/core
usr/include/osmocom/crypt
usr/include/osmocom/gsm
usr/include/osmocom/isdn
usr/include/osmocom/vty

7
debian/libosmoisdn-doc.doc-base vendored Normal file
View File

@ -0,0 +1,7 @@
Document: libosmoisdn-doc
Title: Documentation for the libosmoisdn library
Section: Programming
Format: HTML
Index: /usr/share/doc/libosmocore/isdn/html/index.html
Files: /usr/share/doc/libosmocore/isdn/html/*.html

1
debian/libosmoisdn-doc.install vendored Normal file
View File

@ -0,0 +1 @@
usr/share/doc/libosmocore/isdn/

1
debian/libosmoisdn0.install vendored Normal file
View File

@ -0,0 +1 @@
usr/lib/*/libosmoisdn*.so.*

1
debian/rules vendored
View File

@ -50,6 +50,7 @@ override_dh_clean:
$(RM) -r doc/core/
$(RM) -r doc/ctrl/
$(RM) -r doc/gsm/
$(RM) -r doc/isdn/
$(RM) -r doc/gb/
$(RM) -r doc/vty/html/
$(RM) -r doc/vty/latex/

View File

@ -3,6 +3,7 @@ SUBDIRS = \
vty \
codec \
gsm \
isdn \
crypt \
coding \
gprs \

View File

@ -1,116 +1,2 @@
/*! \file i460_mux.h
* ITU-T I.460 sub-channel multiplexer + demultiplexer */
/*
* (C) 2020 by Harald Welte <laforge@gnumonks.org>
*
* SPDX-License-Identifier: GPL-2.0+
*
* 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 2 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.
*/
#pragma once
#include <stdint.h>
#include <osmocom/core/bits.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
/* I.460 sub-slot rate */
enum osmo_i460_rate {
OSMO_I460_RATE_NONE, /* disabled */
OSMO_I460_RATE_64k,
OSMO_I460_RATE_32k,
OSMO_I460_RATE_16k,
OSMO_I460_RATE_8k,
};
struct osmo_i460_subchan;
typedef void (*out_cb_bits_t)(struct osmo_i460_subchan *schan, void *user_data,
const ubit_t *bits, unsigned int num_bits);
typedef void (*out_cb_bytes_t)(struct osmo_i460_subchan *schan, void *user_data,
const uint8_t *bytes, unsigned int num_bytes);
struct osmo_i460_subchan_demux {
/*! bit-buffer for output bits */
uint8_t *out_bitbuf;
/*! size of out_bitbuf in bytes */
unsigned int out_bitbuf_size;
/*! offset of next bit to be written in out_bitbuf */
unsigned int out_idx;
/*! callback to be called once we have received out_bitbuf_size bits */
out_cb_bits_t out_cb_bits;
out_cb_bytes_t out_cb_bytes;
void *user_data;
};
typedef void (*in_cb_queue_empty_t)(struct osmo_i460_subchan *schan, void *user_data);
struct osmo_i460_subchan_mux {
/*! list of to-be-transmitted message buffers */
struct llist_head tx_queue;
in_cb_queue_empty_t in_cb_queue_empty;
void *user_data;
};
struct osmo_i460_subchan {
struct osmo_i460_timeslot *ts; /* back-pointer */
enum osmo_i460_rate rate; /* 8/16/32/64k */
uint8_t bit_offset; /* bit offset inside each byte of the B-channel */
struct osmo_i460_subchan_demux demux;
struct osmo_i460_subchan_mux mux;
};
struct osmo_i460_timeslot {
struct osmo_i460_subchan schan[8];
};
/*! description of a sub-channel; passed by caller */
struct osmo_i460_schan_desc {
enum osmo_i460_rate rate;
uint8_t bit_offset;
struct {
/* size (in bits) of the internal buffer; determines granularity */
size_t num_bits;
/*! call-back function called whenever we received num_bits */
out_cb_bits_t out_cb_bits;
/*! out_cb_bytes call-back function called whenever we received num_bits.
* The user is usually expected to provide either out_cb_bits or out_cb_bytes. If only
* out_cb_bits is provided, output data will always be provided as unpacked bits; if only
* out_cb_bytes is provided, output data will always be provided as packet bits (bytes). If
* both are provided, it is up to the I.460 multiplex to decide if it calls either of the two,
* depending on what can be provided without extra conversion. */
out_cb_bytes_t out_cb_bytes;
/* opaque user data pointer to pass to out_cb */
void *user_data;
} demux;
struct {
/* call-back function whenever the muxer requires more input data from the sub-channels,
* but has nothing enqueued yet. A typical function would then call osmo_i460_mux_enqueue() */
in_cb_queue_empty_t in_cb_queue_empty;
/* opaque user data pointer to pass to in_cb */
void *user_data;
} mux;
};
void osmo_i460_demux_in(struct osmo_i460_timeslot *ts, const uint8_t *data, size_t data_len);
void osmo_i460_mux_enqueue(struct osmo_i460_subchan *schan, struct msgb *msg);
int osmo_i460_mux_out(struct osmo_i460_timeslot *ts, uint8_t *out, size_t out_len);
void osmo_i460_ts_init(struct osmo_i460_timeslot *ts);
struct osmo_i460_subchan *
osmo_i460_subchan_add(void *ctx, struct osmo_i460_timeslot *ts, const struct osmo_i460_schan_desc *chd);
void osmo_i460_subchan_del(struct osmo_i460_subchan *schan);
/*! @} */
#include <osmocom/isdn/i460_mux.h>

View File

@ -1,177 +1,2 @@
/*! \file lapd_core.h
* primitive related stuff
*/
#pragma once
#include <stdint.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/prim.h>
/*! \defgroup lapd LAPD implementation common part
* @{
* \file lapd_core.h
*/
#define LOGDL(dl, level, fmt, args...) \
LOGP(DLLAPD, level, "(%s) " fmt, (dl)->name, ## args)
/*! LAPD related primitives (L2<->L3 SAP)*/
enum osmo_dl_prim {
PRIM_DL_UNIT_DATA, /*!< DL-UNIT-DATA */
PRIM_DL_DATA, /*!< DL-DATA */
PRIM_DL_EST, /*!< DL-ESTABLISH */
PRIM_DL_REL, /*!< DL-RLEEASE */
PRIM_DL_SUSP, /*!< DL-SUSPEND */
PRIM_DL_RES, /*!< DL-RESUME */
PRIM_DL_RECON, /*!< DL-RECONNECT */
PRIM_MDL_ERROR, /*!< MDL-ERROR */
};
/* Uses the same values as RLL, so no conversion for GSM is required. */
#define MDL_CAUSE_T200_EXPIRED 0x01
#define MDL_CAUSE_REEST_REQ 0x02
#define MDL_CAUSE_UNSOL_UA_RESP 0x03
#define MDL_CAUSE_UNSOL_DM_RESP 0x04
#define MDL_CAUSE_UNSOL_DM_RESP_MF 0x05
#define MDL_CAUSE_UNSOL_SPRV_RESP 0x06
#define MDL_CAUSE_SEQ_ERR 0x07
#define MDL_CAUSE_UFRM_INC_PARAM 0x08
#define MDL_CAUSE_SFRM_INC_PARAM 0x09
#define MDL_CAUSE_IFRM_INC_MBITS 0x0a
#define MDL_CAUSE_IFRM_INC_LEN 0x0b
#define MDL_CAUSE_FRM_UNIMPL 0x0c
#define MDL_CAUSE_SABM_MF 0x0d
#define MDL_CAUSE_SABM_INFO_NOTALL 0x0e
#define MDL_CAUSE_FRMR 0x0f
/*! for MDL-ERROR.ind */
struct mdl_error_ind_param {
uint8_t cause; /*!< generic cause value */
};
/*! for DL-REL.req */
struct dl_rel_req_param {
uint8_t mode; /*!< release mode */
};
/*! primitive header for LAPD DL-SAP primitives */
struct osmo_dlsap_prim {
struct osmo_prim_hdr oph; /*!< generic primitive header */
union {
struct mdl_error_ind_param error_ind;
struct dl_rel_req_param rel_req;
} u; /*!< request-specific data */
};
/*! LAPD mode/role */
enum lapd_mode {
LAPD_MODE_USER, /*!< behave like user */
LAPD_MODE_NETWORK, /*!< behave like network */
};
/*! LAPD state (Figure B.2/Q.921)*/
enum lapd_state {
LAPD_STATE_NULL = 0,
LAPD_STATE_TEI_UNASS,
LAPD_STATE_ASS_TEI_WAIT,
LAPD_STATE_EST_TEI_WAIT,
LAPD_STATE_IDLE,
LAPD_STATE_SABM_SENT,
LAPD_STATE_DISC_SENT,
LAPD_STATE_MF_EST,
LAPD_STATE_TIMER_RECOV,
};
/*! LAPD message format (I / S / U) */
enum lapd_format {
LAPD_FORM_UKN = 0,
LAPD_FORM_I,
LAPD_FORM_S,
LAPD_FORM_U,
};
/*! LAPD message context */
struct lapd_msg_ctx {
struct lapd_datalink *dl;
int n201;
/* address */
uint8_t cr;
uint8_t sapi;
uint8_t tei;
uint8_t lpd;
/* control */
uint8_t format;
uint8_t p_f; /* poll / final bit */
uint8_t n_send;
uint8_t n_recv;
uint8_t s_u; /* S or repectivly U function bits */
/* length */
int length;
uint8_t more;
};
struct lapd_cr_ent {
uint8_t cmd;
uint8_t resp;
};
struct lapd_history {
struct msgb *msg; /* message to be sent / NULL, if histoy is empty */
int more; /* if message is fragmented */
};
/*! LAPD datalink */
struct lapd_datalink {
int (*send_dlsap)(struct osmo_dlsap_prim *dp,
struct lapd_msg_ctx *lctx);
int (*send_ph_data_req)(struct lapd_msg_ctx *lctx, struct msgb *msg);
int (*update_pending_frames)(struct lapd_msg_ctx *lctx);
struct {
/*! filled-in once we set the lapd_mode above */
struct lapd_cr_ent loc2rem;
struct lapd_cr_ent rem2loc;
} cr;
enum lapd_mode mode; /*!< current mode of link */
int use_sabme; /*!< use SABME instead of SABM */
int reestablish; /*!< enable reestablish support */
int n200, n200_est_rel; /*!< number of retranmissions */
struct lapd_msg_ctx lctx; /*!< LAPD context */
int maxf; /*!< maximum frame size (after defragmentation) */
uint8_t k; /*!< maximum number of unacknowledged frames */
uint8_t v_range; /*!< range of sequence numbers */
uint8_t v_send; /*!< seq nr of next I frame to be transmitted */
uint8_t v_ack; /*!< last frame ACKed by peer */
uint8_t v_recv; /*!< seq nr of next I frame expected to be received */
uint32_t state; /*!< LAPD state (\ref lapd_state) */
int seq_err_cond; /*!< condition of sequence error */
uint8_t own_busy; /*!< receiver busy on our side */
uint8_t peer_busy; /*!< receiver busy on remote side */
int t200_sec, t200_usec; /*!< retry timer (default 1 sec) */
int t203_sec, t203_usec; /*!< retry timer (default 10 secs) */
struct osmo_timer_list t200; /*!< T200 timer */
struct osmo_timer_list t203; /*!< T203 timer */
uint8_t retrans_ctr; /*!< re-transmission counter */
struct llist_head tx_queue; /*!< frames to L1 */
struct llist_head send_queue; /*!< frames from L3 */
struct msgb *send_buffer; /*!< current frame transmitting */
int send_out; /*!< how much was sent from send_buffer */
struct lapd_history *tx_hist; /*!< tx history structure array */
uint8_t range_hist; /*!< range of history buffer 2..2^n */
struct msgb *rcv_buffer; /*!< buffer to assemble the received message */
struct msgb *cont_res; /*!< buffer to store content resolution data on network side, to detect multiple phones on same channel */
char *name; /*!< user-provided name */
};
void lapd_dl_init(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf)
OSMO_DEPRECATED("Use lapd_dl_init2() instead");
void lapd_dl_init2(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf, const char *name);
void lapd_dl_set_name(struct lapd_datalink *dl, const char *name);
void lapd_dl_exit(struct lapd_datalink *dl);
void lapd_dl_reset(struct lapd_datalink *dl);
int lapd_set_mode(struct lapd_datalink *dl, enum lapd_mode mode);
int lapd_ph_data_ind(struct msgb *msg, struct lapd_msg_ctx *lctx);
int lapd_recv_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx);
/*! @} */
#include <osmocom/isdn/lapd_core.h>

View File

@ -0,0 +1,6 @@
osmoisdn_HEADERS = \
i460_mux.h \
lapd_core.h \
$(NULL)
osmoisdndir = $(includedir)/osmocom/isdn

View File

@ -0,0 +1,116 @@
/*! \file i460_mux.h
* ITU-T I.460 sub-channel multiplexer + demultiplexer */
/*
* (C) 2020 by Harald Welte <laforge@gnumonks.org>
*
* SPDX-License-Identifier: GPL-2.0+
*
* 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 2 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.
*/
#pragma once
#include <stdint.h>
#include <osmocom/core/bits.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
/* I.460 sub-slot rate */
enum osmo_i460_rate {
OSMO_I460_RATE_NONE, /* disabled */
OSMO_I460_RATE_64k,
OSMO_I460_RATE_32k,
OSMO_I460_RATE_16k,
OSMO_I460_RATE_8k,
};
struct osmo_i460_subchan;
typedef void (*out_cb_bits_t)(struct osmo_i460_subchan *schan, void *user_data,
const ubit_t *bits, unsigned int num_bits);
typedef void (*out_cb_bytes_t)(struct osmo_i460_subchan *schan, void *user_data,
const uint8_t *bytes, unsigned int num_bytes);
struct osmo_i460_subchan_demux {
/*! bit-buffer for output bits */
uint8_t *out_bitbuf;
/*! size of out_bitbuf in bytes */
unsigned int out_bitbuf_size;
/*! offset of next bit to be written in out_bitbuf */
unsigned int out_idx;
/*! callback to be called once we have received out_bitbuf_size bits */
out_cb_bits_t out_cb_bits;
out_cb_bytes_t out_cb_bytes;
void *user_data;
};
typedef void (*in_cb_queue_empty_t)(struct osmo_i460_subchan *schan, void *user_data);
struct osmo_i460_subchan_mux {
/*! list of to-be-transmitted message buffers */
struct llist_head tx_queue;
in_cb_queue_empty_t in_cb_queue_empty;
void *user_data;
};
struct osmo_i460_subchan {
struct osmo_i460_timeslot *ts; /* back-pointer */
enum osmo_i460_rate rate; /* 8/16/32/64k */
uint8_t bit_offset; /* bit offset inside each byte of the B-channel */
struct osmo_i460_subchan_demux demux;
struct osmo_i460_subchan_mux mux;
};
struct osmo_i460_timeslot {
struct osmo_i460_subchan schan[8];
};
/*! description of a sub-channel; passed by caller */
struct osmo_i460_schan_desc {
enum osmo_i460_rate rate;
uint8_t bit_offset;
struct {
/* size (in bits) of the internal buffer; determines granularity */
size_t num_bits;
/*! call-back function called whenever we received num_bits */
out_cb_bits_t out_cb_bits;
/*! out_cb_bytes call-back function called whenever we received num_bits.
* The user is usually expected to provide either out_cb_bits or out_cb_bytes. If only
* out_cb_bits is provided, output data will always be provided as unpacked bits; if only
* out_cb_bytes is provided, output data will always be provided as packet bits (bytes). If
* both are provided, it is up to the I.460 multiplex to decide if it calls either of the two,
* depending on what can be provided without extra conversion. */
out_cb_bytes_t out_cb_bytes;
/* opaque user data pointer to pass to out_cb */
void *user_data;
} demux;
struct {
/* call-back function whenever the muxer requires more input data from the sub-channels,
* but has nothing enqueued yet. A typical function would then call osmo_i460_mux_enqueue() */
in_cb_queue_empty_t in_cb_queue_empty;
/* opaque user data pointer to pass to in_cb */
void *user_data;
} mux;
};
void osmo_i460_demux_in(struct osmo_i460_timeslot *ts, const uint8_t *data, size_t data_len);
void osmo_i460_mux_enqueue(struct osmo_i460_subchan *schan, struct msgb *msg);
int osmo_i460_mux_out(struct osmo_i460_timeslot *ts, uint8_t *out, size_t out_len);
void osmo_i460_ts_init(struct osmo_i460_timeslot *ts);
struct osmo_i460_subchan *
osmo_i460_subchan_add(void *ctx, struct osmo_i460_timeslot *ts, const struct osmo_i460_schan_desc *chd);
void osmo_i460_subchan_del(struct osmo_i460_subchan *schan);
/*! @} */

View File

@ -0,0 +1,176 @@
/*! \file lapd_core.h
* primitive related stuff
*/
#pragma once
#include <stdint.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/prim.h>
/*! \defgroup lapd LAPD implementation common part
* @{
* \file lapd_core.h
*/
#define LOGDL(dl, level, fmt, args...) \
LOGP(DLLAPD, level, "(%s) " fmt, (dl)->name, ## args)
/*! LAPD related primitives (L2<->L3 SAP)*/
enum osmo_dl_prim {
PRIM_DL_UNIT_DATA, /*!< DL-UNIT-DATA */
PRIM_DL_DATA, /*!< DL-DATA */
PRIM_DL_EST, /*!< DL-ESTABLISH */
PRIM_DL_REL, /*!< DL-RLEEASE */
PRIM_DL_SUSP, /*!< DL-SUSPEND */
PRIM_DL_RES, /*!< DL-RESUME */
PRIM_DL_RECON, /*!< DL-RECONNECT */
PRIM_MDL_ERROR, /*!< MDL-ERROR */
};
/* Uses the same values as RLL, so no conversion for GSM is required. */
#define MDL_CAUSE_T200_EXPIRED 0x01
#define MDL_CAUSE_REEST_REQ 0x02
#define MDL_CAUSE_UNSOL_UA_RESP 0x03
#define MDL_CAUSE_UNSOL_DM_RESP 0x04
#define MDL_CAUSE_UNSOL_DM_RESP_MF 0x05
#define MDL_CAUSE_UNSOL_SPRV_RESP 0x06
#define MDL_CAUSE_SEQ_ERR 0x07
#define MDL_CAUSE_UFRM_INC_PARAM 0x08
#define MDL_CAUSE_SFRM_INC_PARAM 0x09
#define MDL_CAUSE_IFRM_INC_MBITS 0x0a
#define MDL_CAUSE_IFRM_INC_LEN 0x0b
#define MDL_CAUSE_FRM_UNIMPL 0x0c
#define MDL_CAUSE_SABM_MF 0x0d
#define MDL_CAUSE_SABM_INFO_NOTALL 0x0e
#define MDL_CAUSE_FRMR 0x0f
/*! for MDL-ERROR.ind */
struct mdl_error_ind_param {
uint8_t cause; /*!< generic cause value */
};
/*! for DL-REL.req */
struct dl_rel_req_param {
uint8_t mode; /*!< release mode */
};
/*! primitive header for LAPD DL-SAP primitives */
struct osmo_dlsap_prim {
struct osmo_prim_hdr oph; /*!< generic primitive header */
union {
struct mdl_error_ind_param error_ind;
struct dl_rel_req_param rel_req;
} u; /*!< request-specific data */
};
/*! LAPD mode/role */
enum lapd_mode {
LAPD_MODE_USER, /*!< behave like user */
LAPD_MODE_NETWORK, /*!< behave like network */
};
/*! LAPD state (Figure B.2/Q.921)*/
enum lapd_state {
LAPD_STATE_NULL = 0,
LAPD_STATE_TEI_UNASS,
LAPD_STATE_ASS_TEI_WAIT,
LAPD_STATE_EST_TEI_WAIT,
LAPD_STATE_IDLE,
LAPD_STATE_SABM_SENT,
LAPD_STATE_DISC_SENT,
LAPD_STATE_MF_EST,
LAPD_STATE_TIMER_RECOV,
};
/*! LAPD message format (I / S / U) */
enum lapd_format {
LAPD_FORM_UKN = 0,
LAPD_FORM_I,
LAPD_FORM_S,
LAPD_FORM_U,
};
/*! LAPD message context */
struct lapd_msg_ctx {
struct lapd_datalink *dl;
int n201;
/* address */
uint8_t cr;
uint8_t sapi;
uint8_t tei;
uint8_t lpd;
/* control */
uint8_t format;
uint8_t p_f; /* poll / final bit */
uint8_t n_send;
uint8_t n_recv;
uint8_t s_u; /* S or repectivly U function bits */
/* length */
int length;
uint8_t more;
};
struct lapd_cr_ent {
uint8_t cmd;
uint8_t resp;
};
struct lapd_history {
struct msgb *msg; /* message to be sent / NULL, if histoy is empty */
int more; /* if message is fragmented */
};
/*! LAPD datalink */
struct lapd_datalink {
int (*send_dlsap)(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx);
int (*send_ph_data_req)(struct lapd_msg_ctx *lctx, struct msgb *msg);
int (*update_pending_frames)(struct lapd_msg_ctx *lctx);
struct {
/*! filled-in once we set the lapd_mode above */
struct lapd_cr_ent loc2rem;
struct lapd_cr_ent rem2loc;
} cr;
enum lapd_mode mode; /*!< current mode of link */
int use_sabme; /*!< use SABME instead of SABM */
int reestablish; /*!< enable reestablish support */
int n200, n200_est_rel; /*!< number of retranmissions */
struct lapd_msg_ctx lctx; /*!< LAPD context */
int maxf; /*!< maximum frame size (after defragmentation) */
uint8_t k; /*!< maximum number of unacknowledged frames */
uint8_t v_range; /*!< range of sequence numbers */
uint8_t v_send; /*!< seq nr of next I frame to be transmitted */
uint8_t v_ack; /*!< last frame ACKed by peer */
uint8_t v_recv; /*!< seq nr of next I frame expected to be received */
uint32_t state; /*!< LAPD state (\ref lapd_state) */
int seq_err_cond; /*!< condition of sequence error */
uint8_t own_busy; /*!< receiver busy on our side */
uint8_t peer_busy; /*!< receiver busy on remote side */
int t200_sec, t200_usec; /*!< retry timer (default 1 sec) */
int t203_sec, t203_usec; /*!< retry timer (default 10 secs) */
struct osmo_timer_list t200; /*!< T200 timer */
struct osmo_timer_list t203; /*!< T203 timer */
uint8_t retrans_ctr; /*!< re-transmission counter */
struct llist_head tx_queue; /*!< frames to L1 */
struct llist_head send_queue; /*!< frames from L3 */
struct msgb *send_buffer; /*!< current frame transmitting */
int send_out; /*!< how much was sent from send_buffer */
struct lapd_history *tx_hist; /*!< tx history structure array */
uint8_t range_hist; /*!< range of history buffer 2..2^n */
struct msgb *rcv_buffer; /*!< buffer to assemble the received message */
struct msgb *cont_res; /*!< buffer to store content resolution data on network side, to detect multiple phones on same channel */
char *name; /*!< user-provided name */
};
void lapd_dl_init(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf)
OSMO_DEPRECATED("Use lapd_dl_init2() instead");
void lapd_dl_init2(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf, const char *name);
void lapd_dl_set_name(struct lapd_datalink *dl, const char *name);
void lapd_dl_exit(struct lapd_datalink *dl);
void lapd_dl_reset(struct lapd_datalink *dl);
int lapd_set_mode(struct lapd_datalink *dl, enum lapd_mode mode);
int lapd_ph_data_ind(struct msgb *msg, struct lapd_msg_ctx *lctx);
int lapd_recv_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx);
/*! @} */

View File

@ -6,6 +6,6 @@ includedir=@includedir@
Name: Osmocom GSM Core Library
Description: GSM Core Library
Version: @VERSION@
Requires: talloc, libosmocore
Requires: talloc, libosmocore, libosmoisdn
Libs: -L${libdir} -losmogsm
Cflags: -I${includedir}/

11
libosmoisdn.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: Osmocom ISDN Library
Description: ISDN Library
Version: @VERSION@
Requires: talloc, libosmocore
Libs: -L${libdir} -losmoisdn
Cflags: -I${includedir}/

View File

@ -1,6 +1,7 @@
SUBDIRS = \
core \
vty \
isdn \
codec \
gsm \
coding \

View File

@ -25,18 +25,18 @@ libgsmint_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \
gsm48_ie.c gsm0808.c sysinfo.c \
gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c gsm0502.c \
gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \
lapd_core.c lapdm.c kasumi.c gsm29205.c gsm_04_08_gprs.c \
lapdm.c kasumi.c gsm29205.c gsm_04_08_gprs.c \
auth_core.c auth_comp128v1.c auth_comp128v23.c auth_xor.c \
auth_milenage.c milenage/aes-encblock.c gea.c \
milenage/aes-internal.c milenage/aes-internal-enc.c \
milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \
gsup.c gsup_sms.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \
gsm23003.c gsm23236.c mncc.c bts_features.c oap_client.c \
gsm29118.c gsm48_rest_octets.c cbsp.c gsm48049.c i460_mux.c \
gsm29118.c gsm48_rest_octets.c cbsp.c gsm48049.c \
gad.c bsslap.c bssmap_le.c kdf.c iuup.c
libgsmint_la_LDFLAGS = -no-undefined
libgsmint_la_LIBADD = $(top_builddir)/src/core/libosmocore.la
libgsmint_la_LIBADD = $(top_builddir)/src/core/libosmocore.la $(top_builddir)/src/isdn/libosmoisdn.la
libosmogsm_la_SOURCES =
libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) -no-undefined

25
src/isdn/Makefile.am Normal file
View File

@ -0,0 +1,25 @@
# This is _NOT_ the library release version, it's an API version.
# Please read chapter "Library interface versions" of the libtool documentation
# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html
LIBVERSION=0:0:0
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
if ENABLE_PSEUDOTALLOC
AM_CPPFLAGS += -I$(top_srcdir)/src/pseudotalloc
endif
noinst_LTLIBRARIES = libisdnint.la
lib_LTLIBRARIES = libosmoisdn.la
libisdnint_la_SOURCES = i460_mux.c lapd_core.c
libisdnint_la_LDFLAGS = -no-undefined
libisdnint_la_LIBADD = $(top_builddir)/src/core/libosmocore.la
libosmoisdn_la_SOURCES =
libosmoisdn_la_LDFLAGS = $(LTLDFLAGS_OSMOISDN) -version-info $(LIBVERSION) -no-undefined
libosmoisdn_la_LIBADD = libisdnint.la $(TALLOC_LIBS)
EXTRA_DIST = libosmoisdn.map

View File

@ -21,7 +21,7 @@
#include <osmocom/core/bits.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/i460_mux.h>
#include <osmocom/isdn/i460_mux.h>
/* count the number of sub-channels in this I460 slot */
static int osmo_i460_subchan_count(struct osmo_i460_timeslot *ts)

View File

@ -79,7 +79,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/lapd_core.h>
#include <osmocom/isdn/lapd_core.h>
#include <osmocom/gsm/rsl.h>
/* TS 04.06 Table 4 / Section 3.8.1 */

24
src/isdn/libosmoisdn.map Normal file
View File

@ -0,0 +1,24 @@
LIBOSMOISDN_1.0 {
global:
tall_lapd_ctx;
lapd_dl_exit;
lapd_dl_init;
lapd_dl_init2;
lapd_dl_set_name;
lapd_dl_reset;
lapd_msgb_alloc;
lapd_ph_data_ind;
lapd_recv_dlsap;
lapd_set_mode;
lapd_state_names;
osmo_i460_demux_in;
osmo_i460_mux_enqueue;
osmo_i460_mux_out;
osmo_i460_subchan_add;
osmo_i460_subchan_del;
osmo_i460_ts_init;
local: *;
};

View File

@ -160,7 +160,7 @@ gprs_gprs_test_SOURCES = gprs/gprs_test.c
gprs_gprs_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
lapd_lapd_test_SOURCES = lapd/lapd_test.c
lapd_lapd_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
lapd_lapd_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/isdn/libosmoisdn.la
msgb_msgb_test_SOURCES = msgb/msgb_test.c
@ -315,7 +315,7 @@ exec_exec_test_SOURCES = exec/exec_test.c
exec_exec_test_LDADD = $(LDADD)
i460_mux_i460_mux_test_SOURCES = i460_mux/i460_mux_test.c
i460_mux_i460_mux_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
i460_mux_i460_mux_test_LDADD = $(LDADD) $(top_builddir)/src/isdn/libosmoisdn.la
bitgen_bitgen_test_SOURCES = bitgen/bitgen_test.c
bitgen_bitgen_test_LDADD = $(LDADD)

View File

@ -1,7 +1,7 @@
#include <osmocom/core/utils.h>
#include <osmocom/gsm/i460_mux.h>
#include <osmocom/isdn/i460_mux.h>
static void bits_cb(struct osmo_i460_subchan *schan, void *user_data,
const ubit_t *bits, unsigned int num_bits)