├── .checkpatch.conf ├── .github └── FUNDING.yml ├── .gitignore ├── .gitreview ├── COPYING ├── Makefile.am ├── README.md ├── TODO-RELEASE ├── asn1 └── RSPRO.asn ├── configure.ac ├── contrib ├── Makefile.am ├── etc_default │ ├── Makefile.am │ ├── osmo-remsim-bankd │ ├── osmo-remsim-client │ ├── osmo-remsim-client-0 │ ├── osmo-remsim-client-1 │ ├── osmo-remsim-client-2 │ └── osmo-remsim-client-3 ├── jenkins.sh ├── osmo-remsim-apitool ├── owhw-event-script.sh └── systemd │ ├── Makefile.am │ ├── osmo-remsim-bankd.service │ ├── osmo-remsim-client@.service │ └── osmo-remsim-server.service ├── debian ├── changelog ├── compat ├── control ├── copyright ├── libifd-osmo-remsim-client0.install ├── libosmo-rspro-dev.install ├── libosmo-rspro2.install ├── osmo-remsim-apitool.install ├── osmo-remsim-bankd.install ├── osmo-remsim-client-shell.install ├── osmo-remsim-client-st2.install ├── osmo-remsim-doc.install ├── osmo-remsim-server.install └── rules ├── doc ├── Makefile.am ├── examples │ ├── Makefile.am │ └── bankd_pcsc_slots.csv ├── manuals │ ├── Makefile.am │ ├── chapters │ │ ├── logging.adoc │ │ ├── overview.adoc │ │ ├── remsim-apitool.adoc │ │ ├── remsim-bankd.adoc │ │ ├── remsim-client.adoc │ │ ├── remsim-server.adoc │ │ └── rspro.adoc │ ├── osmo-remsim-usermanual-docinfo.xml │ └── osmo-remsim-usermanual.adoc ├── osmo-remsim-simple.dot ├── osmo-remsim.dot └── remote-sim.dot ├── ffasn1c ├── Makefile ├── main.c ├── rspro.c └── rspro.h ├── git-version-gen ├── include ├── Makefile.am └── osmocom │ ├── Makefile.am │ └── rspro │ ├── ATR.h │ ├── BIT_STRING.h │ ├── BOOLEAN.h │ ├── BankId.h │ ├── BankSlot.h │ ├── BankSlotStatusInd.h │ ├── ClientId.h │ ├── ClientSlot.h │ ├── ClientSlotStatusInd.h │ ├── ComponentIdentity.h │ ├── ComponentName.h │ ├── ComponentType.h │ ├── ConfigClientBankReq.h │ ├── ConfigClientBankRes.h │ ├── ConfigClientIdReq.h │ ├── ConfigClientIdRes.h │ ├── ConnectBankReq.h │ ├── ConnectBankRes.h │ ├── ConnectClientReq.h │ ├── ConnectClientRes.h │ ├── CreateMappingReq.h │ ├── CreateMappingRes.h │ ├── ErrorCode.h │ ├── ErrorInd.h │ ├── ErrorSeverity.h │ ├── ErrorString.h │ ├── IA5String.h │ ├── INTEGER.h │ ├── IpAddress.h │ ├── IpPort.h │ ├── Ipv4Address.h │ ├── Ipv6Address.h │ ├── Makefile.am │ ├── NativeEnumerated.h │ ├── NativeInteger.h │ ├── OCTET_STRING.h │ ├── OperationTag.h │ ├── PortNumber.h │ ├── RemoveMappingReq.h │ ├── RemoveMappingRes.h │ ├── ResetStateReq.h │ ├── ResetStateRes.h │ ├── ResultCode.h │ ├── RsproPDU.h │ ├── RsproPDUchoice.h │ ├── SetAtrReq.h │ ├── SetAtrRes.h │ ├── SlotNumber.h │ ├── SlotPhysStatus.h │ ├── TpduCardToModem.h │ ├── TpduFlags.h │ ├── TpduModemToCard.h │ ├── asn_application.h │ ├── asn_codecs.h │ ├── asn_codecs_prim.h │ ├── asn_internal.h │ ├── asn_system.h │ ├── ber_decoder.h │ ├── ber_tlv_length.h │ ├── ber_tlv_tag.h │ ├── constr_CHOICE.h │ ├── constr_SEQUENCE.h │ ├── constr_TYPE.h │ ├── constraints.h │ ├── der_encoder.h │ ├── per_decoder.h │ ├── per_encoder.h │ ├── per_opentype.h │ ├── per_support.h │ ├── xer_decoder.h │ ├── xer_encoder.h │ └── xer_support.h ├── libosmo-rspro.pc.in ├── move-asn1-header-files.sh └── src ├── Makefile.am ├── asn1c_helpers.c ├── asn1c_helpers.h ├── bankd ├── Makefile.am ├── bankd.h ├── bankd_main.c ├── bankd_pcsc.c ├── driver_core.c ├── driver_pcsc.c ├── gsmtap.c ├── gsmtap.h ├── internal.h └── main.c ├── client ├── Makefile.am ├── PkgInfo ├── client.h ├── main_fsm.c ├── osmo-remsim-client-reader_conf.in ├── remsim_client.c ├── remsim_client_main.c ├── user_ifdhandler.c ├── user_shell.c └── user_simtrace2.c ├── debug.c ├── debug.h ├── rspro ├── ATR.c ├── BIT_STRING.c ├── BOOLEAN.c ├── BankId.c ├── BankSlot.c ├── BankSlotStatusInd.c ├── ClientId.c ├── ClientSlot.c ├── ClientSlotStatusInd.c ├── ComponentIdentity.c ├── ComponentName.c ├── ComponentType.c ├── ConfigClientBankReq.c ├── ConfigClientBankRes.c ├── ConfigClientIdReq.c ├── ConfigClientIdRes.c ├── ConnectBankReq.c ├── ConnectBankRes.c ├── ConnectClientReq.c ├── ConnectClientRes.c ├── CreateMappingReq.c ├── CreateMappingRes.c ├── ErrorCode.c ├── ErrorInd.c ├── ErrorSeverity.c ├── ErrorString.c ├── IA5String.c ├── INTEGER.c ├── IpAddress.c ├── IpPort.c ├── Ipv4Address.c ├── Ipv6Address.c ├── Makefile.am ├── NativeEnumerated.c ├── NativeInteger.c ├── OCTET_STRING.c ├── OperationTag.c ├── PortNumber.c ├── RemoveMappingReq.c ├── RemoveMappingRes.c ├── ResetStateReq.c ├── ResetStateRes.c ├── ResultCode.c ├── RsproPDU.c ├── RsproPDUchoice.c ├── SetAtrReq.c ├── SetAtrRes.c ├── SlotNumber.c ├── SlotPhysStatus.c ├── TpduCardToModem.c ├── TpduFlags.c ├── TpduModemToCard.c ├── asn_codecs_prim.c ├── ber_decoder.c ├── ber_tlv_length.c ├── ber_tlv_tag.c ├── constr_CHOICE.c ├── constr_SEQUENCE.c ├── constr_TYPE.c ├── constraints.c ├── converter-sample.c ├── der_encoder.c ├── per_decoder.c ├── per_encoder.c ├── per_opentype.c ├── per_support.c ├── xer_decoder.c ├── xer_encoder.c └── xer_support.c ├── rspro_client_fsm.c ├── rspro_client_fsm.h ├── rspro_util.c ├── rspro_util.h ├── server ├── Makefile.am ├── remsim_server.c ├── rest_api.c ├── rest_api.h ├── rspro_server.c └── rspro_server.h ├── slotmap.c └── slotmap.h /.checkpatch.conf: -------------------------------------------------------------------------------- 1 | --exclude ^src/rspro/.*\.c$ 2 | --exclude ^include/osmocom/rspro/.*\.h$ 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | open_collective: osmocom 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | *.a 5 | *.so 6 | *~ 7 | .*.swp 8 | .deps 9 | .libs 10 | .version 11 | .tarball-version 12 | autom4te.cache 13 | aclocal.m4 14 | config.guess 15 | config.log 16 | config.status 17 | config.sub 18 | configure 19 | compile 20 | depcomp 21 | install-sh 22 | libosmo-rspro.pc 23 | libtool 24 | *-libtool 25 | ltmain.sh 26 | missing 27 | Makefile.in 28 | Makefile 29 | Makefile.am.sample 30 | tags 31 | m4 32 | gen_rspro.stamp 33 | 34 | src/client/osmo-remsim-client-reader_conf 35 | src/client/osmo-remsim-client-shell 36 | src/client/osmo-remsim-client-st2 37 | src/bankd/pcsc_test 38 | src/bankd/osmo-remsim-bankd 39 | src/server/osmo-remsim-server 40 | 41 | contrib/deps 42 | deps 43 | 44 | debian/tmp 45 | debian/osmo-remsim-* 46 | debian/libosmo-rspro0 47 | debian/libosmo-rspro-dev 48 | debian/*.substvars 49 | debian/*.debhelper.log 50 | debian/autoreconf.* 51 | debian/.debhelper 52 | debian/debhelper* 53 | debian/files 54 | 55 | contrib/osmo-remsim.spec 56 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=gerrit.osmocom.org 3 | project=osmo-remsim 4 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign dist-bzip2 2 | 3 | SUBDIRS = contrib src include doc 4 | 5 | pkgconfigdir = $(libdir)/pkgconfig 6 | pkgconfig_DATA = libosmo-rspro.pc 7 | 8 | EXTRA_DIST = \ 9 | .version \ 10 | README.md \ 11 | asn1 \ 12 | debian \ 13 | $(NULL) 14 | 15 | AM_DISTCHECK_CONFIGURE_FLAGS = \ 16 | --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \ 17 | --with-usbdropdir=$$dc_install_base/$(usbdropdir) \ 18 | --with-serialconfdir=$$dc_install_base/$(serialconfdir) 19 | 20 | pkgcofigdir = $(libdir)/pkgconfig 21 | 22 | @RELMAKE@ 23 | 24 | BUILT_SOURCES = $(top_srcdir)/.version 25 | $(top_srcdir)/.version: 26 | echo $(VERSION) > $@-t && mv $@-t $@ 27 | dist-hook: 28 | echo $(VERSION) > $(distdir)/.tarball-version 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | osmo-remsim - Osmocom remote SIM software suite 2 | =============================================== 3 | 4 | osmo-remsim is a suite of software programs enabling physical/geographic separation of a cellular phone (or 5 | modem) on the one hand side and the SIM/USIM/ISIM card on the other side. 6 | 7 | Using osmo-remsim, you can operate an entire fleet of modems/phones, as well as banks of SIM cards and 8 | dynamically establish or remove the connections between modems/phones and cards. 9 | 10 | So in technical terms, it behaves like a proxy for the ISO 7816 smart card interface between the MS/UE and the 11 | UICC/SIM/USIM/ISIM. 12 | 13 | While originally designed to be used in context of cellular networks, there is nothing cellular specific in 14 | the system. It can therefore also be used with other systems that use contact based smart cards according to 15 | ISO 7816. Currently only the T=0 protocol with standard (non-extended) APDUs is supported. 16 | 17 | Homepage 18 | -------- 19 | Please visit the [official homepage](https://osmocom.org/projects/osmo-remsim/wiki) 20 | for usage instructions, manual and examples. 21 | 22 | 23 | GIT Repository 24 | -------------- 25 | 26 | You can clone from the official osmo-remsim.git repository using 27 | 28 | git clone https://gitea.osmocom.org/sim-card/osmo-remsim 29 | 30 | There is a web interface at . 31 | 32 | Documentation 33 | ------------- 34 | 35 | The User Manual is [optionally] built in PDF form as part of the build process. 36 | 37 | A pre-rendered PDF version of the current `master` can be found at 38 | [User Manual](https://downloads.osmocom.org/docs/latest/osmo-remsim-usermanual.pdf). 39 | 40 | 41 | Forum 42 | ----- 43 | 44 | We welcome any osmo-remsim related discussions in the 45 | [SIM Card Technology](https://discourse.osmocom.org/c/sim-card-technology/) 46 | section of the osmocom discourse (web based Forum). 47 | 48 | 49 | Mailing List 50 | ------------ 51 | 52 | There is no separate mailing list for this project. However, 53 | discussions related to pySim are happening on the simtrace 54 | mailing list, please see 55 | for subscription 56 | options and the list archive. 57 | 58 | Please observe the [Osmocom Mailing List 59 | Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules) 60 | when posting. 61 | 62 | 63 | Issue Tracker 64 | ------------- 65 | 66 | We use the [issue tracker of the osmo-remsim project on osmocom.org](https://osmocom.org/projects/osmo-remsim/issues) for 67 | tracking the state of bug reports and feature requests. Feel free to submit any issues you may find, or help 68 | us out by resolving existing issues. 69 | 70 | 71 | Contributing 72 | ------------ 73 | 74 | Our coding standards are described at 75 | 76 | 77 | We are using a gerrit-based patch review process explained at 78 | 79 | -------------------------------------------------------------------------------- /TODO-RELEASE: -------------------------------------------------------------------------------- 1 | # When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install 2 | # according to https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release 3 | # In short: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info 4 | # LIBVERSION=c:r:a 5 | # If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. 6 | # If any interfaces have been added, removed, or changed since the last update: c + 1:0:a. 7 | # If any interfaces have been added since the last public release: c:r:a + 1. 8 | # If any interfaces have been removed or changed since the last public release: c:r:0. 9 | #library what description / commit summary line 10 | -------------------------------------------------------------------------------- /contrib/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = etc_default systemd 2 | 3 | EXTRA_DIST = osmo-remsim-apitool owhw-event-script.sh 4 | 5 | bin_SCRIPTS = osmo-remsim-apitool 6 | -------------------------------------------------------------------------------- /contrib/etc_default/Makefile.am: -------------------------------------------------------------------------------- 1 | OSMOCONF_FILES = osmo-remsim-bankd \ 2 | osmo-remsim-client \ 3 | osmo-remsim-client-0 osmo-remsim-client-1 osmo-remsim-client-2 osmo-remsim-client-3 4 | 5 | EXTRA_DIST = $(OSMOCONF_FILES) 6 | 7 | osmoconfdir = $(sysconfdir)/default 8 | osmoconf_DATA = $(OSMOCONF_FILES) 9 | -------------------------------------------------------------------------------- /contrib/etc_default/osmo-remsim-bankd: -------------------------------------------------------------------------------- 1 | # Default settings for osmo-remsim-bankd This file is sourced by systemd 2 | 3 | # Options to pass to osmo-remsim-bankd 4 | BANKD_OPTS="-i 127.0.0.1 -n 5" 5 | 6 | -------------------------------------------------------------------------------- /contrib/etc_default/osmo-remsim-client: -------------------------------------------------------------------------------- 1 | # Default settings for osmo-remsim-client This file is sourced by systemd 2 | 3 | # Options to pass to osmo-remsim-client 4 | GLOBAL_CLIENT_OPTS="-i 127.0.0.1 -V 1d50 -P 4004 -C 1" 5 | -------------------------------------------------------------------------------- /contrib/etc_default/osmo-remsim-client-0: -------------------------------------------------------------------------------- 1 | # Default settings for osmo-remsim-client This file is sourced by systemd 2 | 3 | # Options to pass to osmo-remsim-client 4 | REMSIM_I="0" 5 | REMSIM_H="2-1.1" 6 | REMSIM_c="0" 7 | REMSIM_n="0" 8 | -------------------------------------------------------------------------------- /contrib/etc_default/osmo-remsim-client-1: -------------------------------------------------------------------------------- 1 | # Default settings for osmo-remsim-client This file is sourced by systemd 2 | 3 | # Options to pass to osmo-remsim-client 4 | REMSIM_I="1" 5 | REMSIM_H="2-1.1" 6 | REMSIM_c="0" 7 | REMSIM_n="1" 8 | -------------------------------------------------------------------------------- /contrib/etc_default/osmo-remsim-client-2: -------------------------------------------------------------------------------- 1 | # Default settings for osmo-remsim-client This file is sourced by systemd 2 | 3 | # Options to pass to osmo-remsim-client 4 | REMSIM_I="0" 5 | REMSIM_H="2-1.4" 6 | REMSIM_c="0" 7 | REMSIM_n="2" 8 | -------------------------------------------------------------------------------- /contrib/etc_default/osmo-remsim-client-3: -------------------------------------------------------------------------------- 1 | # Default settings for osmo-remsim-client This file is sourced by systemd 2 | 3 | # Options to pass to osmo-remsim-client 4 | REMSIM_I="1" 5 | REMSIM_H="2-1.4" 6 | REMSIM_c="0" 7 | REMSIM_n="3" 8 | -------------------------------------------------------------------------------- /contrib/jenkins.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # jenkins build helper script for osmo-remsim. This is how we build on jenkins.osmocom.org 3 | # 4 | # environment variables: 5 | # * WITH_MANUALS: build manual PDFs if set to "1" 6 | # * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1") 7 | # 8 | 9 | if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then 10 | echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" 11 | exit 2 12 | fi 13 | 14 | set -ex 15 | 16 | base="$PWD" 17 | deps="$base/deps" 18 | inst="$deps/install" 19 | export deps inst 20 | 21 | osmo-clean-workspace.sh 22 | 23 | mkdir "$deps" || true 24 | 25 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]" -not -path "./deps/*") 26 | 27 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" 28 | export LD_LIBRARY_PATH="$inst/lib" 29 | export PATH="$inst/bin:$PATH" 30 | 31 | osmo-build-dep.sh libosmocore "" --disable-doxygen 32 | osmo-build-dep.sh libosmo-netif "" --disable-doxygen 33 | osmo-build-dep.sh simtrace2 34 | 35 | # Additional configure options and depends 36 | CONFIG="" 37 | if [ "$WITH_MANUALS" = "1" ]; then 38 | CONFIG="--enable-manuals" 39 | fi 40 | 41 | set +x 42 | echo 43 | echo 44 | echo 45 | echo " =============================== osmo-remsim ===============================" 46 | echo 47 | set -x 48 | 49 | cd "$base" 50 | autoreconf --install --force 51 | ./configure --enable-sanitize --enable-werror $CONFIG 52 | $MAKE $PARALLEL_MAKE 53 | LD_LIBRARY_PATH="$inst/lib" \ 54 | DISTCHCK_CONFIGURE_FLAGS="--enable-werror $CONFIG" \ 55 | $MAKE distcheck \ 56 | || cat-testlogs.sh 57 | 58 | if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then 59 | make -C "$base/doc/manuals" publish 60 | fi 61 | 62 | $MAKE maintainer-clean 63 | osmo-clean-workspace.sh 64 | -------------------------------------------------------------------------------- /contrib/owhw-event-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Helper script for osmo-remsim-client-st2 on OWHW hardware. It performs the hardware-specific 4 | # functions required by remsim-client. 5 | 6 | # environment variables available: 7 | # REMSIM_CLIENT_VERSION 8 | # REMSIM_SERVER_ADDR 9 | # REMSIM_SERVER_STATE 10 | # REMSIM_BANKD_ADDR 11 | # REMSIM_BANKD_STATE 12 | # REMSIM_CLIENT_SLOT 13 | # REMSIM_BANKD_SLOT 14 | # REMSIM_SIM_VCC 15 | # REMSIM_SIM_RST 16 | # REMSIM_CAUSE 17 | # REMSIM_USB_PATH 18 | # REMSIM_USB_INTERFACE 19 | 20 | CAUSE="$1" 21 | 22 | # derive the modem (1/2) from the USB interface of the SIMTRACE2 firmware (0/1) 23 | case "${REMSIM_USB_INTERFACE}" in 24 | 0) 25 | MODEM=1 26 | ;; 27 | 1) 28 | MODEM=2 29 | ;; 30 | *) 31 | echo "Unknown REMSIM_USB_INTERFACE ${REMSIM_USB_INTERFACE}" 32 | exit 1 33 | ;; 34 | esac 35 | 36 | 37 | 38 | case "${CAUSE}" in 39 | event-server-connect) 40 | ;; 41 | event-bankd-connect) 42 | ;; 43 | event-config-bankd) 44 | ;; 45 | event-modem-status) 46 | ;; 47 | request-card-insert) 48 | echo "Enabling Remote SIM for ${MODEM}" 49 | echo -n "1" > "/dev/gpio/connect_st_usim${MODEM}/value" 50 | ;; 51 | request-card-remove) 52 | echo "Disabling Remote SIM for ${MODEM}" 53 | echo -n "0" > "/dev/gpio/connect_st_usim${MODEM}/value" 54 | ;; 55 | request-modem-reset) 56 | echo "Resetting Modem ${MODEM}" 57 | echo -n "1" > "/dev/gpio/mdm${MODEM}_rst/value" 58 | sleep 1 59 | echo -n "0" > "/dev/gpio/mdm${MODEM}_rst/value" 60 | # for v5 no effect on v4 61 | case "${MODEM}" in 62 | 1) 63 | gpioset gpiochip6 1=1 64 | sleep 1 65 | gpioset gpiochip6 1=0 66 | ;; 67 | 2) 68 | gpioset gpiochip6 3=1 69 | sleep 1 70 | gpioset gpiochip6 3=0 71 | ;; 72 | esac 73 | ;; 74 | request-sim-remote) 75 | ;; 76 | *) 77 | echo "Unknown CAUSE ${CAUSE}: ignoring" 78 | ;; 79 | esac 80 | -------------------------------------------------------------------------------- /contrib/systemd/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = osmo-remsim-bankd.service osmo-remsim-client@.service osmo-remsim-server.service 2 | 3 | if HAVE_SYSTEMD 4 | systemdsystemunit_DATA = \ 5 | osmo-remsim-bankd.service \ 6 | osmo-remsim-server.service \ 7 | osmo-remsim-client@.service 8 | endif 9 | -------------------------------------------------------------------------------- /contrib/systemd/osmo-remsim-bankd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Osmocom Remote SIM BankD 3 | After=network-online.target 4 | Wants=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | Restart=always 9 | EnvironmentFile=/etc/default/osmo-remsim-bankd 10 | WorkingDirectory=/etc/osmocom 11 | ExecStart=/usr/bin/osmo-remsim-bankd $BANKD_OPTS 12 | RestartSec=2 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | 17 | -------------------------------------------------------------------------------- /contrib/systemd/osmo-remsim-client@.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Osmocom Remote SIM Client %i 3 | After=network-online.target 4 | Wants=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | Restart=always 9 | EnvironmentFile=/etc/default/osmo-remsim-client 10 | EnvironmentFile=/etc/default/osmo-remsim-client-%i 11 | ExecStart=/usr/bin/osmo-remsim-client-st2 $GLOBAL_CLIENT_OPTS -I $REMSIM_I -H $REMSIM_H -c $REMSIM_c -n $REMSIM_n 12 | RestartSec=2 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | 17 | -------------------------------------------------------------------------------- /contrib/systemd/osmo-remsim-server.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Osmocom Remote SIM Server 3 | After=network-online.target 4 | Wants=network-online.target 5 | 6 | [Service] 7 | Type=simple 8 | Restart=always 9 | ExecStart=/usr/bin/osmo-remsim-server 10 | RestartSec=2 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | 15 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: osmo-remsim 3 | Source: https://gitea.osmocom.org/sim-card/osmo-remsim 4 | 5 | Files: * 6 | Copyright: 2018-2019 Harald Welte 7 | License: GPL-2+ 8 | 9 | 10 | License: GPL-2+ 11 | This package is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 2 of the License, or 14 | (at your option) any later version. 15 | . 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | . 21 | You should have received a copy of the GNU General Public License 22 | along with this program. If not, see . 23 | . 24 | On Debian systems, the complete text of the GNU General 25 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". 26 | -------------------------------------------------------------------------------- /debian/libifd-osmo-remsim-client0.install: -------------------------------------------------------------------------------- 1 | usr/lib/pcsc/drivers/libifd-osmo-remsim-client.bundle/* 2 | etc/reader.conf.d/* 3 | -------------------------------------------------------------------------------- /debian/libosmo-rspro-dev.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libosmo-rspro*.a 2 | usr/lib/*/libosmo-rspro*.so 3 | usr/lib/*/libosmo-rspro*.la 4 | usr/lib/*/pkgconfig/libosmo-rspro.pc 5 | -------------------------------------------------------------------------------- /debian/libosmo-rspro2.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libosmo-rspro*.so.* 2 | -------------------------------------------------------------------------------- /debian/osmo-remsim-apitool.install: -------------------------------------------------------------------------------- 1 | usr/bin/osmo-remsim-apitool 2 | -------------------------------------------------------------------------------- /debian/osmo-remsim-bankd.install: -------------------------------------------------------------------------------- 1 | usr/bin/osmo-remsim-bankd 2 | lib/systemd/system/osmo-remsim-bankd.service 3 | etc/default/osmo-remsim-bankd 4 | etc/osmocom/bankd_pcsc_slots.csv 5 | usr/share/doc/osmo-remsim/examples/bankd_pcsc_slots.csv 6 | -------------------------------------------------------------------------------- /debian/osmo-remsim-client-shell.install: -------------------------------------------------------------------------------- 1 | usr/bin/osmo-remsim-client-shell 2 | -------------------------------------------------------------------------------- /debian/osmo-remsim-client-st2.install: -------------------------------------------------------------------------------- 1 | usr/bin/osmo-remsim-client-st2 2 | lib/systemd/system/osmo-remsim-client* 3 | etc/default/osmo-remsim-client* 4 | -------------------------------------------------------------------------------- /debian/osmo-remsim-doc.install: -------------------------------------------------------------------------------- 1 | usr/share/doc/osmo-remsim-doc/*.pdf 2 | -------------------------------------------------------------------------------- /debian/osmo-remsim-server.install: -------------------------------------------------------------------------------- 1 | usr/bin/osmo-remsim-server 2 | lib/systemd/system/osmo-remsim-server.service 3 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) 4 | DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) 5 | VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') 6 | 7 | USBDROPDIR := $(shell pkg-config --variable=usbdropdir libpcsclite) 8 | 9 | #export DH_VERBOSE=1 10 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 11 | 12 | 13 | %: 14 | dh $@ --with=systemd --with autoreconf --fail-missing 15 | 16 | override_dh_auto_configure: 17 | dh_auto_configure -- --with-systemdsystemunitdir=/lib/systemd/system \ 18 | --enable-manuals 19 | 20 | #override_dh_clean: 21 | # dh_clean 22 | # $(RM) tests/package.m4 23 | # $(RM) tests/testsuite 24 | 25 | # Print test results in case of a failure 26 | #override_dh_auto_test: 27 | # dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) 28 | 29 | # Don't create .pdf.gz files (barely saves space and they can't be opened directly by most pdf readers) 30 | override_dh_compress: 31 | dh_compress -X.pdf 32 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | examples \ 3 | manuals \ 4 | $(NULL) 5 | 6 | EXTRA_DIST = examples/bankd_pcsc_slots.csv 7 | -------------------------------------------------------------------------------- /doc/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | OSMOCONF_FILES = \ 2 | bankd_pcsc_slots.csv \ 3 | $(NULL) 4 | 5 | osmoconfdir = $(sysconfdir)/osmocom 6 | osmoconf_DATA = $(OSMOCONF_FILES) 7 | 8 | EXTRA_DIST = $(OSMOCONF_FILES) 9 | 10 | CFG_FILES = find $(srcdir) -name '*.cfg*' -o -name '*.csv' | sed -e 's,^$(srcdir),,' 11 | 12 | dist-hook: 13 | for f in $$($(CFG_FILES)); do \ 14 | j="$(distdir)/$$f" && \ 15 | $(INSTALL_DATA) -D $(srcdir)/$$f $$j; \ 16 | done 17 | 18 | install-data-hook: 19 | for f in $$($(CFG_FILES)); do \ 20 | j="$(DESTDIR)$(docdir)/examples/$$f" && \ 21 | $(INSTALL_DATA) -D $(srcdir)/$$f $$j; \ 22 | done 23 | 24 | uninstall-hook: 25 | @$(PRE_UNINSTALL) 26 | for f in $$($(CFG_FILES)); do \ 27 | j="$(DESTDIR)$(docdir)/examples/$$f" && \ 28 | $(RM) $$j; \ 29 | done 30 | -------------------------------------------------------------------------------- /doc/examples/bankd_pcsc_slots.csv: -------------------------------------------------------------------------------- 1 | "1","0","ACS ACR33 ICC Reader 00 00" 2 | "1","1","ACS ACR33 ICC Reader 00 01" 3 | "1","2","ACS ACR33 ICC Reader 00 02" 4 | "1","3","ACS ACR33 ICC Reader 00 03" 5 | "1","4","ACS ACR33 ICC Reader 00 04" 6 | "1","23","Alcor Micro AU9560 00 00" 7 | -------------------------------------------------------------------------------- /doc/manuals/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | osmo-remsim-usermanual.adoc \ 3 | osmo-remsim-usermanual-docinfo.xml \ 4 | chapters 5 | 6 | if BUILD_MANUALS 7 | ASCIIDOC = osmo-remsim-usermanual.adoc 8 | include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc 9 | osmo-remsim-usermanual.pdf: $(srcdir)/chapters/*.adoc 10 | 11 | OSMO_REPOSITORY = osmo-remsim 12 | include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc 13 | endif 14 | -------------------------------------------------------------------------------- /doc/manuals/chapters/logging.adoc: -------------------------------------------------------------------------------- 1 | [[remsim_logging]] 2 | == osmo-remsim logging 3 | 4 | All programs within the osmo-remsim project use the logging sub-system of `libosmocore`. 5 | 6 | Contrary to the larger Osmocom projects with their own VTY + configuration file, the 7 | logging configuration for osmo-remsim programs must happen via command line arguments. 8 | 9 | Also, contrary to the larger Osmocom projects, only logging to `stderr` is supported; 10 | no direct logging to log files, syslog, systemd, etc. is supported at this point. 11 | 12 | === `-d` command line argument 13 | 14 | Every osmo-remsim program like `osmo-remsim-bankd`, `osmo-remsim-server` or 15 | `osmo-remsim-client-st2` supports a `-d` command line argument. This argument 16 | takes one mandatory parameter configuring the log level for each log sub-system 17 | as follows: 18 | 19 | `-d SUBSYS,num_lvl[:SUBSYS,num_lvl[:...]]` 20 | 21 | So basically, a colon-separated list of tuples, where each tuple contains the 22 | sub-system name and the _numeric_ log level. 23 | 24 | Below is the list of sub-systems and a table of numerical levels: 25 | 26 | .libosmocore log levels and their numeric values 27 | [options="header",width="30%",cols="1,1"] 28 | |=== 29 | |Level name|Numeric value 30 | |DEBUG|1 31 | |INFO|3 32 | |NOTICE|5 33 | |ERROR|7 34 | |FATAL|8 35 | |=== 36 | 37 | .osmo-remsim log sub-system names and their description 38 | [options="header",width="50%",cols="1,2"] 39 | |=== 40 | |Sub-System Name|Description 41 | |DMAIN|respective main program code 42 | |DST2|SIMtrace2 `cardem` firmware interaction via USB 43 | |DRSPRO|RSPRO protocol between bankd, server and client 44 | |DREST|REST interface of `osmo-remsim-server` 45 | |DSLOTMAP|slotmap code shared by `osmo-remsim-server` and `osmo-remsim-bankd` 46 | |DBANKDW|worker threads of `osmo-remsim-bankd` 47 | |=== 48 | 49 | === Example 50 | 51 | Putting the above in a concrete example: 52 | 53 | `-d DMAIN,5:DRSPRO,1` 54 | 55 | would perform the following configuration: 56 | 57 | * log only NOTICE (or higher) messages in the DMAIN subsystem (low verbosity) 58 | * log DEBUG (or higher) messages in the DRSPRO subsystem (very high verbosity) 59 | -------------------------------------------------------------------------------- /doc/manuals/osmo-remsim-usermanual-docinfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | March 2019 5 | HW 6 | 7 | Initial version. 8 | 9 | 10 | 11 | 2 12 | December 2021 13 | HW 14 | 15 | Update manual to osmo-remsim v1.0.0 (logging, command line arguments) 16 | 17 | 18 | 19 | 20 | 21 | 22 | Harald 23 | Welte 24 | hwelte@sysmocom.de 25 | HW 26 | 27 | sysmocom 28 | sysmocom - s.f.m.c. GmbH 29 | Managing Director 30 | 31 | 32 | 33 | 34 | 35 | 2019-2021 36 | sysmocom - s.f.m.c. GmbH 37 | 38 | 39 | 40 | 41 | Permission is granted to copy, distribute and/or modify this 42 | document under the terms of the GNU Free Documentation License, 43 | Version 1.3 or any later version published by the Free Software 44 | Foundation; with the Invariant Sections being just 'Foreword', 45 | 'Acknowledgements' and 'Preface', with no Front-Cover Texts, 46 | and no Back-Cover Texts. A copy of the license is included in 47 | the section entitled "GNU Free Documentation License". 48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/manuals/osmo-remsim-usermanual.adoc: -------------------------------------------------------------------------------- 1 | :gfdl-enabled: 2 | 3 | osmo-remsim User Manual 4 | ======================= 5 | Harald Welte 6 | 7 | //include::./common/chapters/preface.adoc[] 8 | 9 | include::{srcdir}/chapters/overview.adoc[] 10 | 11 | include::{srcdir}/chapters/remsim-server.adoc[] 12 | 13 | include::{srcdir}/chapters/remsim-apitool.adoc[] 14 | 15 | include::{srcdir}/chapters/remsim-client.adoc[] 16 | 17 | include::{srcdir}/chapters/remsim-bankd.adoc[] 18 | 19 | include::{srcdir}/chapters/logging.adoc[] 20 | 21 | include::{srcdir}/chapters/rspro.adoc[] 22 | 23 | //include::./common/chapters/vty.adoc[] 24 | 25 | //include::./common/chapters/logging.adoc[] 26 | 27 | //include::{srcdir}/chapters/architecture.adoc[] 28 | 29 | //include::./common/chapters/port_numbers.adoc[] 30 | 31 | include::./common/chapters/bibliography.adoc[] 32 | 33 | include::./common/chapters/glossary.adoc[] 34 | 35 | include::./common/chapters/gfdl.adoc[] 36 | -------------------------------------------------------------------------------- /doc/osmo-remsim-simple.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | rankdir=LR; 3 | 4 | subgraph cluster_0 { 5 | label="Data Center"; 6 | SIM [shape=rect]; 7 | Reader [shape=rect]; 8 | bankd [label="remsim-bankd"]; 9 | } 10 | 11 | subgraph cluster_1 { 12 | label="Remote Site"; 13 | client [label="remsim-client"]; 14 | SIMtrace [label="SIMtrace2\nAPP=cardem",shape=rect]; 15 | Phone [label="Phone/Modem",shape=rect]; 16 | } 17 | 18 | SIM -> Reader [label="ISO-7816-2/3",dir=both]; 19 | Reader -> bankd [label="USB CCID",dir=both]; 20 | bankd -> client [label="RSPRO/IPA/TCP/IP",dir=both]; 21 | client -> SIMtrace [label="USB",dir=both]; 22 | SIMtrace -> Phone [label="ISO-7816-2/3",dir=both]; 23 | } 24 | -------------------------------------------------------------------------------- /doc/osmo-remsim.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | rankdir=LR; 3 | 4 | subgraph cluster_0 { 5 | label="Data Center"; 6 | SIM0 [shape=rect]; 7 | SIM1 [shape=rect]; 8 | SIM2 [shape=rect]; 9 | SIM3 [shape=rect]; 10 | SIM4 [shape=rect]; 11 | SIM5 [shape=rect]; 12 | SIM6 [shape=rect]; 13 | SIM7 [shape=rect]; 14 | sysmoOCTSIM [shape=rect]; 15 | { 16 | rank=same; 17 | bankd [label="remsim-bankd"]; 18 | server [label="remsim-server"]; 19 | } 20 | 21 | SIM0 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 22 | SIM1 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 23 | SIM2 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 24 | SIM3 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 25 | SIM4 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 26 | SIM5 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 27 | SIM6 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 28 | SIM7 -> sysmoOCTSIM [label="ISO-7816-2/3",dir=both]; 29 | 30 | sysmoOCTSIM -> bankd [label="USB CCID",dir=both]; 31 | 32 | bankd -> server [label="RSPRO/IPA/TCP"]; 33 | } 34 | 35 | subgraph cluster_1 { 36 | label="Remote Site A"; 37 | client1 [label="remsim-client"]; 38 | SIMtrace1 [label="SIMtrace2\nAPP=cardem",shape=rect]; 39 | Phone1 [label="Phone/Modem",shape=rect]; 40 | client1 -> SIMtrace1 [label="USB",dir=both]; 41 | SIMtrace1 -> Phone1 [label="ISO-7816-2/3",dir=both]; 42 | bankd -> client1 [label="RSPRO/IPA/TCP/IP",dir=both]; 43 | client1 -> server [label="RSPRO/IPA/TCP"]; 44 | } 45 | 46 | subgraph cluster_2 { 47 | label="Remote Site B"; 48 | client2 [label="remsim-client"]; 49 | SIMtrace2 [label="SIMtrace2\nAPP=cardem",shape=rect]; 50 | Phone2 [label="Phone/Modem",shape=rect]; 51 | client2 -> SIMtrace2 [label="USB",dir=both]; 52 | SIMtrace2 -> Phone2 [label="ISO-7816-2/3",dir=both]; 53 | bankd -> client2 [label="RSPRO/IPA/TCP/IP",dir=both]; 54 | client2 -> server [label="RSPRO/IPA/TCP"]; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /doc/remote-sim.dot: -------------------------------------------------------------------------------- 1 | digraph { 2 | rankdir=LR; 3 | SIM [shape=rect]; 4 | Reader [shape=rect]; 5 | Computer [shape=rect]; 6 | ComputerB [shape=rect]; 7 | SIMtrace [shape=rect]; 8 | Phone [shape=rect]; 9 | 10 | SIM -> Reader [label="ISO-7816-2/3",dir=both]; 11 | Reader -> Computer [label="USB CCID",dir=both]; 12 | Computer -> ComputerB [label="IP based transport",dir=both]; 13 | ComputerB -> SIMtrace [label="USB",dir=both]; 14 | SIMtrace -> Phone [label="ISO-7816-2/3",dir=both]; 15 | } 16 | -------------------------------------------------------------------------------- /ffasn1c/Makefile: -------------------------------------------------------------------------------- 1 | FFASN1C_LIBS = -L/usr/local/lib -lffasn1 -lffasn1_runtime_stdc 2 | FFASN1C_CFLAGS = -I/usr/local/include/ffasn1c 3 | 4 | CFLAGS+=-Wall $(FFASN1C_CFLAGS) 5 | LIBS+=$(FFASN1C_LIBS) 6 | 7 | main: main.o rspro.o 8 | $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) 9 | 10 | %.o: %.c 11 | $(CC) $(CFLAGS) -o $@ -c $^ 12 | 13 | rspro.c: ../asn1/RSPRO.asn 14 | ffasn1c -o $@ $^ 15 | 16 | clean: 17 | @rm -f *.o main 18 | -------------------------------------------------------------------------------- /ffasn1c/main.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "rspro.h" 10 | 11 | 12 | static void transcode(const uint8_t *buf, unsigned int len) 13 | { 14 | ASN1Error err; 15 | struct RsproPDU *pdu; 16 | int rc; 17 | char *gserbuf; 18 | 19 | rc = asn1_ber_decode((void **)&pdu, asn1_type_RsproPDU, buf, len, &err); 20 | printf("rc=%d\n", rc); 21 | 22 | rc = asn1_gser_encode((uint8_t **) &gserbuf, asn1_type_RsproPDU, pdu); 23 | printf("rc=%d\n", rc); 24 | printf("%s\n", gserbuf); 25 | } 26 | 27 | int main(int argc, char **argv) 28 | { 29 | uint8_t buf[2048]; 30 | int fd, rc; 31 | 32 | fd = open(argv[1], O_RDONLY); 33 | if (fd < 0) 34 | exit(1); 35 | rc = read(fd, buf, sizeof(buf)); 36 | close(fd); 37 | 38 | transcode(buf, rc); 39 | } 40 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = osmocom 2 | -------------------------------------------------------------------------------- /include/osmocom/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = rspro 2 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ATR.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ATR_H_ 8 | #define _ATR_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* ATR */ 21 | typedef OCTET_STRING_t ATR_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_ATR; 25 | asn_struct_free_f ATR_free; 26 | asn_struct_print_f ATR_print; 27 | asn_constr_check_f ATR_constraint; 28 | ber_type_decoder_f ATR_decode_ber; 29 | der_type_encoder_f ATR_encode_der; 30 | xer_type_decoder_f ATR_decode_xer; 31 | xer_type_encoder_f ATR_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _ATR_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/BIT_STRING.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BIT_STRING_H_ 6 | #define _BIT_STRING_H_ 7 | 8 | #include /* Some help from OCTET STRING */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct BIT_STRING_s { 15 | uint8_t *buf; /* BIT STRING body */ 16 | int size; /* Size of the above buffer */ 17 | 18 | int bits_unused;/* Unused trailing bits in the last octet (0..7) */ 19 | 20 | asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ 21 | } BIT_STRING_t; 22 | 23 | extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; 24 | 25 | asn_struct_print_f BIT_STRING_print; /* Human-readable output */ 26 | asn_constr_check_f BIT_STRING_constraint; 27 | xer_type_encoder_f BIT_STRING_encode_xer; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif /* _BIT_STRING_H_ */ 34 | -------------------------------------------------------------------------------- /include/osmocom/rspro/BOOLEAN.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BOOLEAN_H_ 6 | #define _BOOLEAN_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* 15 | * The underlying integer may contain various values, but everything 16 | * non-zero is capped to 0xff by the DER encoder. The BER decoder may 17 | * yield non-zero values different from 1, beware. 18 | */ 19 | typedef int BOOLEAN_t; 20 | 21 | extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; 22 | 23 | asn_struct_free_f BOOLEAN_free; 24 | asn_struct_print_f BOOLEAN_print; 25 | ber_type_decoder_f BOOLEAN_decode_ber; 26 | der_type_encoder_f BOOLEAN_encode_der; 27 | xer_type_decoder_f BOOLEAN_decode_xer; 28 | xer_type_encoder_f BOOLEAN_encode_xer; 29 | per_type_decoder_f BOOLEAN_decode_uper; 30 | per_type_encoder_f BOOLEAN_encode_uper; 31 | per_type_decoder_f BOOLEAN_decode_aper; 32 | per_type_encoder_f BOOLEAN_encode_aper; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _BOOLEAN_H_ */ 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/BankId.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _BankId_H_ 8 | #define _BankId_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* BankId */ 21 | typedef long BankId_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_BankId; 25 | asn_struct_free_f BankId_free; 26 | asn_struct_print_f BankId_print; 27 | asn_constr_check_f BankId_constraint; 28 | ber_type_decoder_f BankId_decode_ber; 29 | der_type_encoder_f BankId_encode_der; 30 | xer_type_decoder_f BankId_decode_xer; 31 | xer_type_encoder_f BankId_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _BankId_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/BankSlot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _BankSlot_H_ 8 | #define _BankSlot_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* BankSlot */ 23 | typedef struct BankSlot { 24 | BankId_t bankId; 25 | SlotNumber_t slotNr; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } BankSlot_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_BankSlot; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _BankSlot_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/BankSlotStatusInd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _BankSlotStatusInd_H_ 8 | #define _BankSlotStatusInd_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* BankSlotStatusInd */ 24 | typedef struct BankSlotStatusInd { 25 | BankSlot_t fromBankSlot; 26 | ClientSlot_t toClientSlot; 27 | SlotPhysStatus_t slotPhysStatus; 28 | /* 29 | * This type is extensible, 30 | * possible extensions are below. 31 | */ 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | } BankSlotStatusInd_t; 36 | 37 | /* Implementation */ 38 | extern asn_TYPE_descriptor_t asn_DEF_BankSlotStatusInd; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _BankSlotStatusInd_H_ */ 45 | #include 46 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ClientId.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ClientId_H_ 8 | #define _ClientId_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* ClientId */ 21 | typedef long ClientId_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_ClientId; 25 | asn_struct_free_f ClientId_free; 26 | asn_struct_print_f ClientId_print; 27 | asn_constr_check_f ClientId_constraint; 28 | ber_type_decoder_f ClientId_decode_ber; 29 | der_type_encoder_f ClientId_encode_der; 30 | xer_type_decoder_f ClientId_decode_xer; 31 | xer_type_encoder_f ClientId_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _ClientId_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ClientSlot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ClientSlot_H_ 8 | #define _ClientSlot_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* ClientSlot */ 23 | typedef struct ClientSlot { 24 | ClientId_t clientId; 25 | SlotNumber_t slotNr; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } ClientSlot_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_ClientSlot; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _ClientSlot_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ClientSlotStatusInd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ClientSlotStatusInd_H_ 8 | #define _ClientSlotStatusInd_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* ClientSlotStatusInd */ 24 | typedef struct ClientSlotStatusInd { 25 | ClientSlot_t fromClientSlot; 26 | BankSlot_t toBankSlot; 27 | SlotPhysStatus_t slotPhysStatus; 28 | /* 29 | * This type is extensible, 30 | * possible extensions are below. 31 | */ 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | } ClientSlotStatusInd_t; 36 | 37 | /* Implementation */ 38 | extern asn_TYPE_descriptor_t asn_DEF_ClientSlotStatusInd; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _ClientSlotStatusInd_H_ */ 45 | #include 46 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ComponentIdentity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ComponentIdentity_H_ 8 | #define _ComponentIdentity_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* ComponentIdentity */ 23 | typedef struct ComponentIdentity { 24 | ComponentType_t type; 25 | ComponentName_t name; 26 | ComponentName_t software; 27 | ComponentName_t swVersion; 28 | ComponentName_t *hwManufacturer /* OPTIONAL */; 29 | ComponentName_t *hwModel /* OPTIONAL */; 30 | ComponentName_t *hwSerialNr /* OPTIONAL */; 31 | ComponentName_t *hwVersion /* OPTIONAL */; 32 | ComponentName_t *fwVersion /* OPTIONAL */; 33 | /* 34 | * This type is extensible, 35 | * possible extensions are below. 36 | */ 37 | 38 | /* Context for parsing across buffer boundaries */ 39 | asn_struct_ctx_t _asn_ctx; 40 | } ComponentIdentity_t; 41 | 42 | /* Implementation */ 43 | extern asn_TYPE_descriptor_t asn_DEF_ComponentIdentity; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* _ComponentIdentity_H_ */ 50 | #include 51 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ComponentName.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ComponentName_H_ 8 | #define _ComponentName_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* ComponentName */ 21 | typedef IA5String_t ComponentName_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_ComponentName; 25 | asn_struct_free_f ComponentName_free; 26 | asn_struct_print_f ComponentName_print; 27 | asn_constr_check_f ComponentName_constraint; 28 | ber_type_decoder_f ComponentName_decode_ber; 29 | der_type_encoder_f ComponentName_encode_der; 30 | xer_type_decoder_f ComponentName_decode_xer; 31 | xer_type_encoder_f ComponentName_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _ComponentName_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ComponentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ComponentType_H_ 8 | #define _ComponentType_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Dependencies */ 21 | typedef enum ComponentType { 22 | ComponentType_remsimClient = 0, 23 | ComponentType_remsimServer = 1, 24 | ComponentType_remsimBankd = 2 25 | } e_ComponentType; 26 | 27 | /* ComponentType */ 28 | typedef long ComponentType_t; 29 | 30 | /* Implementation */ 31 | extern asn_TYPE_descriptor_t asn_DEF_ComponentType; 32 | asn_struct_free_f ComponentType_free; 33 | asn_struct_print_f ComponentType_print; 34 | asn_constr_check_f ComponentType_constraint; 35 | ber_type_decoder_f ComponentType_decode_ber; 36 | der_type_encoder_f ComponentType_encode_der; 37 | xer_type_decoder_f ComponentType_decode_xer; 38 | xer_type_encoder_f ComponentType_encode_xer; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _ComponentType_H_ */ 45 | #include 46 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConfigClientBankReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConfigClientBankReq_H_ 8 | #define _ConfigClientBankReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* ConfigClientBankReq */ 23 | typedef struct ConfigClientBankReq { 24 | BankSlot_t bankSlot; 25 | IpPort_t bankd; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } ConfigClientBankReq_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_ConfigClientBankReq; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _ConfigClientBankReq_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConfigClientBankRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConfigClientBankRes_H_ 8 | #define _ConfigClientBankRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* ConfigClientBankRes */ 22 | typedef struct ConfigClientBankRes { 23 | ResultCode_t result; 24 | /* 25 | * This type is extensible, 26 | * possible extensions are below. 27 | */ 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } ConfigClientBankRes_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_ConfigClientBankRes; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _ConfigClientBankRes_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConfigClientIdReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConfigClientIdReq_H_ 8 | #define _ConfigClientIdReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* ConfigClientIdReq */ 22 | typedef struct ConfigClientIdReq { 23 | ClientSlot_t clientSlot; 24 | /* 25 | * This type is extensible, 26 | * possible extensions are below. 27 | */ 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } ConfigClientIdReq_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_ConfigClientIdReq; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _ConfigClientIdReq_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConfigClientIdRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConfigClientIdRes_H_ 8 | #define _ConfigClientIdRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* ConfigClientIdRes */ 22 | typedef struct ConfigClientIdRes { 23 | ResultCode_t result; 24 | /* 25 | * This type is extensible, 26 | * possible extensions are below. 27 | */ 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } ConfigClientIdRes_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_ConfigClientIdRes; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _ConfigClientIdRes_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConnectBankReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConnectBankReq_H_ 8 | #define _ConnectBankReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* ConnectBankReq */ 24 | typedef struct ConnectBankReq { 25 | ComponentIdentity_t identity; 26 | BankId_t bankId; 27 | SlotNumber_t numberOfSlots; 28 | /* 29 | * This type is extensible, 30 | * possible extensions are below. 31 | */ 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | } ConnectBankReq_t; 36 | 37 | /* Implementation */ 38 | extern asn_TYPE_descriptor_t asn_DEF_ConnectBankReq; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _ConnectBankReq_H_ */ 45 | #include 46 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConnectBankRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConnectBankRes_H_ 8 | #define _ConnectBankRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* ConnectBankRes */ 23 | typedef struct ConnectBankRes { 24 | ComponentIdentity_t identity; 25 | ResultCode_t result; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } ConnectBankRes_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_ConnectBankRes; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _ConnectBankRes_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConnectClientReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConnectClientReq_H_ 8 | #define _ConnectClientReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Forward declarations */ 22 | struct ClientSlot; 23 | 24 | /* ConnectClientReq */ 25 | typedef struct ConnectClientReq { 26 | ComponentIdentity_t identity; 27 | struct ClientSlot *clientSlot /* OPTIONAL */; 28 | /* 29 | * This type is extensible, 30 | * possible extensions are below. 31 | */ 32 | 33 | /* Context for parsing across buffer boundaries */ 34 | asn_struct_ctx_t _asn_ctx; 35 | } ConnectClientReq_t; 36 | 37 | /* Implementation */ 38 | extern asn_TYPE_descriptor_t asn_DEF_ConnectClientReq; 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | /* Referred external types */ 45 | #include 46 | 47 | #endif /* _ConnectClientReq_H_ */ 48 | #include 49 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ConnectClientRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ConnectClientRes_H_ 8 | #define _ConnectClientRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* ConnectClientRes */ 23 | typedef struct ConnectClientRes { 24 | ComponentIdentity_t identity; 25 | ResultCode_t result; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } ConnectClientRes_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_ConnectClientRes; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _ConnectClientRes_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/CreateMappingReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _CreateMappingReq_H_ 8 | #define _CreateMappingReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* CreateMappingReq */ 23 | typedef struct CreateMappingReq { 24 | ClientSlot_t client; 25 | BankSlot_t bank; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } CreateMappingReq_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_CreateMappingReq; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _CreateMappingReq_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/CreateMappingRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _CreateMappingRes_H_ 8 | #define _CreateMappingRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* CreateMappingRes */ 22 | typedef struct CreateMappingRes { 23 | ResultCode_t result; 24 | /* 25 | * This type is extensible, 26 | * possible extensions are below. 27 | */ 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } CreateMappingRes_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_CreateMappingRes; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _CreateMappingRes_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ErrorCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ErrorCode_H_ 8 | #define _ErrorCode_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Dependencies */ 21 | typedef enum ErrorCode { 22 | ErrorCode_unknownClientConnected = 1, 23 | ErrorCode_unexpectedDisconnect = 2, 24 | ErrorCode_unexpectedProtocolVersion = 3 25 | /* 26 | * Enumeration is extensible 27 | */ 28 | } e_ErrorCode; 29 | 30 | /* ErrorCode */ 31 | typedef long ErrorCode_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_ErrorCode; 35 | asn_struct_free_f ErrorCode_free; 36 | asn_struct_print_f ErrorCode_print; 37 | asn_constr_check_f ErrorCode_constraint; 38 | ber_type_decoder_f ErrorCode_decode_ber; 39 | der_type_encoder_f ErrorCode_encode_der; 40 | xer_type_decoder_f ErrorCode_decode_xer; 41 | xer_type_encoder_f ErrorCode_encode_xer; 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* _ErrorCode_H_ */ 48 | #include 49 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ErrorInd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ErrorInd_H_ 8 | #define _ErrorInd_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Forward declarations */ 25 | struct BankSlot; 26 | struct ClientSlot; 27 | 28 | /* ErrorInd */ 29 | typedef struct ErrorInd { 30 | ComponentType_t sender; 31 | ErrorSeverity_t severity; 32 | ErrorCode_t code; 33 | struct BankSlot *bankSlot /* OPTIONAL */; 34 | struct ClientSlot *clientSlot /* OPTIONAL */; 35 | ErrorString_t *errorString /* OPTIONAL */; 36 | /* 37 | * This type is extensible, 38 | * possible extensions are below. 39 | */ 40 | 41 | /* Context for parsing across buffer boundaries */ 42 | asn_struct_ctx_t _asn_ctx; 43 | } ErrorInd_t; 44 | 45 | /* Implementation */ 46 | extern asn_TYPE_descriptor_t asn_DEF_ErrorInd; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | /* Referred external types */ 53 | #include 54 | #include 55 | 56 | #endif /* _ErrorInd_H_ */ 57 | #include 58 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ErrorSeverity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ErrorSeverity_H_ 8 | #define _ErrorSeverity_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Dependencies */ 21 | typedef enum ErrorSeverity { 22 | ErrorSeverity_minor = 1, 23 | ErrorSeverity_major = 2, 24 | ErrorSeverity_fatal = 3 25 | /* 26 | * Enumeration is extensible 27 | */ 28 | } e_ErrorSeverity; 29 | 30 | /* ErrorSeverity */ 31 | typedef long ErrorSeverity_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_ErrorSeverity; 35 | asn_struct_free_f ErrorSeverity_free; 36 | asn_struct_print_f ErrorSeverity_print; 37 | asn_constr_check_f ErrorSeverity_constraint; 38 | ber_type_decoder_f ErrorSeverity_decode_ber; 39 | der_type_encoder_f ErrorSeverity_encode_der; 40 | xer_type_decoder_f ErrorSeverity_decode_xer; 41 | xer_type_encoder_f ErrorSeverity_encode_xer; 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* _ErrorSeverity_H_ */ 48 | #include 49 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ErrorString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ErrorString_H_ 8 | #define _ErrorString_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* ErrorString */ 21 | typedef IA5String_t ErrorString_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_ErrorString; 25 | asn_struct_free_f ErrorString_free; 26 | asn_struct_print_f ErrorString_print; 27 | asn_constr_check_f ErrorString_constraint; 28 | ber_type_decoder_f ErrorString_decode_ber; 29 | der_type_encoder_f ErrorString_encode_der; 30 | xer_type_decoder_f ErrorString_decode_xer; 31 | xer_type_encoder_f ErrorString_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _ErrorString_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/IA5String.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _IA5String_H_ 6 | #define _IA5String_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef OCTET_STRING_t IA5String_t; /* Implemented via OCTET STRING */ 15 | 16 | /* 17 | * IA5String ASN.1 type definition. 18 | */ 19 | extern asn_TYPE_descriptor_t asn_DEF_IA5String; 20 | 21 | asn_constr_check_f IA5String_constraint; 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif /* _IA5String_H_ */ 28 | -------------------------------------------------------------------------------- /include/osmocom/rspro/IpAddress.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _IpAddress_H_ 8 | #define _IpAddress_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* Dependencies */ 23 | typedef enum IpAddress_PR { 24 | IpAddress_PR_NOTHING, /* No components present */ 25 | IpAddress_PR_ipv4, 26 | IpAddress_PR_ipv6 27 | } IpAddress_PR; 28 | 29 | /* IpAddress */ 30 | typedef struct IpAddress { 31 | IpAddress_PR present; 32 | union IpAddress_u { 33 | Ipv4Address_t ipv4; 34 | Ipv6Address_t ipv6; 35 | } choice; 36 | 37 | /* Context for parsing across buffer boundaries */ 38 | asn_struct_ctx_t _asn_ctx; 39 | } IpAddress_t; 40 | 41 | /* Implementation */ 42 | extern asn_TYPE_descriptor_t asn_DEF_IpAddress; 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* _IpAddress_H_ */ 49 | #include 50 | -------------------------------------------------------------------------------- /include/osmocom/rspro/IpPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _IpPort_H_ 8 | #define _IpPort_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* IpPort */ 23 | typedef struct IpPort { 24 | IpAddress_t ip; 25 | PortNumber_t port; 26 | 27 | /* Context for parsing across buffer boundaries */ 28 | asn_struct_ctx_t _asn_ctx; 29 | } IpPort_t; 30 | 31 | /* Implementation */ 32 | extern asn_TYPE_descriptor_t asn_DEF_IpPort; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _IpPort_H_ */ 39 | #include 40 | -------------------------------------------------------------------------------- /include/osmocom/rspro/Ipv4Address.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _Ipv4Address_H_ 8 | #define _Ipv4Address_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Ipv4Address */ 21 | typedef OCTET_STRING_t Ipv4Address_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_Ipv4Address; 25 | asn_struct_free_f Ipv4Address_free; 26 | asn_struct_print_f Ipv4Address_print; 27 | asn_constr_check_f Ipv4Address_constraint; 28 | ber_type_decoder_f Ipv4Address_decode_ber; 29 | der_type_encoder_f Ipv4Address_encode_der; 30 | xer_type_decoder_f Ipv4Address_decode_xer; 31 | xer_type_encoder_f Ipv4Address_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _Ipv4Address_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/Ipv6Address.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _Ipv6Address_H_ 8 | #define _Ipv6Address_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Ipv6Address */ 21 | typedef OCTET_STRING_t Ipv6Address_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_Ipv6Address; 25 | asn_struct_free_f Ipv6Address_free; 26 | asn_struct_print_f Ipv6Address_print; 27 | asn_constr_check_f Ipv6Address_constraint; 28 | ber_type_decoder_f Ipv6Address_decode_ber; 29 | der_type_encoder_f Ipv6Address_encode_der; 30 | xer_type_decoder_f Ipv6Address_decode_xer; 31 | xer_type_encoder_f Ipv6Address_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _Ipv6Address_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_HEADERS = \ 2 | ATR.h \ 3 | BankId.h \ 4 | BankSlot.h \ 5 | BankSlotStatusInd.h \ 6 | ClientId.h \ 7 | ClientSlot.h \ 8 | ClientSlotStatusInd.h \ 9 | ComponentIdentity.h \ 10 | ComponentName.h \ 11 | ComponentType.h \ 12 | ConfigClientIdReq.h \ 13 | ConfigClientIdRes.h \ 14 | ConfigClientBankReq.h \ 15 | ConfigClientBankRes.h \ 16 | ConnectBankReq.h \ 17 | ConnectBankRes.h \ 18 | ConnectClientReq.h \ 19 | ConnectClientRes.h \ 20 | CreateMappingReq.h \ 21 | CreateMappingRes.h \ 22 | ErrorCode.h \ 23 | ErrorInd.h \ 24 | ErrorSeverity.h \ 25 | ErrorString.h \ 26 | IpAddress.h \ 27 | IpPort.h \ 28 | Ipv4Address.h \ 29 | Ipv6Address.h \ 30 | OperationTag.h \ 31 | PortNumber.h \ 32 | RemoveMappingReq.h \ 33 | RemoveMappingRes.h \ 34 | ResetStateReq.h \ 35 | ResetStateRes.h \ 36 | ResultCode.h \ 37 | RsproPDU.h \ 38 | RsproPDUchoice.h \ 39 | SetAtrReq.h \ 40 | SetAtrRes.h \ 41 | SlotNumber.h \ 42 | SlotPhysStatus.h \ 43 | TpduCardToModem.h \ 44 | TpduFlags.h \ 45 | TpduModemToCard.h \ 46 | $(NULL) 47 | 48 | noinst_HEADERS+=BOOLEAN.h 49 | noinst_HEADERS+=INTEGER.h 50 | noinst_HEADERS+=NativeEnumerated.h 51 | noinst_HEADERS+=IA5String.h 52 | noinst_HEADERS+=NativeInteger.h 53 | noinst_HEADERS+=constr_CHOICE.h 54 | noinst_HEADERS+=constr_SEQUENCE.h 55 | noinst_HEADERS+=asn_application.h 56 | noinst_HEADERS+=asn_system.h 57 | noinst_HEADERS+=asn_codecs.h 58 | noinst_HEADERS+=asn_internal.h 59 | noinst_HEADERS+=OCTET_STRING.h 60 | noinst_HEADERS+=BIT_STRING.h 61 | noinst_HEADERS+=asn_codecs_prim.h 62 | noinst_HEADERS+=ber_tlv_length.h 63 | noinst_HEADERS+=ber_tlv_tag.h 64 | noinst_HEADERS+=ber_decoder.h 65 | noinst_HEADERS+=der_encoder.h 66 | noinst_HEADERS+=constr_TYPE.h 67 | noinst_HEADERS+=constraints.h 68 | noinst_HEADERS+=xer_support.h 69 | noinst_HEADERS+=xer_decoder.h 70 | noinst_HEADERS+=xer_encoder.h 71 | noinst_HEADERS+=per_support.h 72 | noinst_HEADERS+=per_decoder.h 73 | noinst_HEADERS+=per_encoder.h 74 | noinst_HEADERS+=per_opentype.h 75 | -------------------------------------------------------------------------------- /include/osmocom/rspro/NativeEnumerated.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004, 2005, 2006 Lev Walkin . 3 | * All rights reserved. 4 | * Redistribution and modifications are permitted subject to BSD license. 5 | */ 6 | /* 7 | * This type differs from the standard ENUMERATED in that it is modelled using 8 | * the fixed machine type (long, int, short), so it can hold only values of 9 | * limited length. There is no type (i.e., NativeEnumerated_t, any integer type 10 | * will do). 11 | * This type may be used when integer range is limited by subtype constraints. 12 | */ 13 | #ifndef _NativeEnumerated_H_ 14 | #define _NativeEnumerated_H_ 15 | 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; 23 | 24 | xer_type_encoder_f NativeEnumerated_encode_xer; 25 | per_type_decoder_f NativeEnumerated_decode_uper; 26 | per_type_encoder_f NativeEnumerated_encode_uper; 27 | per_type_decoder_f NativeEnumerated_decode_aper; 28 | per_type_encoder_f NativeEnumerated_encode_aper; 29 | asn_struct_print_f NativeEnumerated_print; 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /* _NativeEnumerated_H_ */ 36 | -------------------------------------------------------------------------------- /include/osmocom/rspro/NativeInteger.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | /* 6 | * This type differs from the standard INTEGER in that it is modelled using 7 | * the fixed machine type (long, int, short), so it can hold only values of 8 | * limited length. There is no type (i.e., NativeInteger_t, any integer type 9 | * will do). 10 | * This type may be used when integer range is limited by subtype constraints. 11 | */ 12 | #ifndef _NativeInteger_H_ 13 | #define _NativeInteger_H_ 14 | 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; 23 | 24 | asn_struct_free_f NativeInteger_free; 25 | asn_struct_print_f NativeInteger_print; 26 | ber_type_decoder_f NativeInteger_decode_ber; 27 | der_type_encoder_f NativeInteger_encode_der; 28 | xer_type_decoder_f NativeInteger_decode_xer; 29 | xer_type_encoder_f NativeInteger_encode_xer; 30 | per_type_decoder_f NativeInteger_decode_uper; 31 | per_type_encoder_f NativeInteger_encode_uper; 32 | per_type_decoder_f NativeInteger_decode_aper; 33 | per_type_encoder_f NativeInteger_encode_aper; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* _NativeInteger_H_ */ 40 | -------------------------------------------------------------------------------- /include/osmocom/rspro/OCTET_STRING.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _OCTET_STRING_H_ 6 | #define _OCTET_STRING_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct OCTET_STRING { 15 | uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ 16 | int size; /* Size of the buffer */ 17 | 18 | asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ 19 | } OCTET_STRING_t; 20 | 21 | extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; 22 | 23 | asn_struct_free_f OCTET_STRING_free; 24 | asn_struct_print_f OCTET_STRING_print; 25 | asn_struct_print_f OCTET_STRING_print_utf8; 26 | ber_type_decoder_f OCTET_STRING_decode_ber; 27 | der_type_encoder_f OCTET_STRING_encode_der; 28 | xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ 29 | xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ 30 | xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ 31 | xer_type_encoder_f OCTET_STRING_encode_xer; 32 | xer_type_encoder_f OCTET_STRING_encode_xer_utf8; 33 | per_type_decoder_f OCTET_STRING_decode_uper; 34 | per_type_encoder_f OCTET_STRING_encode_uper; 35 | per_type_decoder_f OCTET_STRING_decode_aper; 36 | per_type_encoder_f OCTET_STRING_encode_aper; 37 | 38 | /****************************** 39 | * Handy conversion routines. * 40 | ******************************/ 41 | 42 | /* 43 | * This function clears the previous value of the OCTET STRING (if any) 44 | * and then allocates a new memory with the specified content (str/size). 45 | * If size = -1, the size of the original string will be determined 46 | * using strlen(str). 47 | * If str equals to NULL, the function will silently clear the 48 | * current contents of the OCTET STRING. 49 | * Returns 0 if it was possible to perform operation, -1 otherwise. 50 | */ 51 | int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); 52 | 53 | /* Handy conversion from the C string into the OCTET STRING. */ 54 | #define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) 55 | 56 | /* 57 | * Allocate and fill the new OCTET STRING and return a pointer to the newly 58 | * allocated object. NULL is permitted in str: the function will just allocate 59 | * empty OCTET STRING. 60 | */ 61 | OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, 62 | const char *str, int size); 63 | 64 | /**************************** 65 | * Internally useful stuff. * 66 | ****************************/ 67 | 68 | typedef const struct asn_OCTET_STRING_specifics_s { 69 | /* 70 | * Target structure description. 71 | */ 72 | int struct_size; /* Size of the structure */ 73 | int ctx_offset; /* Offset of the asn_struct_ctx_t member */ 74 | 75 | enum asn_OS_Subvariant { 76 | ASN_OSUBV_ANY, /* The open type (ANY) */ 77 | ASN_OSUBV_BIT, /* BIT STRING */ 78 | ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ 79 | ASN_OSUBV_U16, /* 16-bit character (BMPString) */ 80 | ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ 81 | } subvariant; 82 | } asn_OCTET_STRING_specifics_t; 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif /* _OCTET_STRING_H_ */ 89 | -------------------------------------------------------------------------------- /include/osmocom/rspro/OperationTag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _OperationTag_H_ 8 | #define _OperationTag_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* OperationTag */ 21 | typedef long OperationTag_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_OperationTag; 25 | asn_struct_free_f OperationTag_free; 26 | asn_struct_print_f OperationTag_print; 27 | asn_constr_check_f OperationTag_constraint; 28 | ber_type_decoder_f OperationTag_decode_ber; 29 | der_type_encoder_f OperationTag_encode_der; 30 | xer_type_decoder_f OperationTag_decode_xer; 31 | xer_type_encoder_f OperationTag_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _OperationTag_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/PortNumber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _PortNumber_H_ 8 | #define _PortNumber_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* PortNumber */ 21 | typedef long PortNumber_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_PortNumber; 25 | asn_struct_free_f PortNumber_free; 26 | asn_struct_print_f PortNumber_print; 27 | asn_constr_check_f PortNumber_constraint; 28 | ber_type_decoder_f PortNumber_decode_ber; 29 | der_type_encoder_f PortNumber_encode_der; 30 | xer_type_decoder_f PortNumber_decode_xer; 31 | xer_type_encoder_f PortNumber_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _PortNumber_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/RemoveMappingReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _RemoveMappingReq_H_ 8 | #define _RemoveMappingReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* RemoveMappingReq */ 23 | typedef struct RemoveMappingReq { 24 | ClientSlot_t client; 25 | BankSlot_t bank; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } RemoveMappingReq_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_RemoveMappingReq; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _RemoveMappingReq_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/RemoveMappingRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _RemoveMappingRes_H_ 8 | #define _RemoveMappingRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* RemoveMappingRes */ 22 | typedef struct RemoveMappingRes { 23 | ResultCode_t result; 24 | /* 25 | * This type is extensible, 26 | * possible extensions are below. 27 | */ 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } RemoveMappingRes_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_RemoveMappingRes; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _RemoveMappingRes_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ResetStateReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ResetStateReq_H_ 8 | #define _ResetStateReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* ResetStateReq */ 21 | typedef struct ResetStateReq { 22 | /* 23 | * This type is extensible, 24 | * possible extensions are below. 25 | */ 26 | 27 | /* Context for parsing across buffer boundaries */ 28 | asn_struct_ctx_t _asn_ctx; 29 | } ResetStateReq_t; 30 | 31 | /* Implementation */ 32 | extern asn_TYPE_descriptor_t asn_DEF_ResetStateReq; 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* _ResetStateReq_H_ */ 39 | #include 40 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ResetStateRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ResetStateRes_H_ 8 | #define _ResetStateRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* ResetStateRes */ 22 | typedef struct ResetStateRes { 23 | ResultCode_t result; 24 | /* 25 | * This type is extensible, 26 | * possible extensions are below. 27 | */ 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } ResetStateRes_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_ResetStateRes; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _ResetStateRes_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ResultCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _ResultCode_H_ 8 | #define _ResultCode_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Dependencies */ 21 | typedef enum ResultCode { 22 | ResultCode_ok = 0, 23 | ResultCode_illegalClientId = 1, 24 | ResultCode_illegalBankId = 2, 25 | ResultCode_illegalSlotId = 3, 26 | ResultCode_unsupportedProtocolVersion = 4, 27 | ResultCode_unknownSlotmap = 5, 28 | ResultCode_identityInUse = 6, 29 | ResultCode_cardNotPresent = 100, 30 | ResultCode_cardUnresponsive = 101, 31 | ResultCode_cardTransmissionError = 102 32 | /* 33 | * Enumeration is extensible 34 | */ 35 | } e_ResultCode; 36 | 37 | /* ResultCode */ 38 | typedef long ResultCode_t; 39 | 40 | /* Implementation */ 41 | extern asn_TYPE_descriptor_t asn_DEF_ResultCode; 42 | asn_struct_free_f ResultCode_free; 43 | asn_struct_print_f ResultCode_print; 44 | asn_constr_check_f ResultCode_constraint; 45 | ber_type_decoder_f ResultCode_decode_ber; 46 | der_type_encoder_f ResultCode_encode_der; 47 | xer_type_decoder_f ResultCode_decode_xer; 48 | xer_type_encoder_f ResultCode_encode_xer; 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* _ResultCode_H_ */ 55 | #include 56 | -------------------------------------------------------------------------------- /include/osmocom/rspro/RsproPDU.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _RsproPDU_H_ 8 | #define _RsproPDU_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | /* RsproPDU */ 24 | typedef struct RsproPDU { 25 | long version; 26 | OperationTag_t tag; 27 | RsproPDUchoice_t msg; 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } RsproPDU_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_RsproPDU; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _RsproPDU_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/SetAtrReq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _SetAtrReq_H_ 8 | #define _SetAtrReq_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | /* SetAtrReq */ 23 | typedef struct SetAtrReq { 24 | ClientSlot_t slot; 25 | ATR_t atr; 26 | /* 27 | * This type is extensible, 28 | * possible extensions are below. 29 | */ 30 | 31 | /* Context for parsing across buffer boundaries */ 32 | asn_struct_ctx_t _asn_ctx; 33 | } SetAtrReq_t; 34 | 35 | /* Implementation */ 36 | extern asn_TYPE_descriptor_t asn_DEF_SetAtrReq; 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _SetAtrReq_H_ */ 43 | #include 44 | -------------------------------------------------------------------------------- /include/osmocom/rspro/SetAtrRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _SetAtrRes_H_ 8 | #define _SetAtrRes_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* SetAtrRes */ 22 | typedef struct SetAtrRes { 23 | ResultCode_t result; 24 | /* 25 | * This type is extensible, 26 | * possible extensions are below. 27 | */ 28 | 29 | /* Context for parsing across buffer boundaries */ 30 | asn_struct_ctx_t _asn_ctx; 31 | } SetAtrRes_t; 32 | 33 | /* Implementation */ 34 | extern asn_TYPE_descriptor_t asn_DEF_SetAtrRes; 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* _SetAtrRes_H_ */ 41 | #include 42 | -------------------------------------------------------------------------------- /include/osmocom/rspro/SlotNumber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _SlotNumber_H_ 8 | #define _SlotNumber_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* SlotNumber */ 21 | typedef long SlotNumber_t; 22 | 23 | /* Implementation */ 24 | extern asn_TYPE_descriptor_t asn_DEF_SlotNumber; 25 | asn_struct_free_f SlotNumber_free; 26 | asn_struct_print_f SlotNumber_print; 27 | asn_constr_check_f SlotNumber_constraint; 28 | ber_type_decoder_f SlotNumber_decode_ber; 29 | der_type_encoder_f SlotNumber_encode_der; 30 | xer_type_decoder_f SlotNumber_decode_xer; 31 | xer_type_encoder_f SlotNumber_encode_xer; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _SlotNumber_H_ */ 38 | #include 39 | -------------------------------------------------------------------------------- /include/osmocom/rspro/SlotPhysStatus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _SlotPhysStatus_H_ 8 | #define _SlotPhysStatus_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* SlotPhysStatus */ 22 | typedef struct SlotPhysStatus { 23 | BOOLEAN_t resetActive; 24 | BOOLEAN_t *vccPresent /* OPTIONAL */; 25 | BOOLEAN_t *clkActive /* OPTIONAL */; 26 | BOOLEAN_t *cardPresent /* OPTIONAL */; 27 | /* 28 | * This type is extensible, 29 | * possible extensions are below. 30 | */ 31 | 32 | /* Context for parsing across buffer boundaries */ 33 | asn_struct_ctx_t _asn_ctx; 34 | } SlotPhysStatus_t; 35 | 36 | /* Implementation */ 37 | extern asn_TYPE_descriptor_t asn_DEF_SlotPhysStatus; 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* _SlotPhysStatus_H_ */ 44 | #include 45 | -------------------------------------------------------------------------------- /include/osmocom/rspro/TpduCardToModem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _TpduCardToModem_H_ 8 | #define _TpduCardToModem_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* TpduCardToModem */ 25 | typedef struct TpduCardToModem { 26 | BankSlot_t fromBankSlot; 27 | ClientSlot_t toClientSlot; 28 | TpduFlags_t flags; 29 | OCTET_STRING_t data; 30 | /* 31 | * This type is extensible, 32 | * possible extensions are below. 33 | */ 34 | 35 | /* Context for parsing across buffer boundaries */ 36 | asn_struct_ctx_t _asn_ctx; 37 | } TpduCardToModem_t; 38 | 39 | /* Implementation */ 40 | extern asn_TYPE_descriptor_t asn_DEF_TpduCardToModem; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _TpduCardToModem_H_ */ 47 | #include 48 | -------------------------------------------------------------------------------- /include/osmocom/rspro/TpduFlags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _TpduFlags_H_ 8 | #define _TpduFlags_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* TpduFlags */ 22 | typedef struct TpduFlags { 23 | BOOLEAN_t tpduHeaderPresent; 24 | BOOLEAN_t finalPart; 25 | BOOLEAN_t procByteContinueTx; 26 | BOOLEAN_t procByteContinueRx; 27 | /* 28 | * This type is extensible, 29 | * possible extensions are below. 30 | */ 31 | 32 | /* Context for parsing across buffer boundaries */ 33 | asn_struct_ctx_t _asn_ctx; 34 | } TpduFlags_t; 35 | 36 | /* Implementation */ 37 | extern asn_TYPE_descriptor_t asn_DEF_TpduFlags; 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* _TpduFlags_H_ */ 44 | #include 45 | -------------------------------------------------------------------------------- /include/osmocom/rspro/TpduModemToCard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #ifndef _TpduModemToCard_H_ 8 | #define _TpduModemToCard_H_ 9 | 10 | 11 | #include 12 | 13 | /* Including external dependencies */ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* TpduModemToCard */ 25 | typedef struct TpduModemToCard { 26 | ClientSlot_t fromClientSlot; 27 | BankSlot_t toBankSlot; 28 | TpduFlags_t flags; 29 | OCTET_STRING_t data; 30 | /* 31 | * This type is extensible, 32 | * possible extensions are below. 33 | */ 34 | 35 | /* Context for parsing across buffer boundaries */ 36 | asn_struct_ctx_t _asn_ctx; 37 | } TpduModemToCard_t; 38 | 39 | /* Implementation */ 40 | extern asn_TYPE_descriptor_t asn_DEF_TpduModemToCard; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _TpduModemToCard_H_ */ 47 | #include 48 | -------------------------------------------------------------------------------- /include/osmocom/rspro/asn_application.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | /* 6 | * Application-level ASN.1 callbacks. 7 | */ 8 | #ifndef _ASN_APPLICATION_H_ 9 | #define _ASN_APPLICATION_H_ 10 | 11 | #include "asn_system.h" /* for platform-dependent types */ 12 | #include "asn_codecs.h" /* for ASN.1 codecs specifics */ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* 19 | * Generic type of an application-defined callback to return various 20 | * types of data to the application. 21 | * EXPECTED RETURN VALUES: 22 | * -1: Failed to consume bytes. Abort the mission. 23 | * Non-negative return values indicate success, and ignored. 24 | */ 25 | typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, 26 | void *application_specific_key); 27 | 28 | /* 29 | * A callback of this type is called whenever constraint validation fails 30 | * on some ASN.1 type. See "constraints.h" for more details on constraint 31 | * validation. 32 | * This callback specifies a descriptor of the ASN.1 type which failed 33 | * the constraint check, as well as human readable message on what 34 | * particular constraint has failed. 35 | */ 36 | typedef void (asn_app_constraint_failed_f)(void *application_specific_key, 37 | struct asn_TYPE_descriptor_s *type_descriptor_which_failed, 38 | const void *structure_which_failed_ptr, 39 | const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ 46 | 47 | #endif /* _ASN_APPLICATION_H_ */ 48 | -------------------------------------------------------------------------------- /include/osmocom/rspro/asn_codecs_prim.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef ASN_CODECS_PRIM_H 6 | #define ASN_CODECS_PRIM_H 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct ASN__PRIMITIVE_TYPE_s { 15 | uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ 16 | int size; /* Size of the buffer */ 17 | } ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ 18 | 19 | asn_struct_free_f ASN__PRIMITIVE_TYPE_free; 20 | ber_type_decoder_f ber_decode_primitive; 21 | der_type_encoder_f der_encode_primitive; 22 | 23 | /* 24 | * A callback specification for the xer_decode_primitive() function below. 25 | */ 26 | enum xer_pbd_rval { 27 | XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ 28 | XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ 29 | XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ 30 | XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ 31 | XPBD_BODY_CONSUMED /* Body is recognized and consumed */ 32 | }; 33 | typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) 34 | (asn_TYPE_descriptor_t *td, void *struct_ptr, 35 | const void *chunk_buf, size_t chunk_size); 36 | 37 | /* 38 | * Specific function to decode simple primitive types. 39 | * Also see xer_decode_general() in xer_decoder.h 40 | */ 41 | asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, 42 | asn_TYPE_descriptor_t *type_descriptor, 43 | void **struct_ptr, size_t struct_size, 44 | const char *opt_mname, 45 | const void *buf_ptr, size_t size, 46 | xer_primitive_body_decoder_f *prim_body_decoder 47 | ); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* ASN_CODECS_PRIM_H */ 54 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ber_decoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BER_DECODER_H_ 6 | #define _BER_DECODER_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 15 | struct asn_codec_ctx_s; /* Forward declaration */ 16 | 17 | /* 18 | * The BER decoder of any type. 19 | * This function may be invoked directly from the application. 20 | * The der_encode() function (der_encoder.h) is an opposite to ber_decode(). 21 | */ 22 | asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, 23 | struct asn_TYPE_descriptor_s *type_descriptor, 24 | void **struct_ptr, /* Pointer to a target structure's pointer */ 25 | const void *buffer, /* Data to be decoded */ 26 | size_t size /* Size of that buffer */ 27 | ); 28 | 29 | /* 30 | * Type of generic function which decodes the byte stream into the structure. 31 | */ 32 | typedef asn_dec_rval_t (ber_type_decoder_f)( 33 | struct asn_codec_ctx_s *opt_codec_ctx, 34 | struct asn_TYPE_descriptor_s *type_descriptor, 35 | void **struct_ptr, const void *buf_ptr, size_t size, 36 | int tag_mode); 37 | 38 | /******************************* 39 | * INTERNALLY USEFUL FUNCTIONS * 40 | *******************************/ 41 | 42 | /* 43 | * Check that all tags correspond to the type definition (as given in head). 44 | * On return, last_length would contain either a non-negative length of the 45 | * value part of the last TLV, or the negative number of expected 46 | * "end of content" sequences. The number may only be negative if the 47 | * head->last_tag_form is non-zero. 48 | */ 49 | asn_dec_rval_t ber_check_tags( 50 | struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ 51 | struct asn_TYPE_descriptor_s *type_descriptor, 52 | asn_struct_ctx_t *opt_ctx, /* saved decoding context */ 53 | const void *ptr, size_t size, 54 | int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ 55 | int last_tag_form, /* {-1,0:1}: any, primitive, constr */ 56 | ber_tlv_len_t *last_length, 57 | int *opt_tlv_form /* optional tag form */ 58 | ); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* _BER_DECODER_H_ */ 65 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ber_tlv_length.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BER_TLV_LENGTH_H_ 6 | #define _BER_TLV_LENGTH_H_ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | typedef ssize_t ber_tlv_len_t; 13 | 14 | /* 15 | * This function tries to fetch the length of the BER TLV value and place it 16 | * in *len_r. 17 | * RETURN VALUES: 18 | * 0: More data expected than bufptr contains. 19 | * -1: Fatal error deciphering length. 20 | * >0: Number of bytes used from bufptr. 21 | * On return with >0, len_r is constrained as -1..MAX, where -1 mean 22 | * that the value is of indefinite length. 23 | */ 24 | ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, 25 | ber_tlv_len_t *len_r); 26 | 27 | /* 28 | * This function expects bufptr to be positioned over L in TLV. 29 | * It returns number of bytes occupied by L and V together, suitable 30 | * for skipping. The function properly handles indefinite length. 31 | * RETURN VALUES: 32 | * Standard {-1,0,>0} convention. 33 | */ 34 | ssize_t ber_skip_length( 35 | struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ 36 | int _is_constructed, const void *bufptr, size_t size); 37 | 38 | /* 39 | * This function serializes the length (L from TLV) in DER format. 40 | * It always returns number of bytes necessary to represent the length, 41 | * it is a caller's responsibility to check the return value 42 | * against the supplied buffer's size. 43 | */ 44 | size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* _BER_TLV_LENGTH_H_ */ 51 | -------------------------------------------------------------------------------- /include/osmocom/rspro/ber_tlv_tag.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _BER_TLV_TAG_H_ 6 | #define _BER_TLV_TAG_H_ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | enum asn_tag_class { 13 | ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ 14 | ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ 15 | ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ 16 | ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ 17 | }; 18 | typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ 19 | 20 | /* 21 | * Tag class is encoded together with tag value for optimization purposes. 22 | */ 23 | #define BER_TAG_CLASS(tag) ((tag) & 0x3) 24 | #define BER_TAG_VALUE(tag) ((tag) >> 2) 25 | #define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) 26 | 27 | #define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) 28 | 29 | /* 30 | * Several functions for printing the TAG in the canonical form 31 | * (i.e. "[PRIVATE 0]"). 32 | * Return values correspond to their libc counterparts (if any). 33 | */ 34 | ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); 35 | ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); 36 | char *ber_tlv_tag_string(ber_tlv_tag_t tag); 37 | 38 | 39 | /* 40 | * This function tries to fetch the tag from the input stream. 41 | * RETURN VALUES: 42 | * 0: More data expected than bufptr contains. 43 | * -1: Fatal error deciphering tag. 44 | * >0: Number of bytes used from bufptr. tag_r will contain the tag. 45 | */ 46 | ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); 47 | 48 | /* 49 | * This function serializes the tag (T from TLV) in BER format. 50 | * It always returns number of bytes necessary to represent the tag, 51 | * it is a caller's responsibility to check the return value 52 | * against the supplied buffer's size. 53 | */ 54 | size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _BER_TLV_TAG_H_ */ 61 | -------------------------------------------------------------------------------- /include/osmocom/rspro/constr_CHOICE.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004, 2005 Lev Walkin . 3 | * All rights reserved. 4 | * Redistribution and modifications are permitted subject to BSD license. 5 | */ 6 | #ifndef _CONSTR_CHOICE_H_ 7 | #define _CONSTR_CHOICE_H_ 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef const struct asn_CHOICE_specifics_s { 16 | /* 17 | * Target structure description. 18 | */ 19 | int struct_size; /* Size of the target structure. */ 20 | int ctx_offset; /* Offset of the asn_codec_ctx_t member */ 21 | int pres_offset; /* Identifier of the present member */ 22 | int pres_size; /* Size of the identifier (enum) */ 23 | 24 | /* 25 | * Tags to members mapping table. 26 | */ 27 | const asn_TYPE_tag2member_t *tag2el; 28 | int tag2el_count; 29 | 30 | /* Canonical ordering of CHOICE elements, for PER */ 31 | int *canonical_order; 32 | 33 | /* 34 | * Extensions-related stuff. 35 | */ 36 | int ext_start; /* First member of extensions, or -1 */ 37 | } asn_CHOICE_specifics_t; 38 | 39 | /* 40 | * A set specialized functions dealing with the CHOICE type. 41 | */ 42 | asn_struct_free_f CHOICE_free; 43 | asn_struct_print_f CHOICE_print; 44 | asn_constr_check_f CHOICE_constraint; 45 | ber_type_decoder_f CHOICE_decode_ber; 46 | der_type_encoder_f CHOICE_encode_der; 47 | xer_type_decoder_f CHOICE_decode_xer; 48 | xer_type_encoder_f CHOICE_encode_xer; 49 | per_type_decoder_f CHOICE_decode_uper; 50 | per_type_encoder_f CHOICE_encode_uper; 51 | per_type_decoder_f CHOICE_decode_aper; 52 | per_type_encoder_f CHOICE_encode_aper; 53 | asn_outmost_tag_f CHOICE_outmost_tag; 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* _CONSTR_CHOICE_H_ */ 60 | -------------------------------------------------------------------------------- /include/osmocom/rspro/constr_SEQUENCE.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _CONSTR_SEQUENCE_H_ 6 | #define _CONSTR_SEQUENCE_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef const struct asn_SEQUENCE_specifics_s { 15 | /* 16 | * Target structure description. 17 | */ 18 | int struct_size; /* Size of the target structure. */ 19 | int ctx_offset; /* Offset of the asn_struct_ctx_t member */ 20 | 21 | /* 22 | * Tags to members mapping table (sorted). 23 | */ 24 | const asn_TYPE_tag2member_t *tag2el; 25 | int tag2el_count; 26 | 27 | /* 28 | * Optional members of the extensions root (roms) or additions (aoms). 29 | * Meaningful for PER. 30 | */ 31 | const int *oms; /* Optional MemberS */ 32 | int roms_count; /* Root optional members count */ 33 | int aoms_count; /* Additions optional members count */ 34 | 35 | /* 36 | * Description of an extensions group. 37 | */ 38 | int ext_after; /* Extensions start after this member */ 39 | int ext_before; /* Extensions stop before this member */ 40 | } asn_SEQUENCE_specifics_t; 41 | 42 | 43 | /* 44 | * A set specialized functions dealing with the SEQUENCE type. 45 | */ 46 | asn_struct_free_f SEQUENCE_free; 47 | asn_struct_print_f SEQUENCE_print; 48 | asn_constr_check_f SEQUENCE_constraint; 49 | ber_type_decoder_f SEQUENCE_decode_ber; 50 | der_type_encoder_f SEQUENCE_encode_der; 51 | xer_type_decoder_f SEQUENCE_decode_xer; 52 | xer_type_encoder_f SEQUENCE_encode_xer; 53 | per_type_decoder_f SEQUENCE_decode_uper; 54 | per_type_encoder_f SEQUENCE_encode_uper; 55 | per_type_decoder_f SEQUENCE_decode_aper; 56 | per_type_encoder_f SEQUENCE_encode_aper; 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* _CONSTR_SEQUENCE_H_ */ 63 | -------------------------------------------------------------------------------- /include/osmocom/rspro/constraints.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004, 2006 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _ASN1_CONSTRAINTS_VALIDATOR_H_ 6 | #define _ASN1_CONSTRAINTS_VALIDATOR_H_ 7 | 8 | #include /* Platform-dependent types */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 15 | 16 | /* 17 | * Validate the structure according to the ASN.1 constraints. 18 | * If errbuf and errlen are given, they shall be pointing to the appropriate 19 | * buffer space and its length before calling this function. Alternatively, 20 | * they could be passed as NULL's. If constraints validation fails, 21 | * errlen will contain the actual number of bytes taken from the errbuf 22 | * to encode an error message (properly 0-terminated). 23 | * 24 | * RETURN VALUES: 25 | * This function returns 0 in case all ASN.1 constraints are met 26 | * and -1 if one or more constraints were failed. 27 | */ 28 | int 29 | asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, 30 | const void *struct_ptr, /* Target language's structure */ 31 | char *errbuf, /* Returned error description */ 32 | size_t *errlen /* Length of the error description */ 33 | ); 34 | 35 | 36 | /* 37 | * Generic type for constraint checking callback, 38 | * associated with every type descriptor. 39 | */ 40 | typedef int (asn_constr_check_f)( 41 | struct asn_TYPE_descriptor_s *type_descriptor, 42 | const void *struct_ptr, 43 | asn_app_constraint_failed_f *optional_callback, /* Log the error */ 44 | void *optional_app_key /* Opaque key passed to a callback */ 45 | ); 46 | 47 | /******************************* 48 | * INTERNALLY USEFUL FUNCTIONS * 49 | *******************************/ 50 | 51 | asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ 52 | asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ 53 | 54 | /* 55 | * Invoke the callback with a complete error message. 56 | */ 57 | #define _ASN_CTFAIL if(ctfailcb) ctfailcb 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* _ASN1_CONSTRAINTS_VALIDATOR_H_ */ 64 | -------------------------------------------------------------------------------- /include/osmocom/rspro/der_encoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _DER_ENCODER_H_ 6 | #define _DER_ENCODER_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 15 | 16 | /* 17 | * The DER encoder of any type. May be invoked by the application. 18 | * The ber_decode() function (ber_decoder.h) is an opposite of der_encode(). 19 | */ 20 | asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, 21 | void *struct_ptr, /* Structure to be encoded */ 22 | asn_app_consume_bytes_f *consume_bytes_cb, 23 | void *app_key /* Arbitrary callback argument */ 24 | ); 25 | 26 | /* A variant of der_encode() which encodes data into the pre-allocated buffer */ 27 | asn_enc_rval_t der_encode_to_buffer( 28 | struct asn_TYPE_descriptor_s *type_descriptor, 29 | void *struct_ptr, /* Structure to be encoded */ 30 | void *buffer, /* Pre-allocated buffer */ 31 | size_t buffer_size /* Initial buffer size (maximum) */ 32 | ); 33 | 34 | /* 35 | * Type of the generic DER encoder. 36 | */ 37 | typedef asn_enc_rval_t (der_type_encoder_f)( 38 | struct asn_TYPE_descriptor_s *type_descriptor, 39 | void *struct_ptr, /* Structure to be encoded */ 40 | int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ 41 | ber_tlv_tag_t tag, 42 | asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ 43 | void *app_key /* Arbitrary callback argument */ 44 | ); 45 | 46 | 47 | /******************************* 48 | * INTERNALLY USEFUL FUNCTIONS * 49 | *******************************/ 50 | 51 | /* 52 | * Write out leading TL[v] sequence according to the type definition. 53 | */ 54 | ssize_t der_write_tags( 55 | struct asn_TYPE_descriptor_s *type_descriptor, 56 | size_t struct_length, 57 | int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ 58 | int last_tag_form, /* {0,!0}: prim, constructed */ 59 | ber_tlv_tag_t tag, 60 | asn_app_consume_bytes_f *consume_bytes_cb, 61 | void *app_key 62 | ); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* _DER_ENCODER_H_ */ 69 | -------------------------------------------------------------------------------- /include/osmocom/rspro/per_decoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005, 2007 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _PER_DECODER_H_ 6 | #define _PER_DECODER_H_ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 16 | 17 | /* 18 | * Unaligned PER decoder of a "complete encoding" as per X.691#10.1. 19 | * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. 20 | */ 21 | asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, 22 | struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ 23 | void **struct_ptr, /* Pointer to a target structure's pointer */ 24 | const void *buffer, /* Data to be decoded */ 25 | size_t size /* Size of data buffer */ 26 | ); 27 | 28 | /* 29 | * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. 30 | * WARNING: This call returns the number of BITS read from the stream. Beware. 31 | */ 32 | asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, 33 | struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ 34 | void **struct_ptr, /* Pointer to a target structure's pointer */ 35 | const void *buffer, /* Data to be decoded */ 36 | size_t size, /* Size of data buffer */ 37 | int skip_bits, /* Number of unused leading bits, 0..7 */ 38 | int unused_bits /* Number of unused tailing bits, 0..7 */ 39 | ); 40 | 41 | /* 42 | * Aligned PER decoder of a "complete encoding" as per X.691#10.1. 43 | * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. 44 | */ 45 | asn_dec_rval_t aper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, 46 | struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ 47 | void **struct_ptr, /* Pointer to a target structure's pointer */ 48 | const void *buffer, /* Data to be decoded */ 49 | size_t size /* Size of data buffer */ 50 | ); 51 | 52 | /* 53 | * Aligned PER decoder of any ASN.1 type. May be invoked by the application. 54 | * WARNING: This call returns the number of BITS read from the stream. Beware. 55 | */ 56 | asn_dec_rval_t aper_decode(struct asn_codec_ctx_s *opt_codec_ctx, 57 | struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ 58 | void **struct_ptr, /* Pointer to a target structure's pointer */ 59 | const void *buffer, /* Data to be decoded */ 60 | size_t size, /* Size of data buffer */ 61 | int skip_bits, /* Number of unused leading bits, 0..7 */ 62 | int unused_bits /* Number of unused tailing bits, 0..7 */ 63 | ); 64 | /* 65 | * Type of the type-specific PER decoder function. 66 | */ 67 | typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, 68 | struct asn_TYPE_descriptor_s *type_descriptor, 69 | asn_per_constraints_t *constraints, 70 | void **struct_ptr, 71 | asn_per_data_t *per_data 72 | ); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* _PER_DECODER_H_ */ 79 | -------------------------------------------------------------------------------- /include/osmocom/rspro/per_encoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006, 2007 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _PER_ENCODER_H_ 6 | #define _PER_ENCODER_H_ 7 | 8 | #include 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 16 | 17 | /* 18 | * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. 19 | * WARNING: This function returns the number of encoded bits in the .encoded 20 | * field of the return value. Use the following formula to convert to bytes: 21 | * bytes = ((.encoded + 7) / 8) 22 | */ 23 | asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, 24 | void *struct_ptr, /* Structure to be encoded */ 25 | asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ 26 | void *app_key /* Arbitrary callback argument */ 27 | ); 28 | 29 | /* 30 | * A variant of uper_encode() which encodes data into the existing buffer 31 | * WARNING: This function returns the number of encoded bits in the .encoded 32 | * field of the return value. 33 | */ 34 | asn_enc_rval_t uper_encode_to_buffer( 35 | struct asn_TYPE_descriptor_s *type_descriptor, 36 | void *struct_ptr, /* Structure to be encoded */ 37 | void *buffer, /* Pre-allocated buffer */ 38 | size_t buffer_size /* Initial buffer size (max) */ 39 | ); 40 | 41 | asn_enc_rval_t aper_encode_to_buffer( 42 | struct asn_TYPE_descriptor_s *type_descriptor, 43 | void *struct_ptr, /* Structure to be encoded */ 44 | void *buffer, /* Pre-allocated buffer */ 45 | size_t buffer_size /* Initial buffer size (max) */ 46 | ); 47 | /* 48 | * A variant of uper_encode_to_buffer() which allocates buffer itself. 49 | * Returns the number of bytes in the buffer or -1 in case of failure. 50 | * WARNING: This function produces a "Production of the complete encoding", 51 | * with length of at least one octet. Contrast this to precise bit-packing 52 | * encoding of uper_encode() and uper_encode_to_buffer(). 53 | */ 54 | ssize_t uper_encode_to_new_buffer( 55 | struct asn_TYPE_descriptor_s *type_descriptor, 56 | asn_per_constraints_t *constraints, 57 | void *struct_ptr, /* Structure to be encoded */ 58 | void **buffer_r /* Buffer allocated and returned */ 59 | ); 60 | 61 | ssize_t 62 | aper_encode_to_new_buffer(struct asn_TYPE_descriptor_s *td, 63 | asn_per_constraints_t *constraints, 64 | void *sptr, 65 | void **buffer_r); 66 | /* 67 | * Type of the generic PER encoder function. 68 | */ 69 | typedef asn_enc_rval_t (per_type_encoder_f)( 70 | struct asn_TYPE_descriptor_s *type_descriptor, 71 | asn_per_constraints_t *constraints, 72 | void *struct_ptr, 73 | asn_per_outp_t *per_output 74 | ); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif /* _PER_ENCODER_H_ */ 81 | -------------------------------------------------------------------------------- /include/osmocom/rspro/per_opentype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _PER_OPENTYPE_H_ 6 | #define _PER_OPENTYPE_H_ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); 13 | 14 | int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); 15 | 16 | int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); 17 | 18 | int aper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif /* _PER_OPENTYPE_H_ */ 25 | -------------------------------------------------------------------------------- /include/osmocom/rspro/xer_encoder.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #ifndef _XER_ENCODER_H_ 6 | #define _XER_ENCODER_H_ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | struct asn_TYPE_descriptor_s; /* Forward declaration */ 15 | 16 | /* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ 17 | enum xer_encoder_flags_e { 18 | /* Mode of encoding */ 19 | XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ 20 | XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ 21 | }; 22 | 23 | /* 24 | * The XER encoder of any type. May be invoked by the application. 25 | */ 26 | asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, 27 | void *struct_ptr, /* Structure to be encoded */ 28 | enum xer_encoder_flags_e xer_flags, 29 | asn_app_consume_bytes_f *consume_bytes_cb, 30 | void *app_key /* Arbitrary callback argument */ 31 | ); 32 | 33 | /* 34 | * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) 35 | * output into the chosen file pointer. 36 | * RETURN VALUES: 37 | * 0: The structure is printed. 38 | * -1: Problem printing the structure. 39 | * WARNING: No sensible errno value is returned. 40 | */ 41 | int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); 42 | 43 | /* 44 | * Type of the generic XER encoder. 45 | */ 46 | typedef asn_enc_rval_t (xer_type_encoder_f)( 47 | struct asn_TYPE_descriptor_s *type_descriptor, 48 | void *struct_ptr, /* Structure to be encoded */ 49 | int ilevel, /* Level of indentation */ 50 | enum xer_encoder_flags_e xer_flags, 51 | asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ 52 | void *app_key /* Arbitrary callback argument */ 53 | ); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* _XER_ENCODER_H_ */ 60 | -------------------------------------------------------------------------------- /include/osmocom/rspro/xer_support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2003, 2004 X/IO Labs, xiolabs.com. 3 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 4 | * Redistribution and modifications are permitted subject to BSD license. 5 | */ 6 | #ifndef _XER_SUPPORT_H_ 7 | #define _XER_SUPPORT_H_ 8 | 9 | #include /* Platform-specific types */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /* 16 | * Types of data transferred to the application. 17 | */ 18 | typedef enum { 19 | PXML_TEXT, /* Plain text between XML tags. */ 20 | PXML_TAG, /* A tag, starting with '<'. */ 21 | PXML_COMMENT, /* An XML comment, including "". */ 22 | /* 23 | * The following chunk types are reported if the chunk 24 | * terminates the specified XML element. 25 | */ 26 | PXML_TAG_END, /* Tag ended */ 27 | PXML_COMMENT_END /* Comment ended */ 28 | } pxml_chunk_type_e; 29 | 30 | /* 31 | * Callback function that is called by the parser when parsed data is 32 | * available. The _opaque is the pointer to a field containing opaque user 33 | * data specified in pxml_create() call. The chunk type is _type and the text 34 | * data is the piece of buffer identified by _bufid (as supplied to 35 | * pxml_feed() call) starting at offset _offset and of _size bytes size. 36 | * The chunk is NOT '\0'-terminated. 37 | */ 38 | typedef int (pxml_callback_f)(pxml_chunk_type_e _type, 39 | const void *_chunk_data, size_t _chunk_size, void *_key); 40 | 41 | /* 42 | * Parse the given buffer as it were a chunk of XML data. 43 | * Invoke the specified callback each time the meaninful data is found. 44 | * This function returns number of bytes consumed from the bufer. 45 | * It will always be lesser than or equal to the specified _size. 46 | * The next invocation of this function must account the difference. 47 | */ 48 | ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, 49 | pxml_callback_f *cb, void *_key); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* _XER_SUPPORT_H_ */ 56 | -------------------------------------------------------------------------------- /libosmo-rspro.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Osmocom RSPRO library 7 | Description: Osmocom Remote SIM Protocol library 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -losmo-rspro 10 | Cflags: -I${includedir}/ 11 | -------------------------------------------------------------------------------- /move-asn1-header-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Usage: 3 | # ../../move-asn1-headers.sh subdir_name File1.h File2.h ... 4 | # All .h and .c files in the current directory are edited to use #include <...> 5 | # style for the .h files given on the cmdline. The given .h files are also 6 | # moved to ../include// so that #include <...> will work. 7 | 8 | set -e 9 | 10 | base_dir="$(dirname "$0")" 11 | 12 | include_subdir="$1" 13 | shift 14 | 15 | include_dir="$base_dir/include/$include_subdir" 16 | mkdir -p "$include_dir" 17 | echo "$PWD/*.h --> $include_dir" 18 | 19 | collect_sed_commands() { 20 | while [ -n "$1" ]; do 21 | fname="$1" 22 | shift 23 | 24 | echo "s,^#include \"$fname\"$,#include <$include_subdir/$fname>," 25 | done 26 | } 27 | 28 | move_headers() { 29 | echo mv $@ "$include_dir/" 30 | mv $@ "$include_dir/" 31 | } 32 | 33 | # Replace all `#include "foo.h"' with `#include ' locally 34 | # - Collect sed commands to replace all header includes, for efficiency 35 | cmds="$(mktemp)" 36 | echo "collecting sed commands..." 37 | collect_sed_commands $@ > "$cmds" 38 | # - Run commands on all h and c files 39 | echo "sed -i -f \"$cmds\" *.[hc]" 40 | sed -i -f "$cmds" *.[hc] 41 | rm "$cmds" 42 | 43 | # Now move sed'ed *.h files to the proper ../include/dir 44 | move_headers $@ 45 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = rspro . 2 | if BUILD_BANKD 3 | SUBDIRS += bankd 4 | endif 5 | if BUILD_SERVER 6 | SUBDIRS += server 7 | endif 8 | SUBDIRS += client 9 | 10 | AM_CFLAGS = -Wall \ 11 | -I$(top_srcdir)/include \ 12 | -I$(top_builddir)/include \ 13 | -I$(top_srcdir)/include/osmocom/rspro \ 14 | $(OSMONETIF_CFLAGS) \ 15 | $(OSMOGSM_CFLAGS) \ 16 | $(OSMOCORE_CFLAGS) \ 17 | $(NULL) 18 | 19 | RSPRO_LIBVERSION=2:2:0 20 | lib_LTLIBRARIES = libosmo-rspro.la 21 | libosmo_rspro_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RSPRO_LIBVERSION) 22 | # OSMONETIF_LIBS, OSMOGSM_LIBS not needed, we don't use any of its symbols, only the header above 23 | libosmo_rspro_la_LIBADD = $(OSMOCORE_LIBS) \ 24 | rspro/libosmo-asn1-rspro.la 25 | libosmo_rspro_la_SOURCES = rspro_util.c asn1c_helpers.c 26 | 27 | noinst_HEADERS = debug.h rspro_util.h slotmap.h rspro_client_fsm.h \ 28 | asn1c_helpers.h 29 | -------------------------------------------------------------------------------- /src/asn1c_helpers.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "asn1c_helpers.h" 9 | 10 | const char *asn_type_name(const asn_TYPE_descriptor_t *td) 11 | { 12 | return td->name; 13 | } 14 | 15 | static int 16 | _fetch_present_idx(const void *struct_ptr, int pres_offset, int pres_size) { 17 | const void *present_ptr; 18 | int present; 19 | 20 | present_ptr = ((const char *)struct_ptr) + pres_offset; 21 | 22 | switch(pres_size) { 23 | case sizeof(int): present = *(const int *)present_ptr; break; 24 | case sizeof(short): present = *(const short *)present_ptr; break; 25 | case sizeof(char): present = *(const char *)present_ptr; break; 26 | default: 27 | /* ANSI C mandates enum to be equivalent to integer */ 28 | assert(pres_size != sizeof(int)); 29 | return 0; /* If not aborted, pass back safe value */ 30 | } 31 | 32 | return present; 33 | } 34 | 35 | const char *asn_choice_name(const asn_TYPE_descriptor_t *td, const void *sptr) 36 | { 37 | const asn_CHOICE_specifics_t *cspec = td->specifics; 38 | int present = _fetch_present_idx(sptr, cspec->pres_offset, cspec->pres_size); 39 | const asn_TYPE_member_t *elm; 40 | 41 | if (present < 0 || present >= td->elements_count) 42 | return ""; 43 | 44 | elm = &td->elements[present-1]; 45 | return elm->name; 46 | } 47 | 48 | const char *asn_enum_name(const asn_TYPE_descriptor_t *td, int data) 49 | { 50 | const asn_INTEGER_specifics_t *ispec = td->specifics; 51 | 52 | if (data < 0 || data >= ispec->map_count) 53 | return ""; 54 | 55 | return ispec->value2enum[data].enum_name; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/asn1c_helpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | struct asn_TYPE_descriptor_t; 5 | 6 | const char *asn_type_name(const asn_TYPE_descriptor_t *td); 7 | const char *asn_choice_name(const asn_TYPE_descriptor_t *td, const void *sptr); 8 | const char *asn_enum_name(const asn_TYPE_descriptor_t *td, int data); 9 | -------------------------------------------------------------------------------- /src/bankd/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -Wall \ 2 | -I$(top_srcdir)/include \ 3 | -I$(top_builddir)/include \ 4 | -I$(top_srcdir)/src \ 5 | -I$(top_srcdir)/include/osmocom/rspro \ 6 | $(OSMONETIF_CFLAGS) \ 7 | $(OSMOGSM_CFLAGS) \ 8 | $(OSMOCORE_CFLAGS) \ 9 | $(PCSC_CFLAGS) \ 10 | $(NULL) 11 | 12 | noinst_HEADERS = bankd.h internal.h gsmtap.h 13 | 14 | bin_PROGRAMS = osmo-remsim-bankd 15 | noinst_PROGRAMS = pcsc_test 16 | 17 | pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c 18 | pcsc_test_LDADD = $(top_builddir)/src/libosmo-rspro.la \ 19 | $(OSMOCORE_LIBS) \ 20 | $(PCSC_LIBS) \ 21 | $(NULL) 22 | 23 | osmo_remsim_bankd_SOURCES = ../slotmap.c ../rspro_client_fsm.c ../debug.c \ 24 | bankd_main.c bankd_pcsc.c gsmtap.c 25 | osmo_remsim_bankd_LDADD = $(top_builddir)/src/libosmo-rspro.la \ 26 | $(OSMONETIF_LIBS) \ 27 | $(OSMOGSM_LIBS) \ 28 | $(OSMOCORE_LIBS) \ 29 | $(PCSC_LIBS) \ 30 | $(CSV_LIBS) \ 31 | $(NULL) 32 | 33 | # as suggested in http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html 34 | FORCE: 35 | $(top_builddir)/src/libosmo-rspro.la: FORCE 36 | (cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libosmo-rspro.la) 37 | -------------------------------------------------------------------------------- /src/bankd/driver_core.c: -------------------------------------------------------------------------------- 1 | /*! \file reader_pcsc.c 2 | * Card reader driver core */ 3 | /* 4 | * (C) 2018 by Harald Welte 5 | * 6 | * All Rights Reserved 7 | * 8 | * SPDX-License-Identifier: GPL-2.0+ 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "internal.h" 27 | #include "debug.h" 28 | 29 | static LLIST_HEAD(g_card_reader_drivers); 30 | static LLIST_HEAD(g_card_readers); 31 | 32 | struct card_reader *card_reader_alloc(void *ctx, const char *name, 33 | const struct card_reader_driver *drv, void *drv_handle) 34 | { 35 | struct card_reader *cr = talloc_zero(ctx, struct card_reader); 36 | if (!cr) 37 | return NULL; 38 | 39 | cr->name = talloc_strdup(ctx, name); 40 | cr->drv = drv; 41 | cr->drv_handle = drv_handle; 42 | INIT_LLIST_HEAD(&cr->slots); 43 | 44 | llist_add(&cr->list, &g_card_readers); 45 | 46 | LOGP(DMAIN, LOGL_INFO, "allocated reader '%s'\n", cr->name); 47 | 48 | return cr; 49 | } 50 | 51 | /* allocate a new slot in the given reader */ 52 | struct card_reader_slot *card_reader_slot_alloc(struct card_reader *cr, unsigned int slot_num) 53 | { 54 | struct card_reader_slot *cs = talloc_zero(cr, struct card_reader_slot); 55 | if (!cs) 56 | return NULL; 57 | 58 | cs->reader = cr; 59 | llist_add(&cr->list, &cr->slots); 60 | cs->num = slot_num; 61 | 62 | return cs; 63 | } 64 | 65 | 66 | /* register a driver with the core, should typcially be called at start-up */ 67 | void card_reader_driver_register(struct card_reader_driver *drv) 68 | { 69 | llist_add_tail(&drv->list, &g_card_reader_drivers); 70 | } 71 | 72 | /* probe all readers on all drivers */ 73 | void card_readers_probe(void *ctx) 74 | { 75 | struct card_reader_driver *drv; 76 | 77 | llist_for_each_entry(drv, &g_card_reader_drivers, list) { 78 | LOGP(DMAIN, LOGL_INFO, "probing driver '%s' for drivers\n", drv->name); 79 | drv->ops->probe(ctx); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/bankd/gsmtap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | int bankd_gsmtap_init(const char *gsmtap_host); 6 | int bankd_gsmtap_send_apdu(uint8_t sub_type, const uint8_t *mdm_tpdu, unsigned int mdm_tpdu_len, 7 | const uint8_t *sim_tpdu, unsigned int sim_tpdu_len); 8 | -------------------------------------------------------------------------------- /src/bankd/internal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct card_reader_slot; 6 | 7 | struct card_reader_driver_ops { 8 | /* probe system for card readers */ 9 | void (*probe)(void *ctx); 10 | /* open a given slot, attempt to reset/start the card */ 11 | int (*open_slot)(struct card_reader_slot *slot); 12 | /* close a given slot, power down the card */ 13 | void (*close_slot)(struct card_reader_slot *slot); 14 | /* transceive an APDU */ 15 | int (*transceive_apdu)(struct card_reader_slot *slot); 16 | }; 17 | 18 | struct card_reader_driver { 19 | /* global list of drivers */ 20 | struct llist_head list; 21 | /* name of the driver */ 22 | char *name; 23 | const struct card_reader_driver_ops *ops; 24 | }; 25 | 26 | struct card_reader { 27 | /* global list of card readers */ 28 | struct llist_head list; 29 | /* name of this reader */ 30 | char *name; 31 | /* driver providing access to this reader */ 32 | const struct card_reader_driver *drv; 33 | void *drv_handle; 34 | /* list of card slots for this reader */ 35 | struct llist_head slots; 36 | }; 37 | 38 | enum card_slot_state { 39 | CARD_SLOT_OFF, 40 | CARD_SLOT_OPEN, 41 | }; 42 | 43 | struct card_reader_slot { 44 | /* links to card_reader.slots */ 45 | struct llist_head list; 46 | /* back-pointer to reader serving this slot */ 47 | struct card_reader *reader; 48 | /* slot number */ 49 | unsigned int num; 50 | /* state in which the slot is */ 51 | enum card_slot_state state; 52 | }; 53 | 54 | 55 | struct card_reader *card_reader_alloc(void *ctx, const char *name, 56 | const struct card_reader_driver *drv, void *drv_handle); 57 | struct card_reader_slot *card_reader_slot_alloc(struct card_reader *cr, unsigned int slot_num); 58 | 59 | void card_reader_driver_register(struct card_reader_driver *drv); 60 | void card_readers_probe(void *ctx); 61 | -------------------------------------------------------------------------------- /src/bankd/main.c: -------------------------------------------------------------------------------- 1 | /*! \file main.c */ 2 | /* 3 | * (C) 2018 by Harald Welte 4 | * 5 | * All Rights Reserved 6 | * 7 | * SPDX-License-Identifier: GPL-2.0+ 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | #include "internal.h" 33 | 34 | static void *g_ctx; 35 | __thread void *talloc_asn1_ctx; 36 | int asn_debug; 37 | 38 | int main(int argc, char **argv) 39 | { 40 | asn_debug = 0; 41 | g_ctx = talloc_named_const(NULL, 0, "main"); 42 | talloc_asn1_ctx = talloc_named_const(g_ctx, 0, "asn1_context"); 43 | card_readers_probe(g_ctx); 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /src/client/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -Wall \ 2 | -I$(top_srcdir)/include \ 3 | -I/$(top_builddir)/include \ 4 | -I$(top_srcdir)/src \ 5 | -I$(top_srcdir)/include/osmocom/rspro \ 6 | $(OSMONETIF_CFLAGS) \ 7 | $(OSMOGSM_CFLAGS) \ 8 | $(OSMOCORE_CFLAGS) \ 9 | $(PCSC_CFLAGS) $(USB_CFLAGS) \ 10 | $(OSMOSIMTRACE2_CFLAGS) \ 11 | $(NULL) 12 | 13 | bin_PROGRAMS = osmo-remsim-client-shell 14 | 15 | osmo_remsim_client_shell_SOURCES = user_shell.c remsim_client_main.c \ 16 | remsim_client.c main_fsm.c ../rspro_client_fsm.c ../debug.c 17 | osmo_remsim_client_shell_CFLAGS = $(AM_CFLAGS) 18 | osmo_remsim_client_shell_LDADD = $(top_builddir)/src/libosmo-rspro.la \ 19 | $(OSMONETIF_LIBS) \ 20 | $(OSMOGSM_LIBS) \ 21 | $(OSMOCORE_LIBS) \ 22 | $(NULL) 23 | 24 | if BUILD_CLIENT_IFDHANDLER 25 | EXTRA_DIST=PkgInfo osmo-remsim-client-reader_conf.in 26 | serialconf_DATA=osmo-remsim-client-reader_conf 27 | bundledir=$(usbdropdir)/libifd-osmo-remsim-client.bundle/Contents 28 | bundle_DATA=PkgInfo 29 | bundlelinuxdir=$(bundledir)/Linux 30 | bundlelinux_LTLIBRARIES = libifd_remsim_client.la 31 | libifd_remsim_client_la_SOURCES = user_ifdhandler.c \ 32 | remsim_client.c main_fsm.c ../rspro_client_fsm.c ../debug.c 33 | libifd_remsim_client_la_CFLAGS = $(AM_CFLAGS) 34 | libifd_remsim_client_la_CPPFLAGS = $(PCSC_CFLAGS) 35 | libifd_remsim_client_la_LDFLAGS = -no-undefined 36 | libifd_remsim_client_la_LIBADD = $(top_builddir)/src/libosmo-rspro.la \ 37 | $(OSMONETIF_LIBS) \ 38 | $(OSMOGSM_LIBS) \ 39 | $(OSMOCORE_LIBS) \ 40 | $(NULL) 41 | endif 42 | 43 | if BUILD_CLIENT_ST2 44 | bin_PROGRAMS += osmo-remsim-client-st2 45 | osmo_remsim_client_st2_SOURCES = user_simtrace2.c remsim_client_main.c \ 46 | remsim_client.c main_fsm.c ../rspro_client_fsm.c ../debug.c 47 | osmo_remsim_client_st2_CPPFLAGS = -DUSB_SUPPORT -DSIMTRACE_SUPPORT 48 | osmo_remsim_client_st2_CFLAGS = $(AM_CFLAGS) 49 | osmo_remsim_client_st2_LDADD = $(top_builddir)/src/libosmo-rspro.la \ 50 | $(OSMONETIF_LIBS) \ 51 | $(OSMOSIMTRACE2_LIBS) \ 52 | $(OSMOGSM_LIBS) \ 53 | $(OSMOCORE_LIBS) \ 54 | $(OSMOUSB_LIBS) \ 55 | $(USB_LIBS) \ 56 | $(NULL) 57 | endif 58 | 59 | noinst_HEADERS = client.h 60 | -------------------------------------------------------------------------------- /src/client/PkgInfo: -------------------------------------------------------------------------------- 1 | BNDL???? 2 | -------------------------------------------------------------------------------- /src/client/osmo-remsim-client-reader_conf.in: -------------------------------------------------------------------------------- 1 | #FRIENDLYNAME "osmo-remsim-client" 2 | #DEVICENAME 0:0:192.168.11.10:9998 3 | #LIBPATH @usbdropdir@/libifd-osmo-remsim-client.bundle/Contents/Linux/libifd_remsim_client.so 4 | -------------------------------------------------------------------------------- /src/debug.c: -------------------------------------------------------------------------------- 1 | /* (C) 2018-2019 by Harald Welte 2 | * 3 | * All Rights Reserved 4 | * 5 | * SPDX-License-Identifier: GPL-2.0+ 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | */ 18 | 19 | 20 | #include 21 | #include 22 | #include "debug.h" 23 | 24 | static const struct log_info_cat default_categories[] = { 25 | [DMAIN] = { 26 | .name = "DMAIN", 27 | .loglevel = LOGL_INFO, 28 | .enabled = 1, 29 | }, 30 | [DST2] = { 31 | .name = "DST2", 32 | .loglevel = LOGL_INFO, 33 | .enabled = 1, 34 | }, 35 | [DRSPRO] = { 36 | .name = "DRSPRO", 37 | .loglevel = LOGL_INFO, 38 | .enabled = 1, 39 | }, 40 | [DREST] = { 41 | .name = "DREST", 42 | .loglevel = LOGL_INFO, 43 | .enabled = 1, 44 | }, 45 | [DSLOTMAP] = { 46 | .name = "DSLOTMAP", 47 | .loglevel = LOGL_INFO, 48 | .enabled = 1, 49 | }, 50 | [DBANKDW] = { 51 | .name = "DBANKDW", 52 | .loglevel = LOGL_INFO, 53 | .enabled = 1, 54 | }, 55 | [DGSMTAP] = { 56 | .name = "DGSMTAP", 57 | .loglevel = LOGL_INFO, 58 | .enabled = 1, 59 | }, 60 | }; 61 | 62 | const struct log_info log_info = { 63 | .cat = default_categories, 64 | .num_cat = ARRAY_SIZE(default_categories), 65 | }; 66 | -------------------------------------------------------------------------------- /src/debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | enum { 5 | DMAIN, 6 | DST2, 7 | DRSPRO, 8 | DREST, 9 | DSLOTMAP, 10 | DBANKDW, 11 | DGSMTAP, 12 | }; 13 | 14 | extern const struct log_info log_info; 15 | -------------------------------------------------------------------------------- /src/rspro/BankSlot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_BankSlot_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct BankSlot, bankId), 11 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 12 | 0, 13 | &asn_DEF_BankId, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "bankId" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct BankSlot, slotNr), 20 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 21 | 0, 22 | &asn_DEF_SlotNumber, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "slotNr" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_BankSlot_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_BankSlot_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* bankId */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* slotNr */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_BankSlot_specs_1 = { 37 | sizeof(struct BankSlot), 38 | offsetof(struct BankSlot, _asn_ctx), 39 | asn_MAP_BankSlot_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_BankSlot = { 46 | "BankSlot", 47 | "BankSlot", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_BankSlot_tags_1, 59 | sizeof(asn_DEF_BankSlot_tags_1) 60 | /sizeof(asn_DEF_BankSlot_tags_1[0]), /* 1 */ 61 | asn_DEF_BankSlot_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_BankSlot_tags_1) 63 | /sizeof(asn_DEF_BankSlot_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_BankSlot_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_BankSlot_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/BankSlotStatusInd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_BankSlotStatusInd_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct BankSlotStatusInd, fromBankSlot), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_BankSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "fromBankSlot" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct BankSlotStatusInd, toClientSlot), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_ClientSlot, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "toClientSlot" 27 | }, 28 | { ATF_NOFLAGS, 0, offsetof(struct BankSlotStatusInd, slotPhysStatus), 29 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 30 | 0, 31 | &asn_DEF_SlotPhysStatus, 32 | 0, /* Defer constraints checking to the member type */ 33 | 0, /* PER is not compiled, use -gen-PER */ 34 | 0, 35 | "slotPhysStatus" 36 | }, 37 | }; 38 | static const ber_tlv_tag_t asn_DEF_BankSlotStatusInd_tags_1[] = { 39 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 40 | }; 41 | static const asn_TYPE_tag2member_t asn_MAP_BankSlotStatusInd_tag2el_1[] = { 42 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* fromBankSlot */ 43 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 1 }, /* toClientSlot */ 44 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 0 } /* slotPhysStatus */ 45 | }; 46 | static asn_SEQUENCE_specifics_t asn_SPC_BankSlotStatusInd_specs_1 = { 47 | sizeof(struct BankSlotStatusInd), 48 | offsetof(struct BankSlotStatusInd, _asn_ctx), 49 | asn_MAP_BankSlotStatusInd_tag2el_1, 50 | 3, /* Count of tags in the map */ 51 | 0, 0, 0, /* Optional elements (not needed) */ 52 | 2, /* Start extensions */ 53 | 4 /* Stop extensions */ 54 | }; 55 | asn_TYPE_descriptor_t asn_DEF_BankSlotStatusInd = { 56 | "BankSlotStatusInd", 57 | "BankSlotStatusInd", 58 | SEQUENCE_free, 59 | SEQUENCE_print, 60 | SEQUENCE_constraint, 61 | SEQUENCE_decode_ber, 62 | SEQUENCE_encode_der, 63 | SEQUENCE_decode_xer, 64 | SEQUENCE_encode_xer, 65 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 66 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 67 | 0, /* Use generic outmost tag fetcher */ 68 | asn_DEF_BankSlotStatusInd_tags_1, 69 | sizeof(asn_DEF_BankSlotStatusInd_tags_1) 70 | /sizeof(asn_DEF_BankSlotStatusInd_tags_1[0]), /* 1 */ 71 | asn_DEF_BankSlotStatusInd_tags_1, /* Same as above */ 72 | sizeof(asn_DEF_BankSlotStatusInd_tags_1) 73 | /sizeof(asn_DEF_BankSlotStatusInd_tags_1[0]), /* 1 */ 74 | 0, /* No PER visible constraints */ 75 | asn_MBR_BankSlotStatusInd_1, 76 | 3, /* Elements count */ 77 | &asn_SPC_BankSlotStatusInd_specs_1 /* Additional specs */ 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /src/rspro/ClientSlot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ClientSlot_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ClientSlot, clientId), 11 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 12 | 0, 13 | &asn_DEF_ClientId, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "clientId" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct ClientSlot, slotNr), 20 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 21 | 0, 22 | &asn_DEF_SlotNumber, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "slotNr" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_ClientSlot_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_ClientSlot_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* clientId */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* slotNr */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_ClientSlot_specs_1 = { 37 | sizeof(struct ClientSlot), 38 | offsetof(struct ClientSlot, _asn_ctx), 39 | asn_MAP_ClientSlot_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_ClientSlot = { 46 | "ClientSlot", 47 | "ClientSlot", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_ClientSlot_tags_1, 59 | sizeof(asn_DEF_ClientSlot_tags_1) 60 | /sizeof(asn_DEF_ClientSlot_tags_1[0]), /* 1 */ 61 | asn_DEF_ClientSlot_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_ClientSlot_tags_1) 63 | /sizeof(asn_DEF_ClientSlot_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_ClientSlot_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_ClientSlot_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/ClientSlotStatusInd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ClientSlotStatusInd_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ClientSlotStatusInd, fromClientSlot), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ClientSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "fromClientSlot" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct ClientSlotStatusInd, toBankSlot), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_BankSlot, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "toBankSlot" 27 | }, 28 | { ATF_NOFLAGS, 0, offsetof(struct ClientSlotStatusInd, slotPhysStatus), 29 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 30 | 0, 31 | &asn_DEF_SlotPhysStatus, 32 | 0, /* Defer constraints checking to the member type */ 33 | 0, /* PER is not compiled, use -gen-PER */ 34 | 0, 35 | "slotPhysStatus" 36 | }, 37 | }; 38 | static const ber_tlv_tag_t asn_DEF_ClientSlotStatusInd_tags_1[] = { 39 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 40 | }; 41 | static const asn_TYPE_tag2member_t asn_MAP_ClientSlotStatusInd_tag2el_1[] = { 42 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* fromClientSlot */ 43 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 1 }, /* toBankSlot */ 44 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 0 } /* slotPhysStatus */ 45 | }; 46 | static asn_SEQUENCE_specifics_t asn_SPC_ClientSlotStatusInd_specs_1 = { 47 | sizeof(struct ClientSlotStatusInd), 48 | offsetof(struct ClientSlotStatusInd, _asn_ctx), 49 | asn_MAP_ClientSlotStatusInd_tag2el_1, 50 | 3, /* Count of tags in the map */ 51 | 0, 0, 0, /* Optional elements (not needed) */ 52 | 2, /* Start extensions */ 53 | 4 /* Stop extensions */ 54 | }; 55 | asn_TYPE_descriptor_t asn_DEF_ClientSlotStatusInd = { 56 | "ClientSlotStatusInd", 57 | "ClientSlotStatusInd", 58 | SEQUENCE_free, 59 | SEQUENCE_print, 60 | SEQUENCE_constraint, 61 | SEQUENCE_decode_ber, 62 | SEQUENCE_encode_der, 63 | SEQUENCE_decode_xer, 64 | SEQUENCE_encode_xer, 65 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 66 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 67 | 0, /* Use generic outmost tag fetcher */ 68 | asn_DEF_ClientSlotStatusInd_tags_1, 69 | sizeof(asn_DEF_ClientSlotStatusInd_tags_1) 70 | /sizeof(asn_DEF_ClientSlotStatusInd_tags_1[0]), /* 1 */ 71 | asn_DEF_ClientSlotStatusInd_tags_1, /* Same as above */ 72 | sizeof(asn_DEF_ClientSlotStatusInd_tags_1) 73 | /sizeof(asn_DEF_ClientSlotStatusInd_tags_1[0]), /* 1 */ 74 | 0, /* No PER visible constraints */ 75 | asn_MBR_ClientSlotStatusInd_1, 76 | 3, /* Elements count */ 77 | &asn_SPC_ClientSlotStatusInd_specs_1 /* Additional specs */ 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /src/rspro/ConfigClientBankReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConfigClientBankReq_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConfigClientBankReq, bankSlot), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_BankSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "bankSlot" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct ConfigClientBankReq, bankd), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_IpPort, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "bankd" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_ConfigClientBankReq_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_ConfigClientBankReq_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* bankSlot */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* bankd */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientBankReq_specs_1 = { 37 | sizeof(struct ConfigClientBankReq), 38 | offsetof(struct ConfigClientBankReq, _asn_ctx), 39 | asn_MAP_ConfigClientBankReq_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_ConfigClientBankReq = { 46 | "ConfigClientBankReq", 47 | "ConfigClientBankReq", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_ConfigClientBankReq_tags_1, 59 | sizeof(asn_DEF_ConfigClientBankReq_tags_1) 60 | /sizeof(asn_DEF_ConfigClientBankReq_tags_1[0]), /* 1 */ 61 | asn_DEF_ConfigClientBankReq_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_ConfigClientBankReq_tags_1) 63 | /sizeof(asn_DEF_ConfigClientBankReq_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_ConfigClientBankReq_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_ConfigClientBankReq_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/ConfigClientBankRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConfigClientBankRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConfigClientBankRes, result), 11 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 12 | 0, 13 | &asn_DEF_ResultCode, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "result" 18 | }, 19 | }; 20 | static const ber_tlv_tag_t asn_DEF_ConfigClientBankRes_tags_1[] = { 21 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 22 | }; 23 | static const asn_TYPE_tag2member_t asn_MAP_ConfigClientBankRes_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */ 25 | }; 26 | static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientBankRes_specs_1 = { 27 | sizeof(struct ConfigClientBankRes), 28 | offsetof(struct ConfigClientBankRes, _asn_ctx), 29 | asn_MAP_ConfigClientBankRes_tag2el_1, 30 | 1, /* Count of tags in the map */ 31 | 0, 0, 0, /* Optional elements (not needed) */ 32 | 0, /* Start extensions */ 33 | 2 /* Stop extensions */ 34 | }; 35 | asn_TYPE_descriptor_t asn_DEF_ConfigClientBankRes = { 36 | "ConfigClientBankRes", 37 | "ConfigClientBankRes", 38 | SEQUENCE_free, 39 | SEQUENCE_print, 40 | SEQUENCE_constraint, 41 | SEQUENCE_decode_ber, 42 | SEQUENCE_encode_der, 43 | SEQUENCE_decode_xer, 44 | SEQUENCE_encode_xer, 45 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 46 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 47 | 0, /* Use generic outmost tag fetcher */ 48 | asn_DEF_ConfigClientBankRes_tags_1, 49 | sizeof(asn_DEF_ConfigClientBankRes_tags_1) 50 | /sizeof(asn_DEF_ConfigClientBankRes_tags_1[0]), /* 1 */ 51 | asn_DEF_ConfigClientBankRes_tags_1, /* Same as above */ 52 | sizeof(asn_DEF_ConfigClientBankRes_tags_1) 53 | /sizeof(asn_DEF_ConfigClientBankRes_tags_1[0]), /* 1 */ 54 | 0, /* No PER visible constraints */ 55 | asn_MBR_ConfigClientBankRes_1, 56 | 1, /* Elements count */ 57 | &asn_SPC_ConfigClientBankRes_specs_1 /* Additional specs */ 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /src/rspro/ConfigClientIdReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConfigClientIdReq_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConfigClientIdReq, clientSlot), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ClientSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "clientSlot" 18 | }, 19 | }; 20 | static const ber_tlv_tag_t asn_DEF_ConfigClientIdReq_tags_1[] = { 21 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 22 | }; 23 | static const asn_TYPE_tag2member_t asn_MAP_ConfigClientIdReq_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* clientSlot */ 25 | }; 26 | static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientIdReq_specs_1 = { 27 | sizeof(struct ConfigClientIdReq), 28 | offsetof(struct ConfigClientIdReq, _asn_ctx), 29 | asn_MAP_ConfigClientIdReq_tag2el_1, 30 | 1, /* Count of tags in the map */ 31 | 0, 0, 0, /* Optional elements (not needed) */ 32 | 0, /* Start extensions */ 33 | 2 /* Stop extensions */ 34 | }; 35 | asn_TYPE_descriptor_t asn_DEF_ConfigClientIdReq = { 36 | "ConfigClientIdReq", 37 | "ConfigClientIdReq", 38 | SEQUENCE_free, 39 | SEQUENCE_print, 40 | SEQUENCE_constraint, 41 | SEQUENCE_decode_ber, 42 | SEQUENCE_encode_der, 43 | SEQUENCE_decode_xer, 44 | SEQUENCE_encode_xer, 45 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 46 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 47 | 0, /* Use generic outmost tag fetcher */ 48 | asn_DEF_ConfigClientIdReq_tags_1, 49 | sizeof(asn_DEF_ConfigClientIdReq_tags_1) 50 | /sizeof(asn_DEF_ConfigClientIdReq_tags_1[0]), /* 1 */ 51 | asn_DEF_ConfigClientIdReq_tags_1, /* Same as above */ 52 | sizeof(asn_DEF_ConfigClientIdReq_tags_1) 53 | /sizeof(asn_DEF_ConfigClientIdReq_tags_1[0]), /* 1 */ 54 | 0, /* No PER visible constraints */ 55 | asn_MBR_ConfigClientIdReq_1, 56 | 1, /* Elements count */ 57 | &asn_SPC_ConfigClientIdReq_specs_1 /* Additional specs */ 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /src/rspro/ConfigClientIdRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConfigClientIdRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConfigClientIdRes, result), 11 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 12 | 0, 13 | &asn_DEF_ResultCode, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "result" 18 | }, 19 | }; 20 | static const ber_tlv_tag_t asn_DEF_ConfigClientIdRes_tags_1[] = { 21 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 22 | }; 23 | static const asn_TYPE_tag2member_t asn_MAP_ConfigClientIdRes_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */ 25 | }; 26 | static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientIdRes_specs_1 = { 27 | sizeof(struct ConfigClientIdRes), 28 | offsetof(struct ConfigClientIdRes, _asn_ctx), 29 | asn_MAP_ConfigClientIdRes_tag2el_1, 30 | 1, /* Count of tags in the map */ 31 | 0, 0, 0, /* Optional elements (not needed) */ 32 | 0, /* Start extensions */ 33 | 2 /* Stop extensions */ 34 | }; 35 | asn_TYPE_descriptor_t asn_DEF_ConfigClientIdRes = { 36 | "ConfigClientIdRes", 37 | "ConfigClientIdRes", 38 | SEQUENCE_free, 39 | SEQUENCE_print, 40 | SEQUENCE_constraint, 41 | SEQUENCE_decode_ber, 42 | SEQUENCE_encode_der, 43 | SEQUENCE_decode_xer, 44 | SEQUENCE_encode_xer, 45 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 46 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 47 | 0, /* Use generic outmost tag fetcher */ 48 | asn_DEF_ConfigClientIdRes_tags_1, 49 | sizeof(asn_DEF_ConfigClientIdRes_tags_1) 50 | /sizeof(asn_DEF_ConfigClientIdRes_tags_1[0]), /* 1 */ 51 | asn_DEF_ConfigClientIdRes_tags_1, /* Same as above */ 52 | sizeof(asn_DEF_ConfigClientIdRes_tags_1) 53 | /sizeof(asn_DEF_ConfigClientIdRes_tags_1[0]), /* 1 */ 54 | 0, /* No PER visible constraints */ 55 | asn_MBR_ConfigClientIdRes_1, 56 | 1, /* Elements count */ 57 | &asn_SPC_ConfigClientIdRes_specs_1 /* Additional specs */ 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /src/rspro/ConnectBankReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConnectBankReq_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConnectBankReq, identity), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ComponentIdentity, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "identity" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct ConnectBankReq, bankId), 20 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 21 | 0, 22 | &asn_DEF_BankId, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "bankId" 27 | }, 28 | { ATF_NOFLAGS, 0, offsetof(struct ConnectBankReq, numberOfSlots), 29 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 30 | 0, 31 | &asn_DEF_SlotNumber, 32 | 0, /* Defer constraints checking to the member type */ 33 | 0, /* PER is not compiled, use -gen-PER */ 34 | 0, 35 | "numberOfSlots" 36 | }, 37 | }; 38 | static const ber_tlv_tag_t asn_DEF_ConnectBankReq_tags_1[] = { 39 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 40 | }; 41 | static const asn_TYPE_tag2member_t asn_MAP_ConnectBankReq_tag2el_1[] = { 42 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 1 }, /* bankId */ 43 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* numberOfSlots */ 44 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* identity */ 45 | }; 46 | static asn_SEQUENCE_specifics_t asn_SPC_ConnectBankReq_specs_1 = { 47 | sizeof(struct ConnectBankReq), 48 | offsetof(struct ConnectBankReq, _asn_ctx), 49 | asn_MAP_ConnectBankReq_tag2el_1, 50 | 3, /* Count of tags in the map */ 51 | 0, 0, 0, /* Optional elements (not needed) */ 52 | 2, /* Start extensions */ 53 | 4 /* Stop extensions */ 54 | }; 55 | asn_TYPE_descriptor_t asn_DEF_ConnectBankReq = { 56 | "ConnectBankReq", 57 | "ConnectBankReq", 58 | SEQUENCE_free, 59 | SEQUENCE_print, 60 | SEQUENCE_constraint, 61 | SEQUENCE_decode_ber, 62 | SEQUENCE_encode_der, 63 | SEQUENCE_decode_xer, 64 | SEQUENCE_encode_xer, 65 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 66 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 67 | 0, /* Use generic outmost tag fetcher */ 68 | asn_DEF_ConnectBankReq_tags_1, 69 | sizeof(asn_DEF_ConnectBankReq_tags_1) 70 | /sizeof(asn_DEF_ConnectBankReq_tags_1[0]), /* 1 */ 71 | asn_DEF_ConnectBankReq_tags_1, /* Same as above */ 72 | sizeof(asn_DEF_ConnectBankReq_tags_1) 73 | /sizeof(asn_DEF_ConnectBankReq_tags_1[0]), /* 1 */ 74 | 0, /* No PER visible constraints */ 75 | asn_MBR_ConnectBankReq_1, 76 | 3, /* Elements count */ 77 | &asn_SPC_ConnectBankReq_specs_1 /* Additional specs */ 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /src/rspro/ConnectBankRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConnectBankRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConnectBankRes, identity), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ComponentIdentity, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "identity" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct ConnectBankRes, result), 20 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 21 | 0, 22 | &asn_DEF_ResultCode, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "result" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_ConnectBankRes_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_ConnectBankRes_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 }, /* result */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* identity */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_ConnectBankRes_specs_1 = { 37 | sizeof(struct ConnectBankRes), 38 | offsetof(struct ConnectBankRes, _asn_ctx), 39 | asn_MAP_ConnectBankRes_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_ConnectBankRes = { 46 | "ConnectBankRes", 47 | "ConnectBankRes", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_ConnectBankRes_tags_1, 59 | sizeof(asn_DEF_ConnectBankRes_tags_1) 60 | /sizeof(asn_DEF_ConnectBankRes_tags_1[0]), /* 1 */ 61 | asn_DEF_ConnectBankRes_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_ConnectBankRes_tags_1) 63 | /sizeof(asn_DEF_ConnectBankRes_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_ConnectBankRes_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_ConnectBankRes_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/ConnectClientReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConnectClientReq_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConnectClientReq, identity), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ComponentIdentity, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "identity" 18 | }, 19 | { ATF_POINTER, 1, offsetof(struct ConnectClientReq, clientSlot), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_ClientSlot, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "clientSlot" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_ConnectClientReq_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_ConnectClientReq_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* identity */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* clientSlot */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_ConnectClientReq_specs_1 = { 37 | sizeof(struct ConnectClientReq), 38 | offsetof(struct ConnectClientReq, _asn_ctx), 39 | asn_MAP_ConnectClientReq_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_ConnectClientReq = { 46 | "ConnectClientReq", 47 | "ConnectClientReq", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_ConnectClientReq_tags_1, 59 | sizeof(asn_DEF_ConnectClientReq_tags_1) 60 | /sizeof(asn_DEF_ConnectClientReq_tags_1[0]), /* 1 */ 61 | asn_DEF_ConnectClientReq_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_ConnectClientReq_tags_1) 63 | /sizeof(asn_DEF_ConnectClientReq_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_ConnectClientReq_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_ConnectClientReq_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/ConnectClientRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ConnectClientRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ConnectClientRes, identity), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ComponentIdentity, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "identity" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct ConnectClientRes, result), 20 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 21 | 0, 22 | &asn_DEF_ResultCode, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "result" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_ConnectClientRes_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_ConnectClientRes_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 }, /* result */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* identity */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_ConnectClientRes_specs_1 = { 37 | sizeof(struct ConnectClientRes), 38 | offsetof(struct ConnectClientRes, _asn_ctx), 39 | asn_MAP_ConnectClientRes_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_ConnectClientRes = { 46 | "ConnectClientRes", 47 | "ConnectClientRes", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_ConnectClientRes_tags_1, 59 | sizeof(asn_DEF_ConnectClientRes_tags_1) 60 | /sizeof(asn_DEF_ConnectClientRes_tags_1[0]), /* 1 */ 61 | asn_DEF_ConnectClientRes_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_ConnectClientRes_tags_1) 63 | /sizeof(asn_DEF_ConnectClientRes_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_ConnectClientRes_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_ConnectClientRes_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/CreateMappingReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_CreateMappingReq_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct CreateMappingReq, client), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ClientSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "client" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct CreateMappingReq, bank), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_BankSlot, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "bank" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_CreateMappingReq_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_CreateMappingReq_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* client */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* bank */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_CreateMappingReq_specs_1 = { 37 | sizeof(struct CreateMappingReq), 38 | offsetof(struct CreateMappingReq, _asn_ctx), 39 | asn_MAP_CreateMappingReq_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_CreateMappingReq = { 46 | "CreateMappingReq", 47 | "CreateMappingReq", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_CreateMappingReq_tags_1, 59 | sizeof(asn_DEF_CreateMappingReq_tags_1) 60 | /sizeof(asn_DEF_CreateMappingReq_tags_1[0]), /* 1 */ 61 | asn_DEF_CreateMappingReq_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_CreateMappingReq_tags_1) 63 | /sizeof(asn_DEF_CreateMappingReq_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_CreateMappingReq_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_CreateMappingReq_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/CreateMappingRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_CreateMappingRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct CreateMappingRes, result), 11 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 12 | 0, 13 | &asn_DEF_ResultCode, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "result" 18 | }, 19 | }; 20 | static const ber_tlv_tag_t asn_DEF_CreateMappingRes_tags_1[] = { 21 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 22 | }; 23 | static const asn_TYPE_tag2member_t asn_MAP_CreateMappingRes_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */ 25 | }; 26 | static asn_SEQUENCE_specifics_t asn_SPC_CreateMappingRes_specs_1 = { 27 | sizeof(struct CreateMappingRes), 28 | offsetof(struct CreateMappingRes, _asn_ctx), 29 | asn_MAP_CreateMappingRes_tag2el_1, 30 | 1, /* Count of tags in the map */ 31 | 0, 0, 0, /* Optional elements (not needed) */ 32 | 0, /* Start extensions */ 33 | 2 /* Stop extensions */ 34 | }; 35 | asn_TYPE_descriptor_t asn_DEF_CreateMappingRes = { 36 | "CreateMappingRes", 37 | "CreateMappingRes", 38 | SEQUENCE_free, 39 | SEQUENCE_print, 40 | SEQUENCE_constraint, 41 | SEQUENCE_decode_ber, 42 | SEQUENCE_encode_der, 43 | SEQUENCE_decode_xer, 44 | SEQUENCE_encode_xer, 45 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 46 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 47 | 0, /* Use generic outmost tag fetcher */ 48 | asn_DEF_CreateMappingRes_tags_1, 49 | sizeof(asn_DEF_CreateMappingRes_tags_1) 50 | /sizeof(asn_DEF_CreateMappingRes_tags_1[0]), /* 1 */ 51 | asn_DEF_CreateMappingRes_tags_1, /* Same as above */ 52 | sizeof(asn_DEF_CreateMappingRes_tags_1) 53 | /sizeof(asn_DEF_CreateMappingRes_tags_1[0]), /* 1 */ 54 | 0, /* No PER visible constraints */ 55 | asn_MBR_CreateMappingRes_1, 56 | 1, /* Elements count */ 57 | &asn_SPC_CreateMappingRes_specs_1 /* Additional specs */ 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /src/rspro/IA5String.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #include 6 | #include 7 | 8 | /* 9 | * IA5String basic type description. 10 | */ 11 | static const ber_tlv_tag_t asn_DEF_IA5String_tags[] = { 12 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/ 13 | (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ 14 | }; 15 | static asn_per_constraints_t asn_DEF_IA5String_constraints = { 16 | { APC_CONSTRAINED, 7, 7, 0, 0x7f }, /* Value */ 17 | { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 18 | 0, 0 19 | }; 20 | asn_TYPE_descriptor_t asn_DEF_IA5String = { 21 | "IA5String", 22 | "IA5String", 23 | OCTET_STRING_free, 24 | OCTET_STRING_print_utf8, /* ASCII subset */ 25 | IA5String_constraint, /* Constraint on the alphabet */ 26 | OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */ 27 | OCTET_STRING_encode_der, 28 | OCTET_STRING_decode_xer_utf8, 29 | OCTET_STRING_encode_xer_utf8, 30 | OCTET_STRING_decode_uper, 31 | OCTET_STRING_encode_uper, 32 | OCTET_STRING_decode_aper, 33 | OCTET_STRING_encode_aper, 34 | 0, /* Use generic outmost tag fetcher */ 35 | asn_DEF_IA5String_tags, 36 | sizeof(asn_DEF_IA5String_tags) 37 | / sizeof(asn_DEF_IA5String_tags[0]) - 1, 38 | asn_DEF_IA5String_tags, 39 | sizeof(asn_DEF_IA5String_tags) 40 | / sizeof(asn_DEF_IA5String_tags[0]), 41 | &asn_DEF_IA5String_constraints, 42 | 0, 0, /* No members */ 43 | 0 /* No specifics */ 44 | }; 45 | 46 | int 47 | IA5String_constraint(asn_TYPE_descriptor_t *td, const void *sptr, 48 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { 49 | const IA5String_t *st = (const IA5String_t *)sptr; 50 | 51 | if(st && st->buf) { 52 | uint8_t *buf = st->buf; 53 | uint8_t *end = buf + st->size; 54 | /* 55 | * IA5String is generally equivalent to 7bit ASCII. 56 | * ISO/ITU-T T.50, 1963. 57 | */ 58 | for(; buf < end; buf++) { 59 | if(*buf > 0x7F) { 60 | _ASN_CTFAIL(app_key, td, sptr, 61 | "%s: value byte %ld out of range: " 62 | "%d > 127 (%s:%d)", 63 | td->name, 64 | (long)((buf - st->buf) + 1), 65 | *buf, 66 | __FILE__, __LINE__); 67 | return -1; 68 | } 69 | } 70 | } else { 71 | _ASN_CTFAIL(app_key, td, sptr, 72 | "%s: value not given (%s:%d)", 73 | td->name, __FILE__, __LINE__); 74 | return -1; 75 | } 76 | 77 | return 0; 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/rspro/IpAddress.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_IpAddress_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct IpAddress, choice.ipv4), 11 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 12 | -1, /* IMPLICIT tag at current level */ 13 | &asn_DEF_Ipv4Address, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "ipv4" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct IpAddress, choice.ipv6), 20 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 21 | -1, /* IMPLICIT tag at current level */ 22 | &asn_DEF_Ipv6Address, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "ipv6" 27 | }, 28 | }; 29 | static const asn_TYPE_tag2member_t asn_MAP_IpAddress_tag2el_1[] = { 30 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ipv4 */ 31 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ipv6 */ 32 | }; 33 | static asn_CHOICE_specifics_t asn_SPC_IpAddress_specs_1 = { 34 | sizeof(struct IpAddress), 35 | offsetof(struct IpAddress, _asn_ctx), 36 | offsetof(struct IpAddress, present), 37 | sizeof(((struct IpAddress *)0)->present), 38 | asn_MAP_IpAddress_tag2el_1, 39 | 2, /* Count of tags in the map */ 40 | 0, 41 | -1 /* Extensions start */ 42 | }; 43 | asn_TYPE_descriptor_t asn_DEF_IpAddress = { 44 | "IpAddress", 45 | "IpAddress", 46 | CHOICE_free, 47 | CHOICE_print, 48 | CHOICE_constraint, 49 | CHOICE_decode_ber, 50 | CHOICE_encode_der, 51 | CHOICE_decode_xer, 52 | CHOICE_encode_xer, 53 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 54 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 55 | CHOICE_outmost_tag, 56 | 0, /* No effective tags (pointer) */ 57 | 0, /* No effective tags (count) */ 58 | 0, /* No tags (pointer) */ 59 | 0, /* No tags (count) */ 60 | 0, /* No PER visible constraints */ 61 | asn_MBR_IpAddress_1, 62 | 2, /* Elements count */ 63 | &asn_SPC_IpAddress_specs_1 /* Additional specs */ 64 | }; 65 | 66 | -------------------------------------------------------------------------------- /src/rspro/IpPort.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_IpPort_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct IpPort, ip), 11 | -1 /* Ambiguous tag (CHOICE?) */, 12 | 0, 13 | &asn_DEF_IpAddress, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "ip" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct IpPort, port), 20 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 21 | 0, 22 | &asn_DEF_PortNumber, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "port" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_IpPort_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_IpPort_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* port */ 34 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ipv4 */ 35 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 } /* ipv6 */ 36 | }; 37 | static asn_SEQUENCE_specifics_t asn_SPC_IpPort_specs_1 = { 38 | sizeof(struct IpPort), 39 | offsetof(struct IpPort, _asn_ctx), 40 | asn_MAP_IpPort_tag2el_1, 41 | 3, /* Count of tags in the map */ 42 | 0, 0, 0, /* Optional elements (not needed) */ 43 | -1, /* Start extensions */ 44 | -1 /* Stop extensions */ 45 | }; 46 | asn_TYPE_descriptor_t asn_DEF_IpPort = { 47 | "IpPort", 48 | "IpPort", 49 | SEQUENCE_free, 50 | SEQUENCE_print, 51 | SEQUENCE_constraint, 52 | SEQUENCE_decode_ber, 53 | SEQUENCE_encode_der, 54 | SEQUENCE_decode_xer, 55 | SEQUENCE_encode_xer, 56 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 57 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 58 | 0, /* Use generic outmost tag fetcher */ 59 | asn_DEF_IpPort_tags_1, 60 | sizeof(asn_DEF_IpPort_tags_1) 61 | /sizeof(asn_DEF_IpPort_tags_1[0]), /* 1 */ 62 | asn_DEF_IpPort_tags_1, /* Same as above */ 63 | sizeof(asn_DEF_IpPort_tags_1) 64 | /sizeof(asn_DEF_IpPort_tags_1[0]), /* 1 */ 65 | 0, /* No PER visible constraints */ 66 | asn_MBR_IpPort_1, 67 | 2, /* Elements count */ 68 | &asn_SPC_IpPort_specs_1 /* Additional specs */ 69 | }; 70 | 71 | -------------------------------------------------------------------------------- /src/rspro/RemoveMappingReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_RemoveMappingReq_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct RemoveMappingReq, client), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ClientSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "client" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct RemoveMappingReq, bank), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_BankSlot, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "bank" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_RemoveMappingReq_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_RemoveMappingReq_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* client */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* bank */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_RemoveMappingReq_specs_1 = { 37 | sizeof(struct RemoveMappingReq), 38 | offsetof(struct RemoveMappingReq, _asn_ctx), 39 | asn_MAP_RemoveMappingReq_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_RemoveMappingReq = { 46 | "RemoveMappingReq", 47 | "RemoveMappingReq", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_RemoveMappingReq_tags_1, 59 | sizeof(asn_DEF_RemoveMappingReq_tags_1) 60 | /sizeof(asn_DEF_RemoveMappingReq_tags_1[0]), /* 1 */ 61 | asn_DEF_RemoveMappingReq_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_RemoveMappingReq_tags_1) 63 | /sizeof(asn_DEF_RemoveMappingReq_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_RemoveMappingReq_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_RemoveMappingReq_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/RemoveMappingRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_RemoveMappingRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct RemoveMappingRes, result), 11 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 12 | 0, 13 | &asn_DEF_ResultCode, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "result" 18 | }, 19 | }; 20 | static const ber_tlv_tag_t asn_DEF_RemoveMappingRes_tags_1[] = { 21 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 22 | }; 23 | static const asn_TYPE_tag2member_t asn_MAP_RemoveMappingRes_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */ 25 | }; 26 | static asn_SEQUENCE_specifics_t asn_SPC_RemoveMappingRes_specs_1 = { 27 | sizeof(struct RemoveMappingRes), 28 | offsetof(struct RemoveMappingRes, _asn_ctx), 29 | asn_MAP_RemoveMappingRes_tag2el_1, 30 | 1, /* Count of tags in the map */ 31 | 0, 0, 0, /* Optional elements (not needed) */ 32 | 0, /* Start extensions */ 33 | 2 /* Stop extensions */ 34 | }; 35 | asn_TYPE_descriptor_t asn_DEF_RemoveMappingRes = { 36 | "RemoveMappingRes", 37 | "RemoveMappingRes", 38 | SEQUENCE_free, 39 | SEQUENCE_print, 40 | SEQUENCE_constraint, 41 | SEQUENCE_decode_ber, 42 | SEQUENCE_encode_der, 43 | SEQUENCE_decode_xer, 44 | SEQUENCE_encode_xer, 45 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 46 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 47 | 0, /* Use generic outmost tag fetcher */ 48 | asn_DEF_RemoveMappingRes_tags_1, 49 | sizeof(asn_DEF_RemoveMappingRes_tags_1) 50 | /sizeof(asn_DEF_RemoveMappingRes_tags_1[0]), /* 1 */ 51 | asn_DEF_RemoveMappingRes_tags_1, /* Same as above */ 52 | sizeof(asn_DEF_RemoveMappingRes_tags_1) 53 | /sizeof(asn_DEF_RemoveMappingRes_tags_1[0]), /* 1 */ 54 | 0, /* No PER visible constraints */ 55 | asn_MBR_RemoveMappingRes_1, 56 | 1, /* Elements count */ 57 | &asn_SPC_RemoveMappingRes_specs_1 /* Additional specs */ 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /src/rspro/ResetStateReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static const ber_tlv_tag_t asn_DEF_ResetStateReq_tags_1[] = { 10 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 11 | }; 12 | static asn_SEQUENCE_specifics_t asn_SPC_ResetStateReq_specs_1 = { 13 | sizeof(struct ResetStateReq), 14 | offsetof(struct ResetStateReq, _asn_ctx), 15 | 0, /* No top level tags */ 16 | 0, /* No tags in the map */ 17 | 0, 0, 0, /* Optional elements (not needed) */ 18 | -1, /* Start extensions */ 19 | -1 /* Stop extensions */ 20 | }; 21 | asn_TYPE_descriptor_t asn_DEF_ResetStateReq = { 22 | "ResetStateReq", 23 | "ResetStateReq", 24 | SEQUENCE_free, 25 | SEQUENCE_print, 26 | SEQUENCE_constraint, 27 | SEQUENCE_decode_ber, 28 | SEQUENCE_encode_der, 29 | SEQUENCE_decode_xer, 30 | SEQUENCE_encode_xer, 31 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 32 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 33 | 0, /* Use generic outmost tag fetcher */ 34 | asn_DEF_ResetStateReq_tags_1, 35 | sizeof(asn_DEF_ResetStateReq_tags_1) 36 | /sizeof(asn_DEF_ResetStateReq_tags_1[0]), /* 1 */ 37 | asn_DEF_ResetStateReq_tags_1, /* Same as above */ 38 | sizeof(asn_DEF_ResetStateReq_tags_1) 39 | /sizeof(asn_DEF_ResetStateReq_tags_1[0]), /* 1 */ 40 | 0, /* No PER visible constraints */ 41 | 0, 0, /* No members */ 42 | &asn_SPC_ResetStateReq_specs_1 /* Additional specs */ 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /src/rspro/ResetStateRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_ResetStateRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct ResetStateRes, result), 11 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 12 | 0, 13 | &asn_DEF_ResultCode, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "result" 18 | }, 19 | }; 20 | static const ber_tlv_tag_t asn_DEF_ResetStateRes_tags_1[] = { 21 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 22 | }; 23 | static const asn_TYPE_tag2member_t asn_MAP_ResetStateRes_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */ 25 | }; 26 | static asn_SEQUENCE_specifics_t asn_SPC_ResetStateRes_specs_1 = { 27 | sizeof(struct ResetStateRes), 28 | offsetof(struct ResetStateRes, _asn_ctx), 29 | asn_MAP_ResetStateRes_tag2el_1, 30 | 1, /* Count of tags in the map */ 31 | 0, 0, 0, /* Optional elements (not needed) */ 32 | 0, /* Start extensions */ 33 | 2 /* Stop extensions */ 34 | }; 35 | asn_TYPE_descriptor_t asn_DEF_ResetStateRes = { 36 | "ResetStateRes", 37 | "ResetStateRes", 38 | SEQUENCE_free, 39 | SEQUENCE_print, 40 | SEQUENCE_constraint, 41 | SEQUENCE_decode_ber, 42 | SEQUENCE_encode_der, 43 | SEQUENCE_decode_xer, 44 | SEQUENCE_encode_xer, 45 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 46 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 47 | 0, /* Use generic outmost tag fetcher */ 48 | asn_DEF_ResetStateRes_tags_1, 49 | sizeof(asn_DEF_ResetStateRes_tags_1) 50 | /sizeof(asn_DEF_ResetStateRes_tags_1[0]), /* 1 */ 51 | asn_DEF_ResetStateRes_tags_1, /* Same as above */ 52 | sizeof(asn_DEF_ResetStateRes_tags_1) 53 | /sizeof(asn_DEF_ResetStateRes_tags_1[0]), /* 1 */ 54 | 0, /* No PER visible constraints */ 55 | asn_MBR_ResetStateRes_1, 56 | 1, /* Elements count */ 57 | &asn_SPC_ResetStateRes_specs_1 /* Additional specs */ 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /src/rspro/SetAtrReq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_SetAtrReq_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct SetAtrReq, slot), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ClientSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "slot" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct SetAtrReq, atr), 20 | (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 21 | 0, 22 | &asn_DEF_ATR, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "atr" 27 | }, 28 | }; 29 | static const ber_tlv_tag_t asn_DEF_SetAtrReq_tags_1[] = { 30 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 31 | }; 32 | static const asn_TYPE_tag2member_t asn_MAP_SetAtrReq_tag2el_1[] = { 33 | { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* atr */ 34 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* slot */ 35 | }; 36 | static asn_SEQUENCE_specifics_t asn_SPC_SetAtrReq_specs_1 = { 37 | sizeof(struct SetAtrReq), 38 | offsetof(struct SetAtrReq, _asn_ctx), 39 | asn_MAP_SetAtrReq_tag2el_1, 40 | 2, /* Count of tags in the map */ 41 | 0, 0, 0, /* Optional elements (not needed) */ 42 | 1, /* Start extensions */ 43 | 3 /* Stop extensions */ 44 | }; 45 | asn_TYPE_descriptor_t asn_DEF_SetAtrReq = { 46 | "SetAtrReq", 47 | "SetAtrReq", 48 | SEQUENCE_free, 49 | SEQUENCE_print, 50 | SEQUENCE_constraint, 51 | SEQUENCE_decode_ber, 52 | SEQUENCE_encode_der, 53 | SEQUENCE_decode_xer, 54 | SEQUENCE_encode_xer, 55 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 56 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 57 | 0, /* Use generic outmost tag fetcher */ 58 | asn_DEF_SetAtrReq_tags_1, 59 | sizeof(asn_DEF_SetAtrReq_tags_1) 60 | /sizeof(asn_DEF_SetAtrReq_tags_1[0]), /* 1 */ 61 | asn_DEF_SetAtrReq_tags_1, /* Same as above */ 62 | sizeof(asn_DEF_SetAtrReq_tags_1) 63 | /sizeof(asn_DEF_SetAtrReq_tags_1[0]), /* 1 */ 64 | 0, /* No PER visible constraints */ 65 | asn_MBR_SetAtrReq_1, 66 | 2, /* Elements count */ 67 | &asn_SPC_SetAtrReq_specs_1 /* Additional specs */ 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /src/rspro/SetAtrRes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_SetAtrRes_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct SetAtrRes, result), 11 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 12 | 0, 13 | &asn_DEF_ResultCode, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "result" 18 | }, 19 | }; 20 | static const ber_tlv_tag_t asn_DEF_SetAtrRes_tags_1[] = { 21 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 22 | }; 23 | static const asn_TYPE_tag2member_t asn_MAP_SetAtrRes_tag2el_1[] = { 24 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */ 25 | }; 26 | static asn_SEQUENCE_specifics_t asn_SPC_SetAtrRes_specs_1 = { 27 | sizeof(struct SetAtrRes), 28 | offsetof(struct SetAtrRes, _asn_ctx), 29 | asn_MAP_SetAtrRes_tag2el_1, 30 | 1, /* Count of tags in the map */ 31 | 0, 0, 0, /* Optional elements (not needed) */ 32 | 0, /* Start extensions */ 33 | 2 /* Stop extensions */ 34 | }; 35 | asn_TYPE_descriptor_t asn_DEF_SetAtrRes = { 36 | "SetAtrRes", 37 | "SetAtrRes", 38 | SEQUENCE_free, 39 | SEQUENCE_print, 40 | SEQUENCE_constraint, 41 | SEQUENCE_decode_ber, 42 | SEQUENCE_encode_der, 43 | SEQUENCE_decode_xer, 44 | SEQUENCE_encode_xer, 45 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 46 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 47 | 0, /* Use generic outmost tag fetcher */ 48 | asn_DEF_SetAtrRes_tags_1, 49 | sizeof(asn_DEF_SetAtrRes_tags_1) 50 | /sizeof(asn_DEF_SetAtrRes_tags_1[0]), /* 1 */ 51 | asn_DEF_SetAtrRes_tags_1, /* Same as above */ 52 | sizeof(asn_DEF_SetAtrRes_tags_1) 53 | /sizeof(asn_DEF_SetAtrRes_tags_1[0]), /* 1 */ 54 | 0, /* No PER visible constraints */ 55 | asn_MBR_SetAtrRes_1, 56 | 1, /* Elements count */ 57 | &asn_SPC_SetAtrRes_specs_1 /* Additional specs */ 58 | }; 59 | 60 | -------------------------------------------------------------------------------- /src/rspro/SlotPhysStatus.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_SlotPhysStatus_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct SlotPhysStatus, resetActive), 11 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 12 | -1, /* IMPLICIT tag at current level */ 13 | &asn_DEF_BOOLEAN, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "resetActive" 18 | }, 19 | { ATF_POINTER, 3, offsetof(struct SlotPhysStatus, vccPresent), 20 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 21 | -1, /* IMPLICIT tag at current level */ 22 | &asn_DEF_BOOLEAN, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "vccPresent" 27 | }, 28 | { ATF_POINTER, 2, offsetof(struct SlotPhysStatus, clkActive), 29 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 30 | -1, /* IMPLICIT tag at current level */ 31 | &asn_DEF_BOOLEAN, 32 | 0, /* Defer constraints checking to the member type */ 33 | 0, /* PER is not compiled, use -gen-PER */ 34 | 0, 35 | "clkActive" 36 | }, 37 | { ATF_POINTER, 1, offsetof(struct SlotPhysStatus, cardPresent), 38 | (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 39 | -1, /* IMPLICIT tag at current level */ 40 | &asn_DEF_BOOLEAN, 41 | 0, /* Defer constraints checking to the member type */ 42 | 0, /* PER is not compiled, use -gen-PER */ 43 | 0, 44 | "cardPresent" 45 | }, 46 | }; 47 | static const ber_tlv_tag_t asn_DEF_SlotPhysStatus_tags_1[] = { 48 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 49 | }; 50 | static const asn_TYPE_tag2member_t asn_MAP_SlotPhysStatus_tag2el_1[] = { 51 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* resetActive */ 52 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* vccPresent */ 53 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* clkActive */ 54 | { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* cardPresent */ 55 | }; 56 | static asn_SEQUENCE_specifics_t asn_SPC_SlotPhysStatus_specs_1 = { 57 | sizeof(struct SlotPhysStatus), 58 | offsetof(struct SlotPhysStatus, _asn_ctx), 59 | asn_MAP_SlotPhysStatus_tag2el_1, 60 | 4, /* Count of tags in the map */ 61 | 0, 0, 0, /* Optional elements (not needed) */ 62 | 3, /* Start extensions */ 63 | 5 /* Stop extensions */ 64 | }; 65 | asn_TYPE_descriptor_t asn_DEF_SlotPhysStatus = { 66 | "SlotPhysStatus", 67 | "SlotPhysStatus", 68 | SEQUENCE_free, 69 | SEQUENCE_print, 70 | SEQUENCE_constraint, 71 | SEQUENCE_decode_ber, 72 | SEQUENCE_encode_der, 73 | SEQUENCE_decode_xer, 74 | SEQUENCE_encode_xer, 75 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 76 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 77 | 0, /* Use generic outmost tag fetcher */ 78 | asn_DEF_SlotPhysStatus_tags_1, 79 | sizeof(asn_DEF_SlotPhysStatus_tags_1) 80 | /sizeof(asn_DEF_SlotPhysStatus_tags_1[0]), /* 1 */ 81 | asn_DEF_SlotPhysStatus_tags_1, /* Same as above */ 82 | sizeof(asn_DEF_SlotPhysStatus_tags_1) 83 | /sizeof(asn_DEF_SlotPhysStatus_tags_1[0]), /* 1 */ 84 | 0, /* No PER visible constraints */ 85 | asn_MBR_SlotPhysStatus_1, 86 | 4, /* Elements count */ 87 | &asn_SPC_SlotPhysStatus_specs_1 /* Additional specs */ 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /src/rspro/TpduCardToModem.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_TpduCardToModem_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct TpduCardToModem, fromBankSlot), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_BankSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "fromBankSlot" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct TpduCardToModem, toClientSlot), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_ClientSlot, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "toClientSlot" 27 | }, 28 | { ATF_NOFLAGS, 0, offsetof(struct TpduCardToModem, flags), 29 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 30 | 0, 31 | &asn_DEF_TpduFlags, 32 | 0, /* Defer constraints checking to the member type */ 33 | 0, /* PER is not compiled, use -gen-PER */ 34 | 0, 35 | "flags" 36 | }, 37 | { ATF_NOFLAGS, 0, offsetof(struct TpduCardToModem, data), 38 | (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 39 | 0, 40 | &asn_DEF_OCTET_STRING, 41 | 0, /* Defer constraints checking to the member type */ 42 | 0, /* PER is not compiled, use -gen-PER */ 43 | 0, 44 | "data" 45 | }, 46 | }; 47 | static const ber_tlv_tag_t asn_DEF_TpduCardToModem_tags_1[] = { 48 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 49 | }; 50 | static const asn_TYPE_tag2member_t asn_MAP_TpduCardToModem_tag2el_1[] = { 51 | { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 3, 0, 0 }, /* data */ 52 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* fromBankSlot */ 53 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 1 }, /* toClientSlot */ 54 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 0 } /* flags */ 55 | }; 56 | static asn_SEQUENCE_specifics_t asn_SPC_TpduCardToModem_specs_1 = { 57 | sizeof(struct TpduCardToModem), 58 | offsetof(struct TpduCardToModem, _asn_ctx), 59 | asn_MAP_TpduCardToModem_tag2el_1, 60 | 4, /* Count of tags in the map */ 61 | 0, 0, 0, /* Optional elements (not needed) */ 62 | 3, /* Start extensions */ 63 | 5 /* Stop extensions */ 64 | }; 65 | asn_TYPE_descriptor_t asn_DEF_TpduCardToModem = { 66 | "TpduCardToModem", 67 | "TpduCardToModem", 68 | SEQUENCE_free, 69 | SEQUENCE_print, 70 | SEQUENCE_constraint, 71 | SEQUENCE_decode_ber, 72 | SEQUENCE_encode_der, 73 | SEQUENCE_decode_xer, 74 | SEQUENCE_encode_xer, 75 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 76 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 77 | 0, /* Use generic outmost tag fetcher */ 78 | asn_DEF_TpduCardToModem_tags_1, 79 | sizeof(asn_DEF_TpduCardToModem_tags_1) 80 | /sizeof(asn_DEF_TpduCardToModem_tags_1[0]), /* 1 */ 81 | asn_DEF_TpduCardToModem_tags_1, /* Same as above */ 82 | sizeof(asn_DEF_TpduCardToModem_tags_1) 83 | /sizeof(asn_DEF_TpduCardToModem_tags_1[0]), /* 1 */ 84 | 0, /* No PER visible constraints */ 85 | asn_MBR_TpduCardToModem_1, 86 | 4, /* Elements count */ 87 | &asn_SPC_TpduCardToModem_specs_1 /* Additional specs */ 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /src/rspro/TpduFlags.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_TpduFlags_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct TpduFlags, tpduHeaderPresent), 11 | (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 12 | 0, 13 | &asn_DEF_BOOLEAN, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "tpduHeaderPresent" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct TpduFlags, finalPart), 20 | (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 21 | 0, 22 | &asn_DEF_BOOLEAN, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "finalPart" 27 | }, 28 | { ATF_NOFLAGS, 0, offsetof(struct TpduFlags, procByteContinueTx), 29 | (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 30 | 0, 31 | &asn_DEF_BOOLEAN, 32 | 0, /* Defer constraints checking to the member type */ 33 | 0, /* PER is not compiled, use -gen-PER */ 34 | 0, 35 | "procByteContinueTx" 36 | }, 37 | { ATF_NOFLAGS, 0, offsetof(struct TpduFlags, procByteContinueRx), 38 | (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 39 | 0, 40 | &asn_DEF_BOOLEAN, 41 | 0, /* Defer constraints checking to the member type */ 42 | 0, /* PER is not compiled, use -gen-PER */ 43 | 0, 44 | "procByteContinueRx" 45 | }, 46 | }; 47 | static const ber_tlv_tag_t asn_DEF_TpduFlags_tags_1[] = { 48 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 49 | }; 50 | static const asn_TYPE_tag2member_t asn_MAP_TpduFlags_tag2el_1[] = { 51 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 3 }, /* tpduHeaderPresent */ 52 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, -1, 2 }, /* finalPart */ 53 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 2, -2, 1 }, /* procByteContinueTx */ 54 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, -3, 0 } /* procByteContinueRx */ 55 | }; 56 | static asn_SEQUENCE_specifics_t asn_SPC_TpduFlags_specs_1 = { 57 | sizeof(struct TpduFlags), 58 | offsetof(struct TpduFlags, _asn_ctx), 59 | asn_MAP_TpduFlags_tag2el_1, 60 | 4, /* Count of tags in the map */ 61 | 0, 0, 0, /* Optional elements (not needed) */ 62 | 3, /* Start extensions */ 63 | 5 /* Stop extensions */ 64 | }; 65 | asn_TYPE_descriptor_t asn_DEF_TpduFlags = { 66 | "TpduFlags", 67 | "TpduFlags", 68 | SEQUENCE_free, 69 | SEQUENCE_print, 70 | SEQUENCE_constraint, 71 | SEQUENCE_decode_ber, 72 | SEQUENCE_encode_der, 73 | SEQUENCE_decode_xer, 74 | SEQUENCE_encode_xer, 75 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 76 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 77 | 0, /* Use generic outmost tag fetcher */ 78 | asn_DEF_TpduFlags_tags_1, 79 | sizeof(asn_DEF_TpduFlags_tags_1) 80 | /sizeof(asn_DEF_TpduFlags_tags_1[0]), /* 1 */ 81 | asn_DEF_TpduFlags_tags_1, /* Same as above */ 82 | sizeof(asn_DEF_TpduFlags_tags_1) 83 | /sizeof(asn_DEF_TpduFlags_tags_1[0]), /* 1 */ 84 | 0, /* No PER visible constraints */ 85 | asn_MBR_TpduFlags_1, 86 | 4, /* Elements count */ 87 | &asn_SPC_TpduFlags_specs_1 /* Additional specs */ 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /src/rspro/TpduModemToCard.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 3 | * From ASN.1 module "RSPRO" 4 | * found in "../../asn1/RSPRO.asn" 5 | */ 6 | 7 | #include 8 | 9 | static asn_TYPE_member_t asn_MBR_TpduModemToCard_1[] = { 10 | { ATF_NOFLAGS, 0, offsetof(struct TpduModemToCard, fromClientSlot), 11 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 12 | 0, 13 | &asn_DEF_ClientSlot, 14 | 0, /* Defer constraints checking to the member type */ 15 | 0, /* PER is not compiled, use -gen-PER */ 16 | 0, 17 | "fromClientSlot" 18 | }, 19 | { ATF_NOFLAGS, 0, offsetof(struct TpduModemToCard, toBankSlot), 20 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 21 | 0, 22 | &asn_DEF_BankSlot, 23 | 0, /* Defer constraints checking to the member type */ 24 | 0, /* PER is not compiled, use -gen-PER */ 25 | 0, 26 | "toBankSlot" 27 | }, 28 | { ATF_NOFLAGS, 0, offsetof(struct TpduModemToCard, flags), 29 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 30 | 0, 31 | &asn_DEF_TpduFlags, 32 | 0, /* Defer constraints checking to the member type */ 33 | 0, /* PER is not compiled, use -gen-PER */ 34 | 0, 35 | "flags" 36 | }, 37 | { ATF_NOFLAGS, 0, offsetof(struct TpduModemToCard, data), 38 | (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 39 | 0, 40 | &asn_DEF_OCTET_STRING, 41 | 0, /* Defer constraints checking to the member type */ 42 | 0, /* PER is not compiled, use -gen-PER */ 43 | 0, 44 | "data" 45 | }, 46 | }; 47 | static const ber_tlv_tag_t asn_DEF_TpduModemToCard_tags_1[] = { 48 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) 49 | }; 50 | static const asn_TYPE_tag2member_t asn_MAP_TpduModemToCard_tag2el_1[] = { 51 | { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 3, 0, 0 }, /* data */ 52 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 2 }, /* fromClientSlot */ 53 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 1 }, /* toBankSlot */ 54 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, -2, 0 } /* flags */ 55 | }; 56 | static asn_SEQUENCE_specifics_t asn_SPC_TpduModemToCard_specs_1 = { 57 | sizeof(struct TpduModemToCard), 58 | offsetof(struct TpduModemToCard, _asn_ctx), 59 | asn_MAP_TpduModemToCard_tag2el_1, 60 | 4, /* Count of tags in the map */ 61 | 0, 0, 0, /* Optional elements (not needed) */ 62 | 3, /* Start extensions */ 63 | 5 /* Stop extensions */ 64 | }; 65 | asn_TYPE_descriptor_t asn_DEF_TpduModemToCard = { 66 | "TpduModemToCard", 67 | "TpduModemToCard", 68 | SEQUENCE_free, 69 | SEQUENCE_print, 70 | SEQUENCE_constraint, 71 | SEQUENCE_decode_ber, 72 | SEQUENCE_encode_der, 73 | SEQUENCE_decode_xer, 74 | SEQUENCE_encode_xer, 75 | 0, 0, /* No UPER support, use "-gen-PER" to enable */ 76 | 0, 0, /* No APER support, use "-gen-PER" to enable */ 77 | 0, /* Use generic outmost tag fetcher */ 78 | asn_DEF_TpduModemToCard_tags_1, 79 | sizeof(asn_DEF_TpduModemToCard_tags_1) 80 | /sizeof(asn_DEF_TpduModemToCard_tags_1[0]), /* 1 */ 81 | asn_DEF_TpduModemToCard_tags_1, /* Same as above */ 82 | sizeof(asn_DEF_TpduModemToCard_tags_1) 83 | /sizeof(asn_DEF_TpduModemToCard_tags_1[0]), /* 1 */ 84 | 0, /* No PER visible constraints */ 85 | asn_MBR_TpduModemToCard_1, 86 | 4, /* Elements count */ 87 | &asn_SPC_TpduModemToCard_specs_1 /* Additional specs */ 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /src/rspro/constr_TYPE.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | /* 10 | * Version of the ASN.1 infrastructure shipped with compiler. 11 | */ 12 | int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; } 13 | 14 | static asn_app_consume_bytes_f _print2fp; 15 | 16 | /* 17 | * Return the outmost tag of the type. 18 | */ 19 | ber_tlv_tag_t 20 | asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor, 21 | const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) { 22 | 23 | if(tag_mode) 24 | return tag; 25 | 26 | if(type_descriptor->tags_count) 27 | return type_descriptor->tags[0]; 28 | 29 | return type_descriptor->outmost_tag(type_descriptor, struct_ptr, 0, 0); 30 | } 31 | 32 | /* 33 | * Print the target language's structure in human readable form. 34 | */ 35 | int 36 | asn_fprint(FILE *stream, asn_TYPE_descriptor_t *td, const void *struct_ptr) { 37 | if(!stream) stream = stdout; 38 | if(!td || !struct_ptr) { 39 | errno = EINVAL; 40 | return -1; 41 | } 42 | 43 | /* Invoke type-specific printer */ 44 | if(td->print_struct(td, struct_ptr, 1, _print2fp, stream)) 45 | return -1; 46 | 47 | /* Terminate the output */ 48 | if(_print2fp("\n", 1, stream)) 49 | return -1; 50 | 51 | return fflush(stream); 52 | } 53 | 54 | /* Dump the data into the specified stdio stream */ 55 | static int 56 | _print2fp(const void *buffer, size_t size, void *app_key) { 57 | FILE *stream = (FILE *)app_key; 58 | 59 | if(fwrite(buffer, 1, size, stream) != size) 60 | return -1; 61 | 62 | return 0; 63 | } 64 | 65 | 66 | /* 67 | * Some compilers do not support variable args macros. 68 | * This function is a replacement of ASN_DEBUG() macro. 69 | */ 70 | void ASN_DEBUG_f(const char *fmt, ...); 71 | void ASN_DEBUG_f(const char *fmt, ...) { 72 | va_list ap; 73 | va_start(ap, fmt); 74 | vfprintf(stderr, fmt, ap); 75 | fprintf(stderr, "\n"); 76 | va_end(ap); 77 | } 78 | -------------------------------------------------------------------------------- /src/rspro/constraints.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, 6 | const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { 7 | 8 | (void)type_descriptor; /* Unused argument */ 9 | (void)struct_ptr; /* Unused argument */ 10 | (void)cb; /* Unused argument */ 11 | (void)key; /* Unused argument */ 12 | 13 | /* Nothing to check */ 14 | return 0; 15 | } 16 | 17 | int 18 | asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, 19 | const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { 20 | 21 | (void)type_descriptor; /* Unused argument */ 22 | (void)struct_ptr; /* Unused argument */ 23 | (void)cb; /* Unused argument */ 24 | (void)key; /* Unused argument */ 25 | 26 | /* Unknown how to check */ 27 | return 0; 28 | } 29 | 30 | struct errbufDesc { 31 | asn_TYPE_descriptor_t *failed_type; 32 | const void *failed_struct_ptr; 33 | char *errbuf; 34 | size_t errlen; 35 | }; 36 | 37 | static void 38 | _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) { 39 | struct errbufDesc *arg = key; 40 | va_list ap; 41 | ssize_t vlen; 42 | ssize_t maxlen; 43 | 44 | arg->failed_type = td; 45 | arg->failed_struct_ptr = sptr; 46 | 47 | maxlen = arg->errlen; 48 | if(maxlen <= 0) 49 | return; 50 | 51 | va_start(ap, fmt); 52 | vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); 53 | va_end(ap); 54 | if(vlen >= maxlen) { 55 | arg->errbuf[maxlen-1] = '\0'; /* Ensuring libc correctness */ 56 | arg->errlen = maxlen - 1; /* Not counting termination */ 57 | return; 58 | } else if(vlen >= 0) { 59 | arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ 60 | arg->errlen = vlen; /* Not counting termination */ 61 | } else { 62 | /* 63 | * The libc on this system is broken. 64 | */ 65 | vlen = sizeof("") - 1; 66 | maxlen--; 67 | arg->errlen = vlen < maxlen ? vlen : maxlen; 68 | memcpy(arg->errbuf, "", arg->errlen); 69 | arg->errbuf[arg->errlen] = 0; 70 | } 71 | 72 | return; 73 | } 74 | 75 | int 76 | asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, 77 | const void *struct_ptr, char *errbuf, size_t *errlen) { 78 | struct errbufDesc arg; 79 | int ret; 80 | 81 | arg.failed_type = 0; 82 | arg.failed_struct_ptr = 0; 83 | arg.errbuf = errbuf; 84 | arg.errlen = errlen ? *errlen : 0; 85 | 86 | ret = type_descriptor->check_constraints(type_descriptor, 87 | struct_ptr, _asn_i_ctfailcb, &arg); 88 | if(ret == -1 && errlen) 89 | *errlen = arg.errlen; 90 | 91 | return ret; 92 | } 93 | 94 | -------------------------------------------------------------------------------- /src/rspro/xer_encoder.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. 3 | * Redistribution and modifications are permitted subject to BSD license. 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | /* 10 | * The XER encoder of any type. May be invoked by the application. 11 | */ 12 | asn_enc_rval_t 13 | xer_encode(asn_TYPE_descriptor_t *td, void *sptr, 14 | enum xer_encoder_flags_e xer_flags, 15 | asn_app_consume_bytes_f *cb, void *app_key) { 16 | asn_enc_rval_t er, tmper; 17 | const char *mname; 18 | size_t mlen; 19 | int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2; 20 | 21 | if(!td || !sptr) goto cb_failed; 22 | 23 | mname = td->xml_tag; 24 | mlen = strlen(mname); 25 | 26 | _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); 27 | 28 | tmper = td->xer_encoder(td, sptr, 1, xer_flags, cb, app_key); 29 | if(tmper.encoded == -1) return tmper; 30 | 31 | _ASN_CALLBACK3("\n", xcan); 32 | 33 | er.encoded = 4 + xcan + (2 * mlen) + tmper.encoded; 34 | 35 | _ASN_ENCODED_OK(er); 36 | cb_failed: 37 | _ASN_ENCODE_FAILED; 38 | } 39 | 40 | /* 41 | * This is a helper function for xer_fprint, which directs all incoming data 42 | * into the provided file descriptor. 43 | */ 44 | static int 45 | xer__print2fp(const void *buffer, size_t size, void *app_key) { 46 | FILE *stream = (FILE *)app_key; 47 | 48 | if(fwrite(buffer, 1, size, stream) != size) 49 | return -1; 50 | 51 | return 0; 52 | } 53 | 54 | int 55 | xer_fprint(FILE *stream, asn_TYPE_descriptor_t *td, void *sptr) { 56 | asn_enc_rval_t er; 57 | 58 | if(!stream) stream = stdout; 59 | if(!td || !sptr) 60 | return -1; 61 | 62 | er = xer_encode(td, sptr, XER_F_BASIC, xer__print2fp, stream); 63 | if(er.encoded == -1) 64 | return -1; 65 | 66 | return fflush(stream); 67 | } 68 | -------------------------------------------------------------------------------- /src/rspro_client_fsm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "rspro_util.h" 9 | 10 | enum server_conn_fsm_event { 11 | SRVC_E_ESTABLISH, /* instruct SRVC to (re)etablish TCP connection to bankd */ 12 | SRVC_E_DISCONNECT, /* instruct SRVC to disconnect TCP connection to bankd */ 13 | SRVC_E_TCP_UP, 14 | SRVC_E_TCP_DOWN, 15 | SRVC_E_KA_TIMEOUT, 16 | SRVC_E_CLIENT_CONN_RES, 17 | SRVC_E_RSPRO_TX /* transmit a RSPRO PDU to the peer */ 18 | }; 19 | 20 | /* representing a client-side connection to a RSPRO server */ 21 | struct rspro_server_conn { 22 | /* state */ 23 | struct osmo_stream_cli *conn; 24 | struct osmo_fsm_inst *fi; 25 | struct osmo_ipa_ka_fsm_inst *ka_fi; 26 | int (*handle_rx)(struct rspro_server_conn *conn, const RsproPDU_t *pdu); 27 | 28 | /* index into k_reestablish_delay[] for this connection */ 29 | size_t reestablish_delay_idx; 30 | 31 | /* timestamp of last re-establish attempt, in milliseconds */ 32 | int64_t reestablish_last_ms; 33 | 34 | /* IPA protocol identity */ 35 | struct ipaccess_unit ipa_dev; 36 | 37 | /* our own component ID */ 38 | struct app_comp_id own_comp_id; 39 | /* remote component ID */ 40 | struct app_comp_id peer_comp_id; 41 | 42 | /* client id and slot number */ 43 | ClientSlot_t *clslot; 44 | 45 | /* configuration */ 46 | char *server_host; 47 | uint16_t server_port; 48 | 49 | /* FSM events we are to sent to the parent FSM on connect / disconnect */ 50 | uint32_t parent_conn_evt; 51 | uint32_t parent_disc_evt; 52 | 53 | /* only in case we are representing a bankd client */ 54 | struct { 55 | uint16_t bank_id; 56 | uint16_t num_slots; 57 | } bankd; 58 | }; 59 | 60 | int server_conn_send_rspro(struct rspro_server_conn *srvc, RsproPDU_t *rspro); 61 | int server_conn_fsm_alloc(void *ctx, struct rspro_server_conn *srvc); 62 | -------------------------------------------------------------------------------- /src/rspro_util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #define MAX_NAME_LEN 32 8 | struct app_comp_id { 9 | enum ComponentType type; 10 | char name[MAX_NAME_LEN+1]; 11 | char software[MAX_NAME_LEN+1]; 12 | char sw_version[MAX_NAME_LEN+1]; 13 | char hw_manufacturer[MAX_NAME_LEN+1]; 14 | char hw_model[MAX_NAME_LEN+1]; 15 | char hw_serial_nr[MAX_NAME_LEN+1]; 16 | char hw_version[MAX_NAME_LEN+1]; 17 | char fw_version[MAX_NAME_LEN+1]; 18 | }; 19 | 20 | const char *rspro_msgt_name(const RsproPDU_t *pdu); 21 | 22 | struct msgb *rspro_msgb_alloc(void); 23 | struct msgb *rspro_enc_msg(RsproPDU_t *pdu); 24 | RsproPDU_t *rspro_dec_msg(struct msgb *msg); 25 | RsproPDU_t *rspro_gen_ConnectBankReq(const struct app_comp_id *a_cid, 26 | uint16_t bank_id, uint16_t num_slots); 27 | RsproPDU_t *rspro_gen_ConnectBankRes(const struct app_comp_id *a_cid, e_ResultCode res); 28 | RsproPDU_t *rspro_gen_ConnectClientReq(const struct app_comp_id *a_cid, const ClientSlot_t *client); 29 | RsproPDU_t *rspro_gen_ConnectClientRes(const struct app_comp_id *a_cid, e_ResultCode res); 30 | RsproPDU_t *rspro_gen_CreateMappingReq(const ClientSlot_t *client, const BankSlot_t *bank); 31 | RsproPDU_t *rspro_gen_CreateMappingRes(e_ResultCode res); 32 | RsproPDU_t *rspro_gen_RemoveMappingReq(const ClientSlot_t *client, const BankSlot_t *bank); 33 | RsproPDU_t *rspro_gen_RemoveMappingRes(e_ResultCode res); 34 | RsproPDU_t *rspro_gen_ConfigClientIdReq(const ClientSlot_t *client); 35 | RsproPDU_t *rspro_gen_ConfigClientIdRes(e_ResultCode res); 36 | RsproPDU_t *rspro_gen_ConfigClientBankReq(const BankSlot_t *bank, uint32_t ip, uint16_t port); 37 | RsproPDU_t *rspro_gen_ConfigClientBankRes(e_ResultCode res); 38 | RsproPDU_t *rspro_gen_SetAtrReq(uint16_t client_id, uint16_t slot_nr, const uint8_t *atr, 39 | unsigned int atr_len); 40 | RsproPDU_t *rspro_gen_SetAtrRes(e_ResultCode res); 41 | RsproPDU_t *rspro_gen_TpduModem2Card(const ClientSlot_t *client, const BankSlot_t *bank, 42 | const uint8_t *tpdu, unsigned int tpdu_len); 43 | RsproPDU_t *rspro_gen_TpduCard2Modem(const BankSlot_t *bank, const ClientSlot_t *client, 44 | const uint8_t *tpdu, unsigned int tpdu_len); 45 | RsproPDU_t *rspro_gen_BankSlotStatusInd(const BankSlot_t *bank, const ClientSlot_t *client, 46 | bool rst_active, int vcc_present, int clk_active, 47 | int card_present); 48 | RsproPDU_t *rspro_gen_ClientSlotStatusInd(const ClientSlot_t *client, const BankSlot_t *bank, 49 | bool rst_active, int vcc_present, int clk_active, 50 | int card_present); 51 | RsproPDU_t *rspro_gen_ResetStateReq(void); 52 | RsproPDU_t *rspro_gen_ResetStateRes(e_ResultCode res); 53 | 54 | e_ResultCode rspro_get_result(const RsproPDU_t *pdu); 55 | 56 | void rspro_comp_id_retrieve(struct app_comp_id *out, const ComponentIdentity_t *in); 57 | const char *rspro_IpAddr2str(const IpAddress_t *in); 58 | 59 | #include "slotmap.h" 60 | void rspro2bank_slot(struct bank_slot *out, const BankSlot_t *in); 61 | void bank_slot2rspro(BankSlot_t *out, const struct bank_slot *in); 62 | 63 | void rspro2client_slot(struct client_slot *out, const ClientSlot_t *in); 64 | void client_slot2rspro(ClientSlot_t *out, const struct client_slot *in); 65 | -------------------------------------------------------------------------------- /src/server/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS = -Wall \ 3 | -I$(top_srcdir)/include \ 4 | -I$(top_builddir)/include \ 5 | -I$(top_srcdir)/src \ 6 | -I$(top_srcdir)/include/osmocom/rspro \ 7 | $(OSMONETIF_CFLAGS) \ 8 | $(OSMOGSM_CFLAGS) \ 9 | $(OSMOCORE_CFLAGS) \ 10 | $(ULFIUS_CFLAGS) \ 11 | $(JANSSON_CFLAGS) \ 12 | $(ORCANIA_CFLAGS) \ 13 | $(NULL) 14 | 15 | noinst_HEADERS = rspro_server.h rest_api.h 16 | 17 | bin_PROGRAMS = osmo-remsim-server 18 | 19 | osmo_remsim_server_SOURCES = remsim_server.c rspro_server.c rest_api.c \ 20 | ../rspro_util.c ../slotmap.c ../debug.c 21 | osmo_remsim_server_LDADD = $(top_builddir)/src/libosmo-rspro.la \ 22 | $(OSMONETIF_LIBS) \ 23 | $(OSMOGSM_LIBS) \ 24 | $(OSMOCORE_LIBS) \ 25 | $(ULFIUS_LIBS) \ 26 | $(JANSSON_LIBS) \ 27 | $(ORCANIA_LIBS) \ 28 | $(NULL) 29 | 30 | # as suggested in http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html 31 | FORCE: 32 | $(top_builddir)/src/libosmo-rspro.la: FORCE 33 | (cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libosmo-rspro.la) 34 | -------------------------------------------------------------------------------- /src/server/rest_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | int rest_api_init(void *ctx, uint16_t port); 5 | void rest_api_fini(void); 6 | -------------------------------------------------------------------------------- /src/server/rspro_server.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "rspro_util.h" 10 | #include "slotmap.h" 11 | 12 | struct rspro_server { 13 | struct osmo_stream_srv_link *link; 14 | /* list of rspro_client_conn */ 15 | struct llist_head connections; 16 | struct llist_head clients; 17 | struct llist_head banks; 18 | /* rwlock protecting any of the lists above */ 19 | pthread_rwlock_t rwlock; 20 | 21 | struct slotmaps *slotmaps; 22 | 23 | /* our own (server) component identity */ 24 | struct app_comp_id comp_id; 25 | }; 26 | 27 | /* representing a single client connection to an RSPRO server */ 28 | struct rspro_client_conn { 29 | /* global list of connections */ 30 | struct llist_head list; 31 | /* back-pointer to rspro_server */ 32 | struct rspro_server *srv; 33 | /* reference to the underlying IPA server connection */ 34 | struct osmo_stream_srv *peer; 35 | /* FSM instance for this connection */ 36 | struct osmo_fsm_inst *fi; 37 | /* remote component identity (after it has been received) */ 38 | struct app_comp_id comp_id; 39 | /* keep-alive handling FSM */ 40 | struct osmo_ipa_ka_fsm_inst *ka_fi; 41 | 42 | struct { 43 | struct llist_head maps_new; 44 | struct llist_head maps_unack; 45 | struct llist_head maps_active; 46 | struct llist_head maps_delreq; 47 | struct llist_head maps_deleting; 48 | uint16_t bank_id; 49 | uint16_t num_slots; 50 | } bank; 51 | struct { 52 | struct client_slot slot; 53 | /* bankd configuration for this client (if any) */ 54 | struct { 55 | struct bank_slot slot; 56 | uint32_t ip; 57 | uint16_t port; 58 | } bankd; 59 | } client; 60 | }; 61 | 62 | struct rspro_server *rspro_server_create(void *ctx, const char *host, uint16_t port); 63 | void rspro_server_destroy(struct rspro_server *srv); 64 | int event_fd_cb(struct osmo_fd *ofd, unsigned int what); 65 | 66 | struct rspro_client_conn *_client_conn_by_slot(struct rspro_server *srv, const struct client_slot *cslot); 67 | struct rspro_client_conn *client_conn_by_slot(struct rspro_server *srv, const struct client_slot *cslot); 68 | struct rspro_client_conn *_bankd_conn_by_id(struct rspro_server *srv, uint16_t bank_id); 69 | struct rspro_client_conn *bankd_conn_by_id(struct rspro_server *srv, uint16_t bank_id); 70 | --------------------------------------------------------------------------------