Projects
osmocom:latest
libosmocore
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 16
View file
libosmocore.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmocore Requires: osmocom-latest -Version: 1.11.3 +Version: 1.12.0 Release: 0 Summary: The Open Source Mobile Communications Core Library License: GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND AGPL-3.0-or-later Group: Productivity/Telephony/Utilities Url: https://osmocom.org/projects/libosmocore/wiki/Libosmocore -Source: libosmocore_1.11.3.tar.xz +Source: libosmocore_1.12.0.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.6 BuildRequires: libtool >= 2 @@ -182,7 +182,7 @@ %package -n libosmogb14 Requires: osmocom-latest Summary: Osmocom GPRS Gb Interface (NS/BSSGP) library -License: AGPL-3.0-or-later +License: GPL-2.0-or-later Group: System/Libraries %description -n libosmogb14 @@ -194,7 +194,7 @@ %package -n libosmogb-devel Requires: osmocom-latest Summary: Development files for the Osmocom GPRS Gb interface library -License: AGPL-3.0-or-later +License: GPL-2.0-or-later Group: Development/Libraries/C and C++ Requires: libosmocore-devel = %version Requires: libosmogb14 = %version
View file
libosmocore_1.11.3.tar.xz/tests/atlocal.in
Deleted
@@ -1 +0,0 @@ -enable_sim_test='@ENABLE_PCSC@'
View file
libosmocore_1.11.3.dsc -> libosmocore_1.12.0.dsc
Changed
@@ -2,7 +2,7 @@ Source: libosmocore Binary: libosmocore, libosmocodec4, libosmocodec-doc, libosmocoding0, libosmocoding-doc, libosmocore22, libosmocore-doc, libosmogb14, libosmogb-doc, libosmogsm20, libosmogsm-doc, libosmoisdn0, libosmoisdn-doc, libosmovty13, libosmovty-doc, libosmoctrl0, libosmoctrl-doc, libosmosim2, libosmosim-doc, libosmousb0, libosmousb-doc, libosmocore-dev, libosmocore-utils, libosmocore-dbg Architecture: any all -Version: 1.11.3 +Version: 1.12.0 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/libosmocore Standards-Version: 3.9.8 @@ -35,8 +35,8 @@ libosmovty-doc deb doc optional arch=all libosmovty13 deb libs optional arch=any Checksums-Sha1: - f78d9030aed17d7270d7f6c98b8967f83572f149 1126452 libosmocore_1.11.3.tar.xz + ac342b87dec7e61f4c0b8c156eb49dbc13ca7ee2 1135280 libosmocore_1.12.0.tar.xz Checksums-Sha256: - 47ab595e6e634be7c743f84f95476d5b64785482e748dbb30481432e21ada48c 1126452 libosmocore_1.11.3.tar.xz + c0d3e473d72d8c962e1555f8a24572ecf1bae56757666f91f827ac2cb7013ecf 1135280 libosmocore_1.12.0.tar.xz Files: - d752595eb089796b304018ef817001d7 1126452 libosmocore_1.11.3.tar.xz + 565988e329f6f9be8d28615f26ec6728 1135280 libosmocore_1.12.0.tar.xz
View file
libosmocore_1.11.3.tar.xz/.tarball-version -> libosmocore_1.12.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.11.3 +1.12.0
View file
libosmocore_1.11.3.tar.xz/configure.ac -> libosmocore_1.12.0.tar.xz/configure.ac
Changed
@@ -7,6 +7,7 @@ AM_INIT_AUTOMAKE(foreign dist-bzip2 no-dist-gzip 1.6 subdir-objects) AC_CONFIG_TESTDIR(tests) +AC_CONFIG_TESTDIR(tests/osmo-config-merge) CFLAGS="$CFLAGS -std=gnu11" @@ -66,6 +67,11 @@ AC_SUBST(LTLDFLAGS_OSMOCORE) AC_SUBST(LTLDFLAGS_OSMOCTRL) +AC_C_BIGENDIAN( + AC_MSG_ERROR(Unfortunately, big endian hosts are currently not supported anymore due to lack of development resources. Contributions welcome.), + , + AC_MSG_WARN(Byte order could not be determined. Strange.)) + dnl checks for header files AC_HEADER_STDC AC_CHECK_HEADERS(execinfo.h poll.h sys/select.h sys/socket.h sys/signalfd.h sys/eventfd.h sys/timerfd.h syslog.h ctype.h netinet/tcp.h netinet/in.h) @@ -173,6 +179,12 @@ dnl Generate the output AC_CONFIG_HEADER(config.h) +dnl Search for a Python interpreter on the system +dnl python is needed at built-time for auto-generating code +dnl Don't require a newer version than 3.5 for now, as poky 201705 ships that +dnl Don't require a newer version than 3.4, we build poky 201705 on debian 8 +AM_PATH_PYTHON(3.4) + PKG_CHECK_MODULES(TALLOC, talloc >= 2.1.0) AC_ARG_ENABLE(uring, AS_HELP_STRING(--disable-uring, Build without io_uring support), @@ -463,7 +475,6 @@ Include the VTY/CTRL tests in make check default=no), enable_ext_tests="$enableval",enable_ext_tests="no") if test "x$enable_ext_tests" = "xyes" ; then - AM_PATH_PYTHON AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmo_verify_transcript_vty.py,yes) if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then AC_MSG_ERROR(Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.) @@ -639,7 +650,7 @@ src/pseudotalloc/Makefile tapset/Makefile tests/Makefile - tests/atlocal + tests/osmo-config-merge/Makefile utils/Makefile utils/osmo-stat-dummy/Makefile Doxyfile.core
View file
libosmocore_1.11.3.tar.xz/contrib/libosmocore.spec.in -> libosmocore_1.12.0.tar.xz/contrib/libosmocore.spec.in
Changed
@@ -181,7 +181,7 @@ %package -n libosmogb14 Requires: osmocom-latest Summary: Osmocom GPRS Gb Interface (NS/BSSGP) library -License: AGPL-3.0-or-later +License: GPL-2.0-or-later Group: System/Libraries %description -n libosmogb14 @@ -193,7 +193,7 @@ %package -n libosmogb-devel Requires: osmocom-latest Summary: Development files for the Osmocom GPRS Gb interface library -License: AGPL-3.0-or-later +License: GPL-2.0-or-later Group: Development/Libraries/C and C++ Requires: libosmocore-devel = %version Requires: libosmogb14 = %version
View file
libosmocore_1.11.3.tar.xz/debian/changelog -> libosmocore_1.12.0.tar.xz/debian/changelog
Changed
@@ -1,32 +1,83 @@ -libosmocore (1.11.3) unstable; urgency=medium +libosmocore (1.12.0) unstable; urgency=medium - Harald Welte - * gsm/gsm_utils: Support the ER-GSM band (ARFCN 940..954) + Vadim Yanitskiy + * gsmtap: fix outdated header version in comment + * configure.ac: check for Python interpreter unconditionally + * libosmocore.spec.in: correct license for libosmogb + * vty: cosmetic: fix code formatting + * tests/testsuite.at: fix invalid if-endif syntax + * tests/testsuite.at: use AT_SKIP_IF for sim_test + * tests/testsuite.at: properly skip disabled tests Pau Espin Pedrol + * tests: soft_uart: Fix printf int type format + * iuup: Explicitly discard Iu-UP-DATA.req in Initialization state + * cosmetic: lapd: Fix typo in comment + * lapd: Take talloc msgb ownership when enqueueing it + * lapdm: Take talloc msgb ownership when enqueueing it + * lapdm: Move queue initialization to specific init function + * cosmetic: Improve comment with spec references in Cell Selection Parameters + * cosmetic: Improve comment with spec ref in RACH Control Parameters + * cosmetic: Improve spec references of fields/structs related to SI3ro and SI4ro + * cosmetic: Document missing CBQ3 optional field in SI4ro + * cosmetic: vty/Makefile.am: Split items one per line + * vty: cpu_sched_vty.c: remove tdef references + * core: osmo_io: Introduce API osmo_io_get_backend() + * vty: Add 'show runtime' command + * Introduce tests/osmo-config-merge testsuite + * osmo-config-merge: Fix comments with different indentation creating merge problems + * osmo_io: Keep msgb ownership internal during segmentation until read_cb + * tests/osmo_io_test: test_segmentation: Use osmo_iofd_close() API + * tests/osmo_io_test (io_uring): test_segmentation: Fix infinite loop in read_cb rc=0 * io_uring: Avoid extra reads if iofd becomes unregistered by user + * bssgp: Fix non-uniqe rate_ctr ids - -- Oliver Smith <osmith@sysmocom.de> Thu, 06 Nov 2025 14:31:02 +0100 - -libosmocore (1.11.2) unstable; urgency=medium + Mychaela N. Falconia + * codec: add some constant frames for HR and EFR + * rtp_extensions.h: update for TW-TS-003 version 1.1.0 + * gsm/protocol/gsm_48_103.h: new header file + * AMR codec: add conversion between s-bits and codec parameters + * AMR codec: add decoder homing frame const patterns Oliver Smith + * configure: set min python version check to 3.5 + * configure: set min python version check to 3.4 * Makefile: fix doc/vty race condition + * osmo-release: improve check for REL argument + * Generate a version.h file * tests: fix for debian 13 armv7l + * gsm_04_08: add GSM48_BCAP_RRQ_SPARE_NETWORK_TO_MS + * osmo-release: debian_patch_apply: handle empty dir - Andreas Eversberg - * VTY: Initialize fields of struct cmd_element in order of declaration - - -- Oliver Smith <osmith@sysmocom.de> Tue, 26 Aug 2025 15:31:46 +0200 + Harald Welte + * protocol/gsm_04_08.h: Add GSM 04.08 message types for SI21/22/23 + * Allow io_uring_submit batching just ahead of poll/select + * gsm/gsm_utils: Support the ER-GSM band (ARFCN 940..954) -libosmocore (1.11.1) unstable; urgency=medium + Alexander Huemer + * Abort configure run on big endian hosts - Pau Espin Pedrol - * tests: soft_uart: Fix printf int type format - * lapd: Take talloc msgb ownership when enqueueing it - * lapdm: Take talloc msgb ownership when enqueueing it + Andreas Eversberg + * VTY: Initialize fields of struct cmd_element in order of declaration + * linuxlist.h: add llist_last_entry_or_null macro + * Avoid reusing pending buffer; append incoming data instead + * osmo_io: Add unit test to verify segmentation process + * Add multiple messages buffers to struct iofd_msghdr + * Add multiple messages buffers to io_uring read operations + * Add multiple messages buffers to io_uring write operations + * osmo-io: Put together message buffers when dequeued from tx queue + * Send multiple read/recvfrom/recvmsg SQEs in advance + * Add environment variable to set io_uring size + * Automatically increase io_uring, if too small. + * Remove old empty io_uring + * Put all io_uring related read and write states into sub structures + * Correctly calculate size iofd_msgb_alloc2() + + Daniel Willmann + * Register OSMO_EXT protocol number for TCAP routing + * Add DLTCAP log category - -- Vadim Yanitskiy <vyanitskiy@sysmocom.de> Tue, 06 May 2025 16:24:20 +0700 + -- Pau Espin Pedrol <pespin@sysmocom.de> Wed, 03 Dec 2025 16:49:11 +0100 libosmocore (1.11.0) unstable; urgency=medium
View file
libosmocore_1.11.3.tar.xz/include/osmocom/codec/codec.h -> libosmocore_1.12.0.tar.xz/include/osmocom/codec/codec.h
Changed
@@ -34,6 +34,9 @@ extern const uint16_t gsm690_4_75_bitorder; /* AMR 4.75 kbits */ extern const uint8_t osmo_gsm611_silence_frameGSM_FR_BYTES; +extern const uint8_t osmo_gsm620_silence_frameGSM_HR_BYTES; +extern const uint8_t osmo_gsm620_homing_frameGSM_HR_BYTES; +extern const uint8_t osmo_gsm660_homing_frameGSM_EFR_BYTES; extern const struct value_string osmo_amr_type_names; @@ -87,6 +90,23 @@ } } +extern const uint8_t osmo_amr_sbits_per_modeAMR_NO_DATA+1; +extern const uint8_t osmo_amr_params_per_modeAMR_NO_DATA+1; + +int osmo_amr_param_to_sbits(ubit_t *s_bits, const uint16_t *param, + enum osmo_amr_type mode); +int osmo_amr_sbits_to_param(uint16_t *param, const ubit_t *s_bits, + enum osmo_amr_type mode); + +extern const uint16_t osmo_amr_dhf_4_75; +extern const uint16_t osmo_amr_dhf_5_15; +extern const uint16_t osmo_amr_dhf_5_90; +extern const uint16_t osmo_amr_dhf_6_70; +extern const uint16_t osmo_amr_dhf_7_40; +extern const uint16_t osmo_amr_dhf_7_95; +extern const uint16_t osmo_amr_dhf_10_2; +extern const uint16_t osmo_amr_dhf_12_2; + /* SID ternary classification per GSM 06.31 & 06.81 section 6.1.1 */ enum osmo_gsm631_sid_class { OSMO_GSM631_SID_CLASS_SPEECH = 0,
View file
libosmocore_1.11.3.tar.xz/include/osmocom/core/Makefile.am -> libosmocore_1.12.0.tar.xz/include/osmocom/core/Makefile.am
Changed
@@ -59,6 +59,7 @@ timer_compat.h \ tun.h \ utils.h \ + version.h \ write_queue.h \ sockaddr_str.h \ soft_uart.h \ @@ -101,4 +102,13 @@ $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(AM_V_GEN)sed -e's/XX/$(HAVE_SYS_SOCKET_H)/g' $< > $@ -EXTRA_DIST = socket_compat.h.tpl +version.h: version.h.tpl + $(AM_V_GEN)$(MKDIR_P) $(dir $@) + $(AM_V_GEN)sed \ + -e "s/{{VERSION}}/$$(echo '@VERSION@' | cut -d. -f1-3)/g" \ + -e "s/{{VERSION_MAJOR}}/$$(echo '@VERSION@' | cut -d. -f1)/g" \ + -e "s/{{VERSION_MINOR}}/$$(echo '@VERSION@' | cut -d. -f2)/g" \ + -e "s/{{VERSION_PATCH}}/$$(echo '@VERSION@' | cut -d. -f3)/g" \ + $< > $@ + +EXTRA_DIST = socket_compat.h.tpl version.h.tpl
View file
libosmocore_1.11.3.tar.xz/include/osmocom/core/gsmtap.h -> libosmocore_1.12.0.tar.xz/include/osmocom/core/gsmtap.h
Changed
@@ -303,7 +303,7 @@ /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ /*! Structure of the GSMTAP pseudo-header */ struct gsmtap_hdr { - uint8_t version; /*!< version, set to 0x01 currently */ + uint8_t version; /*!< version, set to GSMTAP_VERSION */ uint8_t hdr_len; /*!< length in number of 32bit words */ uint8_t type; /*!< see GSMTAP_TYPE_* */ uint8_t timeslot; /*!< timeslot (0..7 on Um) */
View file
libosmocore_1.11.3.tar.xz/include/osmocom/core/linuxlist.h -> libosmocore_1.12.0.tar.xz/include/osmocom/core/linuxlist.h
Changed
@@ -254,6 +254,16 @@ #define llist_first_entry_or_null(ptr, type, member) \ (!llist_empty(ptr) ? llist_first_entry(ptr, type, member) : NULL) +/*! Get the last element from a list, or NULL. + * \param ptr the list head to take the element from. + * \param type the type of the struct this is embedded in. + * \param member the name of the list_head within the struct. + * + * Note that if the list is empty, it returns NULL. + */ +#define llist_last_entry_or_null(ptr, type, member) \ + (!llist_empty(ptr) ? llist_last_entry(ptr, type, member) : NULL) + /*! Iterate over a linked list. * \param pos the llist_head to use as a loop counter. * \param head the head of the list over which to iterate.
View file
libosmocore_1.11.3.tar.xz/include/osmocom/core/logging.h -> libosmocore_1.12.0.tar.xz/include/osmocom/core/logging.h
Changed
@@ -155,7 +155,8 @@ #define DLM2PA -27 /*!< Osmocom M2PA (libosmo-sigtran) */ #define DLM2UA -28 /*!< Reserved for future Osmocom M2UA (libosmo-sigtran) */ #define DLIO -29 /*!< Osmocom IO sub-system */ -#define OSMO_NUM_DLIB 29 /*!< Number of logging sub-systems in libraries */ +#define DLTCAP -30 /*!< Osmocom TCAP */ +#define OSMO_NUM_DLIB 30 /*!< Number of logging sub-systems in libraries */ /* Colors that can be used in log_info_cat.color */ #define OSMO_LOGCOLOR_NORMAL NULL
View file
libosmocore_1.11.3.tar.xz/include/osmocom/core/osmo_io.h -> libosmocore_1.12.0.tar.xz/include/osmocom/core/osmo_io.h
Changed
@@ -70,6 +70,14 @@ OSMO_IO_FD_MODE_RECVMSG_SENDMSG, }; +/*! The _operation_ of an osmo_io_fd determines if read or write operation are to be configured used. */ +enum osmo_io_op { + /*! change parameters for read() */ + OSMO_IO_OP_READ, + /*! change parameters for write() */ + OSMO_IO_OP_WRITE, +}; + /*! The back-end used by osmo_io. There can be multiple different back-ends available on a given system; * only one of it is used for all I/O performed via osmo_io in one given process. */ enum osmo_io_backend { @@ -79,6 +87,8 @@ OSMO_IO_BACKEND_IO_URING, }; +enum osmo_io_backend osmo_io_get_backend(void); + extern const struct value_string osmo_io_backend_names; /*! return the string name of an osmo_io_backend */ static inline const char *osmo_io_backend_name(enum osmo_io_backend val) @@ -202,6 +212,8 @@ struct osmo_io_fd *osmo_iofd_setup(const void *ctx, int fd, const char *name, enum osmo_io_fd_mode mode, const struct osmo_io_ops *ioops, void *data); int osmo_iofd_set_cmsg_size(struct osmo_io_fd *iofd, size_t cmsg_size); +int osmo_iofd_set_io_buffers(struct osmo_io_fd *iofd, enum osmo_io_op op, uint8_t buffers); +int osmo_iofd_set_sqes(struct osmo_io_fd *iofd, enum osmo_io_op op, uint8_t sqes); int osmo_iofd_register(struct osmo_io_fd *iofd, int fd); int osmo_iofd_unregister(struct osmo_io_fd *iofd); unsigned int osmo_iofd_txqueue_len(struct osmo_io_fd *iofd);
View file
libosmocore_1.12.0.tar.xz/include/osmocom/core/version.h.tpl
Added
@@ -0,0 +1,16 @@ +#pragma once + +#define LIBOSMOCORE_VERSION {{VERSION}} +#define LIBOSMOCORE_VERSION_STR "{{VERSION}}" + +#define LIBOSMOCORE_VERSION_MAJOR {{VERSION_MAJOR}} +#define LIBOSMOCORE_VERSION_MINOR {{VERSION_MINOR}} +#define LIBOSMOCORE_VERSION_PATCH {{VERSION_PATCH}} + +#define LIBOSMOCORE_VERSION_GREATER_EQUAL(major, minor, patch) \ + (LIBOSMOCORE_VERSION_MAJOR > (major) || \ + (LIBOSMOCORE_VERSION_MAJOR == (major) && \ + LIBOSMOCORE_VERSION_MINOR > (minor)) || \ + (LIBOSMOCORE_VERSION_MAJOR == (major) && \ + LIBOSMOCORE_VERSION_MINOR == (minor) && \ + LIBOSMOCORE_VERSION_PATCH >= (patch)))
View file
libosmocore_1.11.3.tar.xz/include/osmocom/gsm/gsm48_rest_octets.h -> libosmocore_1.12.0.tar.xz/include/osmocom/gsm/gsm48_rest_octets.h
Changed
@@ -60,30 +60,34 @@ int osmo_gsm48_rest_octets_si6_encode(uint8_t *data, const struct osmo_gsm48_si6_ro_info *in); +/* 3GPP TS 44.018 Table 10.5.2.34.1 (Optional) "Selection Parameters" */ struct osmo_gsm48_si_selection_params { - uint16_t penalty_time:5, - temp_offs:3, - cell_resel_off:6, - cbq:1, + uint16_t penalty_time:5, /* PENALTY_TIME */ + temp_offs:3, /* TEMPORARY_OFFSET */ + cell_resel_off:6, /* CELL_RESELECT_OFFSET */ + cbq:1, /* CELL_BAR_QUALIFY (CBQ) */ present:1; }; +/* 3GPP TS 44.018 Table 10.5.2.34.1 "Optional Power offset" */ struct osmo_gsm48_si_power_offset { - uint8_t power_offset:2, + uint8_t power_offset:2, /* POWER OFFSET */ present:1; }; +/* 3GPP TS 44.018 Table 10.5.2.34.1 "GPRS Indicator" */ struct osmo_gsm48_si3_gprs_ind { - uint8_t si13_position:1, - ra_colour:3, + uint8_t si13_position:1, /* SI13 POSITION */ + ra_colour:3, /* RA COLOUR */ present:1; }; +/* 3GPP TS 44.018 Table 10.5.2.35.1 "LSA Parameters" */ struct osmo_gsm48_lsa_params { - uint32_t prio_thr:3, - lsa_offset:3, - mcc:12, - mnc:12; + uint32_t prio_thr:3, /* PRIO_THR */ + lsa_offset:3, /* LSA_OFFSET */ + mcc:12, /* MCC */ + mnc:12; /* MNC */ unsigned int present; };
View file
libosmocore_1.11.3.tar.xz/include/osmocom/gsm/protocol/Makefile.am -> libosmocore_1.12.0.tar.xz/include/osmocom/gsm/protocol/Makefile.am
Changed
@@ -22,6 +22,7 @@ gsm_44_318.h \ gsm_48_049.h \ gsm_48_071.h \ + gsm_48_103.h \ gsm_49_031.h \ ipaccess.h \ smpp34_osmocom.h \
View file
libosmocore_1.11.3.tar.xz/include/osmocom/gsm/protocol/gsm_04_08.h -> libosmocore_1.12.0.tar.xz/include/osmocom/gsm/protocol/gsm_04_08.h
Changed
@@ -634,13 +634,13 @@ #endif } __attribute__((packed)); -/* Chapter 10.5.2.29 */ +/* 3GPP TS 44.018 Chapter 10.5.2.29 "RACH Control Parameters" */ struct gsm48_rach_control { #if OSMO_IS_LITTLE_ENDIAN - uint8_t re :1, - cell_bar :1, - tx_integer :4, - max_trans :2; + uint8_t re :1, /* RE, Call reestablishment allowed */ + cell_bar :1, /* CELL_BAR_ACCESS */ + tx_integer :4, /* Tx-integer */ + max_trans :2; /* Max_Retrans */ uint8_t t2; /* ACC 8-15 barred flags */ uint8_t t3; /* ACC 0-7 barred flags */ #elif OSMO_IS_BIG_ENDIAN @@ -973,12 +973,12 @@ #endif } __attribute__ ((packed)); -/* Section 10.5.2.4 Cell Selection Parameters */ +/* 3GPP TS 44.018 Section 10.5.2.4 Cell Selection Parameters */ struct gsm48_cell_sel_par { #if OSMO_IS_LITTLE_ENDIAN - uint8_t ms_txpwr_max_ccch:5, /* GSM 05.08 MS-TXPWR-MAX-CCCH */ - cell_resel_hyst:3; /* GSM 05.08 CELL-RESELECT-HYSTERESIS */ - uint8_t rxlev_acc_min:6, /* GSM 05.08 RXLEV-ACCESS-MIN */ + uint8_t ms_txpwr_max_ccch:5, /* MS-TXPWR-MAX-CCH, 3GPP TS 45.008 MS_TXPWR_MAX_CCH */ + cell_resel_hyst:3; /* CELL-RESELECT-HYSTERESIS, 3GPP TS 45.008 CELL_RESELECT_HYSTERESIS */ + uint8_t rxlev_acc_min:6, /* RXLEV-ACCESS-MIN, 3GPP TS 45.008 RXLEV_ACCESS_MIN */ neci:1, acs:1; #elif OSMO_IS_BIG_ENDIAN @@ -1617,6 +1617,11 @@ #define GSM48_MT_RR_SYSINFO_18 0x40 #define GSM48_MT_RR_SYSINFO_19 0x41 #define GSM48_MT_RR_SYSINFO_20 0x42 +#define GSM48_MT_RR_SYSINFO_13alt 0x44 +#define GSM48_MT_RR_SYSINFO_2n 0x45 +#define GSM48_MT_RR_SYSINFO_21 0x46 +#define GSM48_MT_RR_SYSINFO_22 0x47 +#define GSM48_MT_RR_SYSINFO_23 0x4f #define GSM48_MT_RR_CHAN_MODE_MODIF 0x10 #define GSM48_MT_RR_STATUS 0x12 @@ -2149,6 +2154,9 @@ GSM48_BCAP_RRQ_FR_ONLY = 1, GSM48_BCAP_RRQ_DUAL_HR = 2, GSM48_BCAP_RRQ_DUAL_FR = 3, +/* GSM 04.08 Table 10.72: In network to MS direction, the network must send + * spare bits that are encoded the same as FR_ONLY. */ +#define GSM48_BCAP_RRQ_SPARE_NETWORK_TO_MS GSM48_BCAP_RRQ_FR_ONLY }; /* GSM 04.08 Bearer Capability: Rate Adaption */
View file
libosmocore_1.12.0.tar.xz/include/osmocom/gsm/protocol/gsm_48_103.h
Added
@@ -0,0 +1,21 @@ +/* + * This header file captures the set of fixed RTP payload type definitions + * specified in 3GPP TS 48.103 (GSM AoIP interface) Table 5.4.2.2.1. + */ + +#pragma once + +/* uncompressed speech */ +#define OSMO_AOIP_RTP_PT_PCMU 0 +#define OSMO_AOIP_RTP_PT_PCMA 8 + +/* compressed speech */ +#define OSMO_AOIP_RTP_PT_FR1 3 +#define OSMO_AOIP_RTP_PT_EFR 110 +#define OSMO_AOIP_RTP_PT_HR1 111 +#define OSMO_AOIP_RTP_PT_AMR 112 +#define OSMO_AOIP_RTP_PT_AMRWB 113 + +/* circuit-switched data */ +#define OSMO_AOIP_RTP_PT_CSD 120 /* without redundancy */ +#define OSMO_AOIP_RTP_PT_CSD_RED 121 /* with redundancy */
View file
libosmocore_1.11.3.tar.xz/include/osmocom/gsm/protocol/ipaccess.h -> libosmocore_1.12.0.tar.xz/include/osmocom/gsm/protocol/ipaccess.h
Changed
@@ -40,6 +40,7 @@ IPAC_PROTO_EXT_OAP = 0x06, /* Osmocom Authn Protocol */ IPAC_PROTO_EXT_RSPRO = 0x07, /* Remote SIM protocol */ IPAC_PROTO_EXT_PCU = 0x08, /* BSC<->BTS<->PCU communication */ + IPAC_PROTO_EXT_TCAP_ROUTING = 0x09, /* TCAP Routing Protocol */ }; enum ipaccess_msgtype {
View file
libosmocore_1.11.3.tar.xz/include/osmocom/gsm/rtp_extensions.h -> libosmocore_1.12.0.tar.xz/include/osmocom/gsm/rtp_extensions.h
Changed
@@ -11,7 +11,7 @@ * namely, GSM0808_IE_THEMWI_RTP_EXTENSIONS and RSL_IE_OSMO_RTP_EXTENSIONS. * It is based on this authoritative definition: * - * https://www.freecalypso.org/specs/tw-ts-003-v010002.txt + * https://www.freecalypso.org/specs/tw-ts-003-v010100.txt * * Section 5.3 in the above specification defines the assignment of * individual bits in the single value octet. @@ -21,3 +21,5 @@ #define OSMO_RTP_EXT_TWTS001 0x01 #define OSMO_RTP_EXT_TWTS002 0x02 +#define OSMO_RTP_EXT_TWTS006 0x04 +#define OSMO_RTP_EXT_TWTS007 0x08
View file
libosmocore_1.11.3.tar.xz/include/osmocom/vty/Makefile.am -> libosmocore_1.12.0.tar.xz/include/osmocom/vty/Makefile.am
Changed
@@ -12,6 +12,10 @@ cpu_sched_vty.h \ tdef_vty.h \ $(NULL) + +noinst_HEADERS = \ + vty_internal.h \ + $(NULL) endif osmovtydir = $(includedir)/osmocom/vty
View file
libosmocore_1.12.0.tar.xz/include/osmocom/vty/vty_internal.h
Added
@@ -0,0 +1,30 @@ +/* (C) 2025 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> + * + * Author: Pau Espin Pedrol <pespin@sysmocom.de> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#pragma once + +/*! \defgroup vty_internal Osmocom vty internals + * @{ + * \file vty_internal.h */ + +void vty_misc_init(void); + +/*! @} */
View file
libosmocore_1.11.3.tar.xz/osmo-release.sh -> libosmocore_1.12.0.tar.xz/osmo-release.sh
Changed
@@ -2,7 +2,7 @@ VERSION=$1 REL=$2 -if "z$REL" = "z" ; then +help() { echo "usage: make REL=patch|minor|major release" echo echo "optional environment variables:" @@ -14,7 +14,15 @@ echo "See also:" echo "https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release" exit 1 -fi +} + +case "$REL" in + patch|minor|major) + ;; + *) + help + ;; +esac ALLOW_NO_LIBVERSION_CHANGE="${ALLOW_NO_LIBVERSION_CHANGE:-0}" ALLOW_NO_LIBVERSION_DEB_MATCH="${ALLOW_NO_LIBVERSION_DEB_MATCH:-0}" @@ -143,10 +151,10 @@ # Make sure that patches under debian/patches/ apply: check_debian_patch_apply() { - if ! -d "${GIT_TOPDIR}/debian/patches" ; then - return - fi for patch in ${GIT_TOPDIR}/debian/patches/*.patch; do + if ! -e "$patch" ; then + continue + fi git apply --check $patch if $? -ne 0 ; then error "patch no longer applies! $patch"
View file
libosmocore_1.11.3.tar.xz/src/codec/Makefile.am -> libosmocore_1.12.0.tar.xz/src/codec/Makefile.am
Changed
@@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=5:0:1 +LIBVERSION=6:0:2 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
View file
libosmocore_1.11.3.tar.xz/src/codec/gsm620.c -> libosmocore_1.12.0.tar.xz/src/codec/gsm620.c
Changed
@@ -263,6 +263,37 @@ 81, /* Code 3:7 */ }; +/* + * There is no officially defined silence frame for GSM-HR codec like there is + * for GSM-FR. However, if one feeds all-zeros (complete silence) linear PCM + * input to the official GSM-HR encoder, the result will be an endless stream + * of these frames: + * + * R0=00 LPC=164,171,cb Int=0 Mode=0 + * s1=00,00,00 s2=00,00,00 s3=00,00,00 s4=00,00,00 + * + * The following const datum is the above unofficial GSM-HR silence frame in + * the packed RTP format of TS 101 318. + */ +const uint8_t osmo_gsm620_silence_frameGSM_HR_BYTES = { + 0x01, 0x64, 0xB8, 0xE5, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* + * GSM 06.20 defines, by reference to GSM 06.06 C code and GSM 06.07 test + * sequences, a special frame of codec parameters called the decoder homing + * frame (DHF). When a spec-compliant speech decoder processes this frame, + * it resets itself to the spec-defined home state. + * + * The following const datum is GSM-HR DHF in the packed RTP format of + * TS 101 318. + */ +const uint8_t osmo_gsm620_homing_frameGSM_HR_BYTES = { + 0x03, 0x71, 0xAF, 0x61, 0xC8, 0xF2, 0x80, + 0x25, 0x31, 0xC0, 0x00, 0x00, 0x00, 0x00 +}; + /*! Check whether RTP frame contains HR SID code word according to * TS 101 318 §5.2.2 * \paramin rtp_payload Buffer with RTP payload
View file
libosmocore_1.11.3.tar.xz/src/codec/gsm660.c -> libosmocore_1.12.0.tar.xz/src/codec/gsm660.c
Changed
@@ -258,6 +258,21 @@ 246, /* 259 -> PULSE 4_10: b0 */ }; +/* + * GSM 06.60 defines (in Table 7) a special frame of codec parameters called + * the decoder homing frame (DHF). When a spec-compliant speech decoder + * processes this frame, it resets itself to the spec-defined home state. + * + * The following const datum is GSM-EFR DHF in the packed RTP format of + * TS 101 318 or RFC 3551. + */ +const uint8_t osmo_gsm660_homing_frameGSM_EFR_BYTES = { + 0xC0, 0x85, 0xEB, 0x49, 0x0F, 0xAA, 0xD6, 0x03, + 0xE3, 0xA1, 0x86, 0x07, 0xB0, 0xC4, 0x2C, 0x08, + 0x04, 0x80, 0x55, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + static const uint8_t sid_code_word_bits95 = { /* bit numbers are relative to "pure" EFR frame beginning, * not counting the signature bits. */
View file
libosmocore_1.11.3.tar.xz/src/codec/gsm690.c -> libosmocore_1.12.0.tar.xz/src/codec/gsm690.c
Changed
@@ -322,6 +322,262 @@ return n_bits; } +/*! This table provides the number of s-bits (as defined in TS 26.090 and + * TS 26.092, clause 7 in each spec) for every possible speech or SID mode + * in AMR. It differs from gsm690_bitlength in the case of SID: there are + * 35 s-bits in the original 2G definition that started out as GSM 06.92, + * captured in this table, whereas 3G-oriented TS 26.101 AMR Core Frame + * definition captured in gsm690_bitlength has 39 d-bits for SID instead. + * + * The array is allocated up to AMR_NO_DATA in order to reduce the probability + * of buggy code making an out-of-bounds read access. + */ +const uint8_t osmo_amr_sbits_per_modeAMR_NO_DATA+1 = { + AMR_4_75 = 95, + AMR_5_15 = 103, + AMR_5_90 = 118, + AMR_6_70 = 134, + AMR_7_40 = 148, + AMR_7_95 = 159, + AMR_10_2 = 204, + AMR_12_2 = 244, + AMR_SID = 35, +}; + +/*! This table provides the number of distinct codec parameters (groupings + * of s-bits into 16-bit parameter words as implemented in 3GPP reference + * C code and assumed in TS 26.073 definition of decoder homing frames) + * that exist for every possible speech or SID mode in AMR. + * + * The array is allocated up to AMR_NO_DATA in order to reduce the probability + * of buggy code making an out-of-bounds read access. + */ +const uint8_t osmo_amr_params_per_modeAMR_NO_DATA+1 = { + AMR_4_75 = 17, + AMR_5_15 = 19, + AMR_5_90 = 19, + AMR_6_70 = 19, + AMR_7_40 = 19, + AMR_7_95 = 23, + AMR_10_2 = 39, + AMR_12_2 = 57, + AMR_SID = 5, +}; + +/* parameter sizes (# of bits), one table per mode */ + +static const uint8_t bit_counts_4_7517 = { + 8, 8, 7, /* LSP VQ */ + 8, 7, 2, 8, /* 1st subframe */ + 4, 7, 2, /* 2nd subframe */ + 4, 7, 2, 8, /* 3rd subframe */ + 4, 7, 2, /* 4th subframe */ +}; + +static const uint8_t bit_counts_5_1519 = { + 8, 8, 7, /* LSP VQ */ + 8, 7, 2, 6, /* 1st subframe */ + 4, 7, 2, 6, /* 2nd subframe */ + 4, 7, 2, 6, /* 3rd subframe */ + 4, 7, 2, 6, /* 4th subframe */ +}; + +static const uint8_t bit_counts_5_9019 = { + 8, 9, 9, /* LSP VQ */ + 8, 9, 2, 6, /* 1st subframe */ + 4, 9, 2, 6, /* 2nd subframe */ + 8, 9, 2, 6, /* 3rd subframe */ + 4, 9, 2, 6, /* 4th subframe */ +}; + +static const uint8_t bit_counts_6_7019 = { + 8, 9, 9, /* LSP VQ */ + 8, 11, 3, 7, /* 1st subframe */ + 4, 11, 3, 7, /* 2nd subframe */ + 8, 11, 3, 7, /* 3rd subframe */ + 4, 11, 3, 7, /* 4th subframe */ +}; + +static const uint8_t bit_counts_7_4019 = { + 8, 9, 9, /* LSP VQ */ + 8, 13, 4, 7, /* 1st subframe */ + 5, 13, 4, 7, /* 2nd subframe */ + 8, 13, 4, 7, /* 3rd subframe */ + 5, 13, 4, 7, /* 4th subframe */ +}; + +static const uint8_t bit_counts_7_9523 = { + 9, 9, 9, /* LSP VQ */ + 8, 13, 4, 4, 5, /* 1st subframe */ + 6, 13, 4, 4, 5, /* 2nd subframe */ + 8, 13, 4, 4, 5, /* 3rd subframe */ + 6, 13, 4, 4, 5, /* 4th subframe */ +}; + +static const uint8_t bit_counts_10_239 = { + 8, 9, 9, /* LSP VQ */ + 8, 1, 1, 1, 1, 10, 10, 7, 7, /* 1st subframe */ + 5, 1, 1, 1, 1, 10, 10, 7, 7, /* 2nd subframe */ + 8, 1, 1, 1, 1, 10, 10, 7, 7, /* 3rd subframe */ + 5, 1, 1, 1, 1, 10, 10, 7, 7, /* 4th subframe */ +}; + +static const uint8_t bit_counts_12_257 = { + 7, 8, 9, 8, 6, /* LSP VQ */ + 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* 1st subframe */ + 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* 2nd subframe */ + 9, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* 3rd subframe */ + 6, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 5, /* 4th subframe */ +}; + +static const uint8_t bit_counts_sid5 = { 3, 8, 9, 9, 6 }; + +/* overall table with all parameter sizes for all modes */ +static const uint8_t * const bit_counts_per_modeAMR_SID + 1 = { + bit_counts_4_75, + bit_counts_5_15, + bit_counts_5_90, + bit_counts_6_70, + bit_counts_7_40, + bit_counts_7_95, + bit_counts_10_2, + bit_counts_12_2, + bit_counts_sid, +}; + +/*! Convert AMR codec frame from parameters to s-bits + * + * \paramout s_bits Caller-provided array of unpacked bits to be filled + * with s-bits of the converted codec frame. + * \paramin param Array of AMR codec speech or SID parameters. + * \paramin mode Speech or SID mode according to which conversion shall + * be performed. + * \returns 0 if successful, or negative if \ref mode is invalid. + */ +int osmo_amr_param_to_sbits(ubit_t *s_bits, const uint16_t *param, + enum osmo_amr_type mode) +{ + if (mode > AMR_SID) + return -EINVAL; + + const uint8_t *table = bit_counts_per_modemode; + unsigned nparam = osmo_amr_params_per_modemode; + unsigned n, p, mask; + ubit_t *b = s_bits; + + for (n = 0; n < nparam; n++) { + p = paramn; + mask = 1 << (*table++ - 1); + for (; mask; mask >>= 1) { + if (p & mask) + *b++ = 1; + else + *b++ = 0; + } + } + return 0; +} + +/*! Convert AMR codec frame from s-bits to parameters + * + * \paramout param Caller-provided buffer for array of AMR codec speech + * or SID parameters. + * \paramin s_bits Unpacked s-bits of the frame to be converted. + * \paramin mode Speech or SID mode according to which conversion shall + * be performed. + * \returns 0 if successful, or negative if \ref mode is invalid. + */ +int osmo_amr_sbits_to_param(uint16_t *param, const ubit_t *s_bits, + enum osmo_amr_type mode) +{ + if (mode > AMR_SID) + return -EINVAL; + + const ubit_t *bit = s_bits; + const uint8_t *table = bit_counts_per_modemode; + unsigned nparam = osmo_amr_params_per_modemode; + unsigned n, m, acc; + + for (n = 0; n < nparam; n++) { + acc = 0; + for (m = 0; m < *table; m++) { + acc <<= 1; + if (*bit) + acc |= 1; + bit++; + } + paramn = acc; + table++; + } + return 0; +} + +/* For each of the 8 modes of AMR codec, there exists a special encoded frame + * bit pattern which the speech decoder is required to recognize as a special + * decoder homing frame (DHF), as specified in TS 26.090 section 8.4. Bit + * patterns of these 8 DHFs are specified in TS 26.073 Tables 9a through 9h + * and captured in the following const arrays. Note that the canonical form + * of each DHF is an array of codec parameters; in order to emit any of these + * DHFs as an RTP payload or a TRAU frame, the application will need to + * convert it to s-bits with osmo_amr_param_to_sbits(), followed by + * osmo_amr_s_to_d() in the case of RTP output. + */ + +const uint16_t osmo_amr_dhf_4_7517 = { + 0x00F8, 0x009D, 0x001C, 0x0066, 0x0000, 0x0003, 0x0028, 0x000F, + 0x0038, 0x0001, 0x000F, 0x0031, 0x0002, 0x0008, 0x000F, 0x0026, + 0x0003 +}; + +const uint16_t osmo_amr_dhf_5_1519 = { + 0x00F8, 0x009D, 0x001C, 0x0066, 0x0000, 0x0003, 0x0037, 0x000F, + 0x0000, 0x0003, 0x0005, 0x000F, 0x0037, 0x0003, 0x0037, 0x000F, + 0x0023, 0x0003, 0x001F +}; + +const uint16_t osmo_amr_dhf_5_9019 = { + 0x00F8, 0x00E3, 0x002F, 0x00BD, 0x0000, 0x0003, 0x0037, 0x000F, + 0x0001, 0x0003, 0x000F, 0x0060, 0x00F9, 0x0003, 0x0037, 0x000F, + 0x0000, 0x0003, 0x0037 +}; + +const uint16_t osmo_amr_dhf_6_7019 = { + 0x00F8, 0x00E3, 0x002F, 0x00BD, 0x0002, 0x0007, 0x0000, 0x000F, + 0x0098, 0x0007, 0x0061, 0x0060, 0x05C5, 0x0007, 0x0000, 0x000F, + 0x0318, 0x0007, 0x0000 +}; + +const uint16_t osmo_amr_dhf_7_4019 = { + 0x00F8, 0x00E3, 0x002F, 0x00BD, 0x0006, 0x000F, 0x0000, 0x001B, + 0x0208, 0x000F, 0x0062, 0x0060, 0x1BA6, 0x000F, 0x0000, 0x001B, + 0x0006, 0x000F, 0x0000 +}; + +const uint16_t osmo_amr_dhf_7_9523 = { + 0x00C2, 0x00E3, 0x002F, 0x00BD, 0x0006, 0x000F, 0x000A, 0x0000, + 0x0039, 0x1C08, 0x0007, 0x000A, 0x000B, 0x0063, 0x11A6, 0x000F, + 0x0001, 0x0000, 0x0039, 0x09A0, 0x000F, 0x0002, 0x0001 +}; + +const uint16_t osmo_amr_dhf_10_239 = { + 0x00F8, 0x00E3, 0x002F, 0x0045, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x001B, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0326, 0x00CE, 0x007E, 0x0051, 0x0062, 0x0000, 0x0000, + 0x0000, 0x0000, 0x015A, 0x0359, 0x0076, 0x0000, 0x001B, 0x0000, + 0x0000, 0x0000, 0x0000, 0x017C, 0x0215, 0x0038, 0x0030 +}; + +const uint16_t osmo_amr_dhf_12_257 = { + 0x0004, 0x002A, 0x00DB, 0x0096, 0x002A, 0x0156, 0x000B, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0036, 0x000B, 0x0000, 0x000F, 0x000E, 0x000C, + 0x000D, 0x0000, 0x0001, 0x0005, 0x0007, 0x0001, 0x0008, 0x0024, + 0x0000, 0x0001, 0x0000, 0x0005, 0x0006, 0x0001, 0x0002, 0x0004, + 0x0007, 0x0004, 0x0002, 0x0003, 0x0036, 0x000B, 0x0000, 0x0002, + 0x0004, 0x0000, 0x0003, 0x0006, 0x0001, 0x0007, 0x0006, 0x0005, + 0x0000 +}; + /* See also RFC 4867 §3.6, Table 1, Column "Total speech bits" */ static const uint8_t amr_len_by_ft16 = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0
View file
libosmocore_1.11.3.tar.xz/src/core/Makefile.am -> libosmocore_1.12.0.tar.xz/src/core/Makefile.am
Changed
@@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=23:1:1 +LIBVERSION=24:0:2 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS) $(LIBSCTP_CFLAGS) $(LIBMNL_CFLAGS) $(URING_CFLAGS)
View file
libosmocore_1.11.3.tar.xz/src/core/libosmocore.map -> libosmocore_1.12.0.tar.xz/src/core/libosmocore.map
Changed
@@ -256,6 +256,7 @@ osmo_init_logging2; osmo_int_to_float_str_buf; osmo_int_to_float_str_c; +osmo_io_get_backend; osmo_io_backend_names; osmo_iofd_close; osmo_iofd_free; @@ -274,6 +275,8 @@ osmo_iofd_sendmsg_msgb; osmo_iofd_set_alloc_info; osmo_iofd_set_cmsg_size; +osmo_iofd_set_io_buffers; +osmo_iofd_set_sqes; osmo_iofd_set_data; osmo_iofd_set_ioops; osmo_iofd_set_priv_nr;
View file
libosmocore_1.11.3.tar.xz/src/core/logging.c -> libosmocore_1.12.0.tar.xz/src/core/logging.c
Changed
@@ -393,6 +393,12 @@ .enabled = 1, .loglevel = LOGL_NOTICE, .color = "\03338;5;67m", }, + INT2IDX(DLTCAP) = { + .name = "DLTCAP", + .description = "TCAP", + .enabled = 1, .loglevel = LOGL_NOTICE, + .color = "\03338;5;69m", + }, }; void assert_loginfo(const char *src)
View file
libosmocore_1.11.3.tar.xz/src/core/osmo_io.c -> libosmocore_1.12.0.tar.xz/src/core/osmo_io.c
Changed
@@ -122,6 +122,13 @@ osmo_iofd_init(); } +/*! Obtain the osmo_io_backend in use by the process + * \returns The osmo_io backend which was configured at startup time */ +enum osmo_io_backend osmo_io_get_backend(void) +{ + return g_io_backend; +} + /*! Allocate the msghdr. * \paramin iofd the osmo_io file structure * \paramin action the action this msg(hdr) is for (read, write, ..) @@ -131,28 +138,38 @@ struct iofd_msghdr *iofd_msghdr_alloc(struct osmo_io_fd *iofd, enum iofd_msg_action action, struct msgb *msg, size_t cmsg_size) { - bool free_msg = false; struct iofd_msghdr *hdr; + uint8_t idx, io_len; - if (!msg) { - msg = iofd_msgb_alloc(iofd); - if (!msg) - return NULL; - free_msg = true; - } else { - talloc_steal(iofd, msg); - } hdr = talloc_zero_size(iofd, sizeof(struct iofd_msghdr) + cmsg_size); - if (!hdr) { - if (free_msg) - talloc_free(msg); + if (!hdr) return NULL; - } hdr->action = action; hdr->iofd = iofd; - hdr->msg = msg; + + /* Allocate the number of read buffers, configured by the user. Use msg as first buffer, if not NULL. + * Only READ may have multiple buffers, because packets will only be written to the first buffer. */ + io_len = (action == IOFD_ACT_READ) ? iofd->io_read_buffers : 1; + for (idx = 0; idx < io_len; idx++) { + if (msg) { + talloc_steal(iofd, msg); + hdr->msgidx = msg; + msg = NULL; + } else { + hdr->msgidx = iofd_msgb_alloc(iofd); + if (!hdr->msgidx) + break; + } + } + /* If at least one msgb is allocated, we can continue with only one msgb, instead of completely failing. */ + if (idx == 0) { + talloc_free(hdr); + return NULL; + } + + hdr->io_len = idx; return hdr; } @@ -167,36 +184,19 @@ talloc_free(msghdr); } -/*! convenience wrapper to call msgb_alloc with parameters from osmo_io_fd */ -struct msgb *iofd_msgb_alloc(struct osmo_io_fd *iofd) +/*! convenience wrapper to call msgb_alloc with parameters from osmo_io_fd (of given size) */ +struct msgb *iofd_msgb_alloc2(struct osmo_io_fd *iofd, size_t size) { - uint16_t headroom = iofd->msgb_alloc.headroom; - - OSMO_ASSERT(iofd->msgb_alloc.size <= 0xffff - headroom); - return msgb_alloc_headroom_c(iofd, iofd->msgb_alloc.size + headroom, headroom, "osmo_io_msgb"); -} - -/*! return the pending msgb in iofd or NULL if there is none*/ -struct msgb *iofd_msgb_pending(struct osmo_io_fd *iofd) -{ - struct msgb *msg = NULL; - - msg = iofd->pending; - iofd->pending = NULL; + size_t headroom = iofd->msgb_alloc.headroom; - return msg; + OSMO_ASSERT(size + headroom <= 0xffff); + return msgb_alloc_headroom_c(iofd, (uint16_t)(size + headroom), (uint16_t)headroom, "osmo_io_msgb"); } -/*! Return the pending msgb or allocate and return a new one */ -struct msgb *iofd_msgb_pending_or_alloc(struct osmo_io_fd *iofd) +/*! convenience wrapper to call msgb_alloc with parameters from osmo_io_fd */ +struct msgb *iofd_msgb_alloc(struct osmo_io_fd *iofd) { - struct msgb *msg = NULL; - - msg = iofd_msgb_pending(iofd); - if (!msg) - msg = iofd_msgb_alloc(iofd); - - return msg; + return iofd_msgb_alloc2(iofd, iofd->msgb_alloc.size); } /*! Enqueue a message to be sent. @@ -247,21 +247,52 @@ */ struct iofd_msghdr *iofd_txqueue_dequeue(struct osmo_io_fd *iofd) { - struct llist_head *lh; + struct iofd_msghdr *msghdr; if (iofd->tx_queue.current_length == 0) return NULL; - lh = iofd->tx_queue.msg_queue.next; + msghdr = llist_first_entry_or_null(&iofd->tx_queue.msg_queue, struct iofd_msghdr, list); - OSMO_ASSERT(lh); + OSMO_ASSERT(msghdr); iofd->tx_queue.current_length--; - llist_del(lh); + llist_del(&msghdr->list); + + /* Fill up empty buffers in dequeued msghdr with buffers from the next msghdr. + * There can be empty buffers, when a msghdr is queued to the front with incomplete write. */ + while (OSMO_UNLIKELY(msghdr->io_len < iofd->io_write_buffers)) { + struct iofd_msghdr *next; + int i; + + if (iofd->tx_queue.current_length == 0) + break; + next = llist_first_entry_or_null(&iofd->tx_queue.msg_queue, struct iofd_msghdr, list); + OSMO_ASSERT(next->io_len > 0); + /* Get first message buffer from next msghdr and store them in the dequeued one. */ + msghdr->iovmsghdr->io_len = next->iov0; + msghdr->msgmsghdr->io_len = next->msg0; + msghdr->hdr.msg_iovlen = ++msghdr->io_len; + /* Remove the message buffer from the next msghdr and free, if empty. */ + next->io_len--; + for (i = 0; i < next->io_len; i++) { + next->iovi = next->iovi + 1; + next->msgi = next->msgi + 1; + } + if (next->io_len == 0) { + iofd->tx_queue.current_length--; + llist_del(&next->list); + iofd_msghdr_free(next); + } else { + memset(&next->iovnext->io_len, 0, sizeof(struct iovec)); + next->msgnext->io_len = NULL; + next->hdr.msg_iovlen = --next->io_len; + } + } if (iofd->tx_queue.current_length == 0) osmo_iofd_ops.write_disable(iofd); - return llist_entry(lh, struct iofd_msghdr, list); + return msghdr; } /*! Handle segmentation of the msg. If this function returns *_HANDLE_ONE or MORE then the data in msg will contain @@ -336,10 +367,30 @@ OSMO_ASSERT(iofd->mode == OSMO_IO_FD_MODE_READ_WRITE); if (rc <= 0) { + talloc_steal(iofd->msgb_alloc.ctx, msg); iofd->io_ops.read_cb(iofd, rc, msg); return; } + /* If we have a pending message, append the received message. + * If the pending message is not large enough, create a larger message. */ + if (OSMO_UNLIKELY(iofd->pending)) { + if (OSMO_UNLIKELY(msgb_tailroom(iofd->pending) < msgb_length(msg))) { + /* Data of msg does not fit into pending message. Allocate a new message that is larger. + * This implies that msgb_length(iofd->pending) + msgb_length(msg) > iofd.msgb_alloc.size. */ + pending = iofd_msgb_alloc2(iofd, msgb_length(iofd->pending) + msgb_length(msg)); + OSMO_ASSERT(pending); + memcpy(msgb_put(pending, msgb_length(iofd->pending)), msgb_data(iofd->pending), + msgb_length(iofd->pending)); + msgb_free(iofd->pending); + iofd->pending = pending; + } + memcpy(msgb_put(iofd->pending, msgb_length(msg)), msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + msg = iofd->pending; + iofd->pending = NULL; + } + do { pending = NULL; res = iofd_handle_segmentation(iofd, msg, &pending); @@ -347,6 +398,7 @@ /* It it expected as per API spec that we return the * return value of read here. The amount of bytes in msg is * available to the user in msg itself. */ + talloc_steal(iofd->msgb_alloc.ctx, msg); iofd->io_ops.read_cb(iofd, rc, msg); /* The user could unregister/close the iofd during read_cb() above. * Once that's done, it doesn't expect to receive any more events, @@ -371,15 +423,16 @@ * \paramin hdr serialized msghdr containing state of completed I/O */ void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *hdr) { - talloc_steal(iofd->msgb_alloc.ctx, msg); switch (iofd->mode) { case OSMO_IO_FD_MODE_READ_WRITE: iofd_handle_segmented_read(iofd, msg, rc); break; case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + talloc_steal(iofd->msgb_alloc.ctx, msg); iofd->io_ops.recvfrom_cb(iofd, rc, msg, &hdr->osa); break; case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: + talloc_steal(iofd->msgb_alloc.ctx, msg); iofd->io_ops.recvmsg_cb(iofd, rc, msg, &hdr->hdr); break; default: @@ -395,42 +448,74 @@ */ void iofd_handle_send_completion(struct osmo_io_fd *iofd, int rc, struct iofd_msghdr *msghdr) { - struct msgb *msg = msghdr->msg; + int idx, i; - /* Incomplete write */ - if (rc > 0 && rc < msgb_length(msg)) { - /* Re-enqueue remaining data */ - msgb_pull(msg, rc); - msghdr->iov0.iov_len = msgb_length(msg); - iofd_txqueue_enqueue_front(iofd, msghdr); - return; - } - - /* Reenqueue the complete msgb */ + /* Re-enqueue the complete msgb. */ if (rc == -EAGAIN) { iofd_txqueue_enqueue_front(iofd, msghdr); return; } - /* All other failure and success cases are handled here */ - switch (msghdr->action) { - case IOFD_ACT_WRITE: - if (iofd->io_ops.write_cb) - iofd->io_ops.write_cb(iofd, rc, msg); - break; - case IOFD_ACT_SENDTO: - if (iofd->io_ops.sendto_cb) - iofd->io_ops.sendto_cb(iofd, rc, msg, &msghdr->osa); - break; - case IOFD_ACT_SENDMSG: - if (iofd->io_ops.sendmsg_cb) - iofd->io_ops.sendmsg_cb(iofd, rc, msg); - break; - default: - OSMO_ASSERT(0); - } + for (idx = 0; idx < msghdr->io_len; idx++) { + struct msgb *msg = msghdr->msgidx; + int chunk; + + /* Incomplete write */ + if (rc > 0 && rc < msgb_length(msg)) { + /* Keep msg with unsent data only. */ + msgb_pull(msg, rc); + msghdr->iovidx.iov_len = msgb_length(msg); + /* Shift all existing buffers down. */ + if (idx) { + msghdr->io_len -= idx; + for (i = 0; i < msghdr->io_len; i++) { + msghdr->iovi = msghdr->iovidx + i; + msghdr->msgi = msghdr->msgidx + i; + } + for (i = 0; i < idx; i++) { + memset(&msghdr->iovmsghdr->io_len + i, 0, sizeof(struct iovec)); + msghdr->msgmsghdr->io_len + i = NULL; + } + msghdr->hdr.msg_iovlen = msghdr->io_len; + } + /* Re-enqueue remaining buffers. */ + iofd_txqueue_enqueue_front(iofd, msghdr); + return; + } + + if (rc >= 0) { + chunk = msgb_length(msg); + if (rc < chunk) + chunk = rc; + } else { + chunk = rc; + } + + /* All other failure and success cases are handled here */ + switch (msghdr->action) { + case IOFD_ACT_WRITE: + if (iofd->io_ops.write_cb) + iofd->io_ops.write_cb(iofd, chunk, msg); + break; + case IOFD_ACT_SENDTO: + if (iofd->io_ops.sendto_cb) + iofd->io_ops.sendto_cb(iofd, chunk, msg, &msghdr->osa); + break; + case IOFD_ACT_SENDMSG: + if (iofd->io_ops.sendmsg_cb) + iofd->io_ops.sendmsg_cb(iofd, chunk, msg); + break; + default: + OSMO_ASSERT(0); + } - msgb_free(msghdr->msg); + msgb_free(msghdr->msgidx); + msghdr->msgidx = NULL; + + /* The user can unregister/close the iofd during callback above. */ + if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) + break; + } iofd_msghdr_free(msghdr); } @@ -453,6 +538,8 @@ int osmo_iofd_write_msgb(struct osmo_io_fd *iofd, struct msgb *msg) { int rc; + struct iofd_msghdr *msghdr; + int idx; if (OSMO_UNLIKELY(msgb_length(msg) == 0)) { LOGPIO(iofd, LOGL_ERROR, "Length is 0, rejecting msgb.\n"); @@ -461,21 +548,35 @@ OSMO_ASSERT(iofd->mode == OSMO_IO_FD_MODE_READ_WRITE); - struct iofd_msghdr *msghdr = iofd_msghdr_alloc(iofd, IOFD_ACT_WRITE, msg, 0); - if (!msghdr) - return -ENOMEM; - - msghdr->flags = MSG_NOSIGNAL; - msghdr->iov0.iov_base = msgb_data(msghdr->msg); - msghdr->iov0.iov_len = msgb_length(msghdr->msg); - msghdr->hdr.msg_iov = &msghdr->iov0; - msghdr->hdr.msg_iovlen = 1; - - rc = iofd_txqueue_enqueue(iofd, msghdr); - if (rc < 0) { - iofd_msghdr_free(msghdr); - LOGPIO(iofd, LOGL_ERROR, "enqueueing message failed (%d). Rejecting msgb\n", rc); - return rc; + /* Always try to add msg to last msghdr. Only if it is completely filled, allocate a new msghdr. + * This way all the previous meghdrs in the queue are completely filled. */ + msghdr = llist_last_entry_or_null(&iofd->tx_queue.msg_queue, struct iofd_msghdr, list); + if (msghdr && msghdr->io_len < iofd->io_write_buffers) { + /* Add msg to existing msghdr. */ + msghdr->msgmsghdr->io_len++ = msg; + } else { + /* Create new msghdr with msg. */ + msghdr = iofd_msghdr_alloc(iofd, IOFD_ACT_WRITE, msg, 0); + if (!msghdr) + return -ENOMEM; + msghdr->hdr.msg_iov = &msghdr->iov0; + msghdr->flags = MSG_NOSIGNAL; + } + + /* Add set IO vector to msg. */ + idx = msghdr->io_len - 1; + msghdr->iovidx.iov_base = msgb_data(msg); + msghdr->iovidx.iov_len = msgb_length(msg); + msghdr->hdr.msg_iovlen = msghdr->io_len; + + /* Only new msghdr will be enqueued. */ + if (msghdr->io_len == 1) { + rc = iofd_txqueue_enqueue(iofd, msghdr); + if (rc < 0) { + iofd_msghdr_free(msghdr); + LOGPIO(iofd, LOGL_ERROR, "enqueueing message failed (%d). Rejecting msgb\n", rc); + return rc; + } } return 0; @@ -518,8 +619,8 @@ msghdr->hdr.msg_namelen = osmo_sockaddr_size(&msghdr->osa); } msghdr->flags = sendto_flags; - msghdr->iov0.iov_base = msgb_data(msghdr->msg); - msghdr->iov0.iov_len = msgb_length(msghdr->msg); + msghdr->iov0.iov_base = msgb_data(msghdr->msg0); + msghdr->iov0.iov_len = msgb_length(msghdr->msg0); msghdr->hdr.msg_iov = &msghdr->iov0; msghdr->hdr.msg_iovlen = 1; @@ -583,8 +684,8 @@ } /* build iov from msgb */ - msghdr->iov0.iov_base = msgb_data(msghdr->msg); - msghdr->iov0.iov_len = msgb_length(msghdr->msg); + msghdr->iov0.iov_base = msgb_data(msghdr->msg0); + msghdr->iov0.iov_len = msgb_length(msghdr->msg0); msghdr->hdr.msg_iov = &msghdr->iov0; msghdr->hdr.msg_iovlen = 1; @@ -712,6 +813,17 @@ iofd->tx_queue.max_length = 1024; INIT_LLIST_HEAD(&iofd->tx_queue.msg_queue); + iofd->io_read_buffers = 1; + iofd->io_write_buffers = 1; + + if (osmo_iofd_ops.setup) { + int rc = osmo_iofd_ops.setup(iofd); + if (rc < 0) { + osmo_iofd_free(iofd); + return NULL; + } + } + return iofd; } @@ -729,6 +841,70 @@ return 0; } +/*! Set the number of buffers that can be used in a single read or write operation. + * + * If the osmo_io_fd is in OSMO_IO_FD_MODE_READ_WRITE mode, this API function can be used to tell the + * osmo_io proecess how many buffers should be read or written with a single read or write operation. + * This feature is supported with io_uring backend only. + * + * \paramin iofd the iofd file descriptor + * \paramin op the osmo_io_op (read or write) to set the number of IO buffers for + * \paramin buffers the number of IO buffer for each specified operation + * \returns zero on success, a negative value on error + */ +int osmo_iofd_set_io_buffers(struct osmo_io_fd *iofd, enum osmo_io_op op, uint8_t buffers) +{ + if (iofd->mode != OSMO_IO_FD_MODE_READ_WRITE) + return -EINVAL; + + if (g_io_backend != OSMO_IO_BACKEND_IO_URING) + return -EINVAL; + + if (buffers < 1 || buffers > IOFD_MSGHDR_IO_BUFFERS) + return -EINVAL; + + switch (op) { + case OSMO_IO_OP_READ: + iofd->io_read_buffers = buffers; + break; + case OSMO_IO_OP_WRITE: + iofd->io_write_buffers = buffers; + break; + default: + return -EINVAL; + } + return 0; +} + +/*! Set the number of SQEs that are submitted to an io_unring before completion is received. + * + * If the io_using backend is selected, this API function can be used to tell the osmo_io process how many SQE are + * scheduled in advance. + * The feature is currently supports scheduling read SQEs only. + * + * \paramin iofd the iofd file descriptor + * \paramin op the osmo_io_op (read) to set the number of IO buffers for + * \paramin number of scheduled SQEs + * \returns zero on success, a negative value on error + */ +int osmo_iofd_set_sqes(struct osmo_io_fd *iofd, enum osmo_io_op op, uint8_t sqes) +{ + if (iofd->mode != OSMO_IO_FD_MODE_READ_WRITE) + return -EINVAL; + + if (g_io_backend != OSMO_IO_BACKEND_IO_URING) + return -EINVAL; + + if (op != OSMO_IO_OP_READ) + return -EINVAL; + + if (sqes < 1 || sqes > IOFD_MSGHDR_MAX_READ_SQES) + return -EINVAL; + + iofd->u.uring.read.num_sqes = sqes; + return 0; +} + /*! Register the osmo_io_fd for active I/O. * * Calling this function will register a previously initialized osmo_io_fd for performing I/O. @@ -824,7 +1000,10 @@ { struct iofd_msghdr *hdr; while ((hdr = iofd_txqueue_dequeue(iofd))) { - msgb_free(hdr->msg); + for (int idx = 0; idx < hdr->io_len; idx++) { + msgb_free(hdr->msgidx); + hdr->msgidx = NULL; + } iofd_msghdr_free(hdr); } }
View file
libosmocore_1.11.3.tar.xz/src/core/osmo_io_internal.h -> libosmocore_1.12.0.tar.xz/src/core/osmo_io_internal.h
Changed
@@ -25,6 +25,7 @@ #endif struct iofd_backend_ops { + int (*setup)(struct osmo_io_fd *iofd); int (*register_fd)(struct osmo_io_fd *iofd); int (*unregister_fd)(struct osmo_io_fd *iofd); int (*close)(struct osmo_io_fd *iofd); @@ -49,6 +50,8 @@ #define IOFD_FLAG_ISSET(iofd, flag) ((iofd)->flags & (flag)) +#define IOFD_MSGHDR_MAX_READ_SQES 32 + struct osmo_io_fd { /*! linked list for internal management */ struct llist_head list; @@ -76,6 +79,12 @@ /*! size of iofd_msghdr.cmsg when allocated in recvmsg path */ size_t cmsg_size; + /*! maximum number of message-buffers per read operation */ + uint8_t io_read_buffers; + + /*! maximum number of message-buffers per write operation */ + uint8_t io_write_buffers; + struct { /*! talloc context from which to allocate msgb when reading */ const void *ctx; @@ -99,10 +108,26 @@ struct osmo_fd ofd; } poll; struct { - bool read_enabled; - bool write_enabled; - void *read_msghdr; - void *write_msghdr; + struct { + /*! read is enabled, due to registration of callback function */ + bool enabled; + /*! requested number of simultaniously submitted read SQEs */ + uint8_t num_sqes; + /*! array of simultaneously submitted read SQEs */ + void *msghdrIOFD_MSGHDR_MAX_READ_SQES; + /*! ring the read SQEs have been submitted to */ + struct io_uring *ring; + /*! current number of simultaneously submitted read SQEs */ + uint8_t sqes_submitted; + } read; + struct { + /*! write is enabled, due to pending msghdr in tx_queue */ + bool enabled; + /*! submitted write SQE */ + void *msghdr; + /*! ring the write SQE has been submitted to */ + struct io_uring *ring; + } write; /* TODO: index into array of registered fd's? */ /* osmo_fd for non-blocking connect handling */ struct osmo_fd connect_ofd; @@ -119,6 +144,7 @@ IOFD_ACT_SENDMSG, }; +#define IOFD_MSGHDR_IO_BUFFERS 8 /*! serialized version of 'struct msghdr' employed by sendmsg/recvmsg */ struct iofd_msghdr { @@ -131,15 +157,20 @@ struct osmo_sockaddr osa; /*! io-vector we need to pass as argument to sendmsg/recvmsg; is set up * to point into msg below */ - struct iovec iov1; + struct iovec iovIOFD_MSGHDR_IO_BUFFERS; /*! flags we pass as argument to sendmsg / recvmsg */ int flags; + /*! current number of message-buffers that are stored */ + uint8_t io_len; /*! message-buffer containing data for this I/O operation */ - struct msgb *msg; + struct msgb *msgIOFD_MSGHDR_IO_BUFFERS; /*! I/O file descriptor on which we perform this I/O operation */ struct osmo_io_fd *iofd; + /*! msghdr is in the cancel_queue list */ + bool in_cancel_queue; + /*! control message buffer for passing sctp_sndrcvinfo along */ char cmsg0; /* size is determined by iofd->cmsg_size on recvmsg, and by mcghdr->msg_controllen on sendmsg */ }; @@ -153,9 +184,8 @@ struct iofd_msghdr *iofd_msghdr_alloc(struct osmo_io_fd *iofd, enum iofd_msg_action action, struct msgb *msg, size_t cmsg_size); void iofd_msghdr_free(struct iofd_msghdr *msghdr); +struct msgb *iofd_msgb_alloc2(struct osmo_io_fd *iofd, size_t size); struct msgb *iofd_msgb_alloc(struct osmo_io_fd *iofd); -struct msgb *iofd_msgb_pending(struct osmo_io_fd *iofd); -struct msgb *iofd_msgb_pending_or_alloc(struct osmo_io_fd *iofd); void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *msghdr); void iofd_handle_send_completion(struct osmo_io_fd *iofd, int rc, struct iofd_msghdr *msghdr);
View file
libosmocore_1.11.3.tar.xz/src/core/osmo_io_poll.c -> libosmocore_1.12.0.tar.xz/src/core/osmo_io_poll.c
Changed
@@ -50,7 +50,7 @@ if (what & OSMO_FD_READ) { struct iofd_msghdr hdr; - msg = iofd_msgb_pending_or_alloc(iofd); + msg = iofd_msgb_alloc(iofd); if (!msg) { LOGPIO(iofd, LOGL_ERROR, "Could not allocate msgb for reading\n"); OSMO_ASSERT(0); @@ -65,7 +65,7 @@ break; case OSMO_IO_FD_MODE_RECVFROM_SENDTO: case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: - hdr.msg = msg; + hdr.msg0 = msg; hdr.iov0.iov_base = msg->tail; hdr.iov0.iov_len = msgb_tailroom(msg); hdr.hdr = (struct msghdr) {
View file
libosmocore_1.11.3.tar.xz/src/core/osmo_io_uring.c -> libosmocore_1.12.0.tar.xz/src/core/osmo_io_uring.c
Changed
@@ -35,6 +35,7 @@ #include <string.h> #include <stdbool.h> #include <errno.h> +#include <limits.h> #include <netinet/in.h> #include <netinet/sctp.h> @@ -52,17 +53,36 @@ #include "osmo_io_internal.h" -#define IOFD_URING_ENTRIES 4096 +#define IOFD_URING_INITIAL_SIZE 4096 +/* 32768 refers to the IORING_MAX_ENTRIES of the kernel (io_uring/io_uring.h). */ +#define IOFD_URING_MAXIMUM_SIZE 32768 + +#define OSMO_IO_URING_BATCH "LIBOSMO_IO_URING_BATCH" + +#define OSMO_IO_URING_INITIAL_SIZE "LIBOSMO_IO_URING_INITIAL_SIZE" + +#define OSMO_IO_URING_READ_SQE "LIBOSMO_IO_URING_READ_SQE" + +bool g_io_uring_batch = false; +bool g_io_uring_submit_needed = false; + +static int g_io_uring_size = IOFD_URING_INITIAL_SIZE; + +static int g_io_uring_read_sqes = 1; struct osmo_io_uring { struct osmo_fd event_ofd; struct io_uring ring; + struct llist_head cancel_queue; + unsigned int num_pending_submissions; }; -static __thread struct osmo_io_uring g_ring; +static __thread struct osmo_io_uring *g_ring = NULL; static void iofd_uring_cqe(struct io_uring *ring); +void osmo_io_uring_submit(void); + /*! read call-back for eventfd notifying us if entries are in the completion queue */ static int iofd_uring_poll_cb(struct osmo_fd *ofd, unsigned int what) { @@ -88,43 +108,151 @@ /*! initialize the uring and tie it into our event loop */ void osmo_iofd_uring_init(void) { + const char *env; int rc, evfd; - rc = io_uring_queue_init(IOFD_URING_ENTRIES, &g_ring.ring, 0); + if ((env = getenv(OSMO_IO_URING_BATCH))) + g_io_uring_batch = true; + + if (!g_ring && (env = getenv(OSMO_IO_URING_INITIAL_SIZE))) { + int env_value; + rc = osmo_str_to_int(&env_value, env, 10, 1, IOFD_URING_MAXIMUM_SIZE); + if (rc < 0) { + fprintf(stderr, "Error: Initial io_uring size out of range (1..%d).\n", + IOFD_URING_MAXIMUM_SIZE); + exit(1); + } + if ((env_value & (env_value - 1))) { + fprintf(stderr, "Error: Initial io_uring size must be a positive power of two.\n"); + exit(1); + } + g_io_uring_size = env_value; + } + + g_ring = talloc_zero(OTC_GLOBAL, struct osmo_io_uring); + INIT_LLIST_HEAD(&g_ring->cancel_queue); + + rc = io_uring_queue_init(g_io_uring_size, &g_ring->ring, 0); if (rc < 0) osmo_panic("failure during io_uring_queue_init(): %s\n", strerror(-rc)); + if ((env = getenv(OSMO_IO_URING_READ_SQE))) { + g_io_uring_read_sqes = atoi(env); + if (g_io_uring_read_sqes < 1 || g_io_uring_read_sqes > IOFD_MSGHDR_MAX_READ_SQES) { + fprintf(stderr, "Invalid osmo_uring read SQEs requested: \"%s\"\n Allowed range: 1..%d\n", + env, IOFD_MSGHDR_MAX_READ_SQES); + exit(1); + } + } + rc = eventfd(0, 0); if (rc < 0) { - io_uring_queue_exit(&g_ring.ring); + io_uring_queue_exit(&g_ring->ring); osmo_panic("failure creating eventfd(0, 0) for io_uring: %s\n", strerror(-rc)); } evfd = rc; - osmo_fd_setup(&g_ring.event_ofd, evfd, OSMO_FD_READ, iofd_uring_poll_cb, &g_ring.ring, 0); - rc = osmo_fd_register(&g_ring.event_ofd); + osmo_fd_setup(&g_ring->event_ofd, evfd, OSMO_FD_READ, iofd_uring_poll_cb, &g_ring->ring, 0); + rc = osmo_fd_register(&g_ring->event_ofd); if (rc < 0) { close(evfd); - io_uring_queue_exit(&g_ring.ring); + io_uring_queue_exit(&g_ring->ring); osmo_panic("failure registering io_uring-eventfd as osmo_fd: %d\n", rc); } - rc = io_uring_register_eventfd(&g_ring.ring, evfd); + rc = io_uring_register_eventfd(&g_ring->ring, evfd); if (rc < 0) { - osmo_fd_unregister(&g_ring.event_ofd); + osmo_fd_unregister(&g_ring->event_ofd); close(evfd); - io_uring_queue_exit(&g_ring.ring); + io_uring_queue_exit(&g_ring->ring); osmo_panic("failure registering eventfd with io_uring: %s\n", strerror(-rc)); } } +static void osmo_iofd_uring_exit(struct osmo_io_uring *ring) +{ + LOGP(DLIO, LOGL_DEBUG, "Old empty io_uring will be destroyed."); -static void iofd_uring_submit_recv(struct osmo_io_fd *iofd, enum iofd_msg_action action) + io_uring_queue_exit(&ring->ring); + + osmo_fd_unregister(&ring->event_ofd); + close(ring->event_ofd.fd); + + talloc_free(ring); +} + +static inline struct io_uring_sqe *io_uring_get_sqe_and_count(struct osmo_io_uring *ring) +{ + struct io_uring_sqe *sqe; + + sqe = io_uring_get_sqe(&ring->ring); + if (sqe) + ring->num_pending_submissions++; + + return sqe; +} + +static struct io_uring_sqe *iofd_uring_get_sqe(struct osmo_io_fd *iofd, bool read) +{ + struct io_uring_sqe *sqe; + + /* All subsequent read SQEs must be on the same ring. */ + if (read && iofd->u.uring.read.sqes_submitted > 0 && iofd->u.uring.read.ring != &g_ring->ring) + return NULL; + + sqe = io_uring_get_sqe_and_count(g_ring); + if (sqe) + return sqe; + + /* The current ring is full, subsequent read SQEs on different ring are not allowed. */ + if (read && iofd->u.uring.read.sqes_submitted > 0) + return NULL; + + if (g_io_uring_size < IOFD_URING_MAXIMUM_SIZE) { + LOGP(DLIO, LOGL_NOTICE, "io_uring too small to handle all SQEs with its current size of %d. " + "Increasing io_uring size to %d.\n", g_io_uring_size, g_io_uring_size * 2); + g_io_uring_size <<= 1; + } else { + LOGP(DLIO, LOGL_NOTICE, "io_uring too small to handle all SQEs with its maximum size of %d. " + "adding another one.\n", g_io_uring_size); + } + + /* Submit all SQEs of current ring and create a new ring, if needed. + * The old ring will be kept, as there are uncompleted submissions. + * TODO: Destroy old ring, once all submissions are completed. */ + osmo_io_uring_submit(); + + osmo_iofd_uring_init(); + + sqe = io_uring_get_sqe_and_count(g_ring); + OSMO_ASSERT(sqe); + return sqe; +} + +static inline void iofd_io_uring_submit(void) +{ + if (OSMO_LIKELY(!g_io_uring_batch)) + io_uring_submit(&g_ring->ring); + else + g_io_uring_submit_needed = true; +} + +static inline int iofd_uring_submit_recv_sqe(struct osmo_io_fd *iofd, enum iofd_msg_action action) { struct msgb *msg; struct iofd_msghdr *msghdr; struct io_uring_sqe *sqe; + uint8_t idx; + + /* Tell iofd_uring_get_sqe() not to allocate a new ring, if we want to enqueue multiple read SQEs. */ + sqe = iofd_uring_get_sqe(iofd, true); + if (!sqe) { + if (iofd->u.uring.read.sqes_submitted > 0) + return -EINVAL; + LOGPIO(iofd, LOGL_ERROR, "Could not get io_uring_sqe\n"); + OSMO_ASSERT(0); + } - msg = iofd_msgb_pending_or_alloc(iofd); + msg = iofd_msgb_alloc(iofd); if (!msg) { LOGPIO(iofd, LOGL_ERROR, "Could not allocate msgb for reading\n"); OSMO_ASSERT(0); @@ -136,8 +264,10 @@ OSMO_ASSERT(0); } - msghdr->iov0.iov_base = msg->tail; - msghdr->iov0.iov_len = msgb_tailroom(msg); + for (idx = 0; idx < msghdr->io_len; idx++) { + msghdr->iovidx.iov_base = msghdr->msgidx->tail; + msghdr->iovidx.iov_len = msgb_tailroom(msghdr->msgidx); + } switch (action) { case IOFD_ACT_RECVMSG: @@ -150,21 +280,15 @@ /* fall-through */ case IOFD_ACT_READ: msghdr->hdr.msg_iov = &msghdr->iov0; - msghdr->hdr.msg_iovlen = 1; + msghdr->hdr.msg_iovlen = msghdr->io_len; break; default: OSMO_ASSERT(0); } - sqe = io_uring_get_sqe(&g_ring.ring); - if (!sqe) { - LOGPIO(iofd, LOGL_ERROR, "Could not get io_uring_sqe\n"); - OSMO_ASSERT(0); - } - switch (action) { case IOFD_ACT_READ: - io_uring_prep_readv(sqe, iofd->fd, msghdr->iov, 1, -1); + io_uring_prep_readv(sqe, iofd->fd, msghdr->iov, msghdr->hdr.msg_iovlen, -1); break; case IOFD_ACT_RECVMSG: case IOFD_ACT_RECVFROM: @@ -175,28 +299,81 @@ } io_uring_sqe_set_data(sqe, msghdr); - io_uring_submit(&g_ring.ring); - /* NOTE: This only works if we have one read per fd */ - iofd->u.uring.read_msghdr = msghdr; + iofd_io_uring_submit(); + + iofd->u.uring.read.msghdriofd->u.uring.read.sqes_submitted = msghdr; + iofd->u.uring.read.sqes_submitted++; + iofd->u.uring.read.ring = &g_ring->ring; + + return 0; +} + +static void iofd_uring_submit_recv(struct osmo_io_fd *iofd, enum iofd_msg_action action) +{ + int rc; + + /* Submit more read SQEs in advance, if requested. */ + while (iofd->u.uring.read.sqes_submitted < iofd->u.uring.read.num_sqes) { + rc = iofd_uring_submit_recv_sqe(iofd, action); + /* Stop, if we cannot enqueue multiple read SQEs in the same ring. */ + if (rc < 0) + break; + } } /*! completion call-back for READ/RECVFROM */ static void iofd_uring_handle_recv(struct iofd_msghdr *msghdr, int rc) { struct osmo_io_fd *iofd = msghdr->iofd; - struct msgb *msg = msghdr->msg; + uint8_t idx, i; - if (rc > 0) - msgb_put(msg, rc); + /* Find which read_msghdr is completed and remove from list. */ + for (idx = 0; idx < iofd->u.uring.read.sqes_submitted; idx++) { + if (iofd->u.uring.read.msghdridx == msghdr) + break; + } + if (idx == iofd->u.uring.read.sqes_submitted) { + LOGP(DLIO, LOGL_FATAL, "Read SQE completion, but msghdr not found, please fix!\n"); + return; + } + /* Remove entry at idx. */ + iofd->u.uring.read.sqes_submitted--; + for (i = idx; i < iofd->u.uring.read.sqes_submitted; i++) + iofd->u.uring.read.msghdri = iofd->u.uring.read.msghdri + 1; + iofd->u.uring.read.msghdri = NULL; + + for (idx = 0; idx < msghdr->io_len; idx++) { + struct msgb *msg = msghdr->msgidx; + int chunk; + + msghdr->msgidx = NULL; + if (rc > 0) { + if (rc > msghdr->iovidx.iov_len) + chunk = msghdr->iovidx.iov_len; + else + chunk = rc; + rc -= chunk; + msgb_put(msg, chunk); + } else { + chunk = rc; + } - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) - iofd_handle_recv(iofd, msg, rc, msghdr); + /* Check for every iteration, because iofd might get unregistered/closed during receive function. */ + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED) && iofd->u.uring.read.enabled) + iofd_handle_recv(iofd, msg, chunk, msghdr); + else + msgb_free(msg); - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED) && iofd->u.uring.read_enabled) - iofd_uring_submit_recv(iofd, msghdr->action); - else - iofd->u.uring.read_msghdr = NULL; + if (rc <= 0) + break; + } + while (++idx < msghdr->io_len) { + msgb_free(msghdr->msgidx); + msghdr->msgidx = NULL; + } + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED) && iofd->u.uring.read.enabled) + iofd_uring_submit_recv(iofd, msghdr->action); iofd_msghdr_free(msghdr); } @@ -211,21 +388,26 @@ /* Detach msghdr from iofd. It might get freed here or it is freed during iofd_handle_send_completion(). * If there is pending data to send, iofd_uring_submit_tx() will attach it again. * iofd_handle_send_completion() will invoke a callback function to signal the possibility of write/send. - * This callback function might close iofd, leading to the potential freeing of iofd->u.uring.write_msghdr if + * This callback function might close iofd, leading to the potential freeing of iofd->u.uring.write.msghdr if * still attached. Since iofd_handle_send_completion() frees msghdr at the end of the function, detaching * msghdr here prevents a double-free bug. */ - if (iofd->u.uring.write_msghdr == msghdr) - iofd->u.uring.write_msghdr = NULL; + if (iofd->u.uring.write.msghdr == msghdr) { + iofd->u.uring.write.msghdr = NULL; + iofd->u.uring.write.ring = NULL; + } if (OSMO_UNLIKELY(IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED))) { - msgb_free(msghdr->msg); + for (int idx = 0; idx < msghdr->io_len; idx++) { + msgb_free(msghdr->msgidx); + msghdr->msgidx = NULL; + } iofd_msghdr_free(msghdr); } else { iofd_handle_send_completion(iofd, rc, msghdr); } /* submit the next to-be-transmitted message for this file descriptor */ - if (iofd->u.uring.write_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) + if (iofd->u.uring.write.enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) iofd_uring_submit_tx(iofd); } @@ -253,7 +435,7 @@ IOFD_FLAG_UNSET(iofd, IOFD_FLAG_IN_CALLBACK); - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_TO_FREE) && !iofd->u.uring.read_msghdr && !iofd->u.uring.write_msghdr) + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_TO_FREE) && !iofd->u.uring.read.sqes_submitted && !iofd->u.uring.write.msghdr) talloc_free(iofd); } @@ -262,9 +444,11 @@ { int rc; struct io_uring_cqe *cqe; - struct iofd_msghdr *msghdr; + struct iofd_msghdr *msghdr, *msghdr2; + struct osmo_io_uring *orig_ring = container_of(ring, struct osmo_io_uring, ring); while (io_uring_peek_cqe(ring, &cqe) == 0) { + orig_ring->num_pending_submissions--; msghdr = io_uring_cqe_get_data(cqe); if (!msghdr) { @@ -274,6 +458,8 @@ } if (!msghdr->iofd) { io_uring_cqe_seen(ring, cqe); + if (msghdr->in_cancel_queue) + llist_del(&msghdr->list); iofd_msghdr_free(msghdr); continue; } @@ -285,6 +471,26 @@ iofd_uring_handle_completion(msghdr, rc); } + + /* If there are unsubmitted cancel SQEs, try to queue them now. */ + if (OSMO_LIKELY(llist_empty(&orig_ring->cancel_queue))) { + /* Old ring is empty, remove it. */ + if (OSMO_UNLIKELY(orig_ring != g_ring && orig_ring->num_pending_submissions == 0)) + osmo_iofd_uring_exit(orig_ring); + return; + } + llist_for_each_entry_safe(msghdr, msghdr2, &orig_ring->cancel_queue, list) { + struct io_uring_sqe *sqe; + sqe = io_uring_get_sqe_and_count(orig_ring); + if (!sqe) + break; + io_uring_sqe_set_data(sqe, NULL); + LOGP(DLIO, LOGL_DEBUG, "Cancelling queued read/write\n"); + io_uring_prep_cancel(sqe, msghdr, 0); + llist_del(&msghdr->list); + msghdr->in_cancel_queue = false; + } + io_uring_submit(&orig_ring->ring); } /*! will submit the next to-be-transmitted message for given iofd */ @@ -297,7 +503,7 @@ if (!msghdr) return -ENODATA; - sqe = io_uring_get_sqe(&g_ring.ring); + sqe = iofd_uring_get_sqe(iofd, false); if (!sqe) { LOGPIO(iofd, LOGL_ERROR, "Could not get io_uring_sqe\n"); OSMO_ASSERT(0); @@ -307,7 +513,7 @@ switch (msghdr->action) { case IOFD_ACT_WRITE: - io_uring_prep_writev(sqe, msghdr->iofd->fd, msghdr->iov, 1, -1); + io_uring_prep_writev(sqe, msghdr->iofd->fd, msghdr->iov, msghdr->io_len, -1); break; case IOFD_ACT_SENDTO: case IOFD_ACT_SENDMSG: @@ -317,8 +523,10 @@ OSMO_ASSERT(0); } - io_uring_submit(&g_ring.ring); - iofd->u.uring.write_msghdr = msghdr; + iofd_io_uring_submit(); + + iofd->u.uring.write.msghdr = msghdr; + iofd->u.uring.write.ring = &g_ring->ring; return 0; } @@ -357,16 +565,23 @@ IOFD_FLAG_UNSET(iofd, IOFD_FLAG_IN_CALLBACK); /* If write/read notifications are pending, enable it now. */ - if (iofd->u.uring.write_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) + if (iofd->u.uring.write.enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) iofd_uring_write_enable(iofd); - if (iofd->u.uring.read_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) + if (iofd->u.uring.read.enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) iofd_uring_read_enable(iofd); - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_TO_FREE) && !iofd->u.uring.read_msghdr && !iofd->u.uring.write_msghdr) + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_TO_FREE) && !iofd->u.uring.read.sqes_submitted && !iofd->u.uring.write.msghdr) talloc_free(iofd); return 0; } +static int iofd_uring_setup(struct osmo_io_fd *iofd) +{ + iofd->u.uring.read.num_sqes = g_io_uring_read_sqes; + + return 0; +} + static int iofd_uring_register(struct osmo_io_fd *iofd) { if (iofd->mode != OSMO_IO_FD_MODE_RECVMSG_SENDMSG) @@ -392,32 +607,60 @@ { struct io_uring_sqe *sqe; struct iofd_msghdr *msghdr; + uint8_t idx; - if (iofd->u.uring.read_msghdr) { - msghdr = iofd->u.uring.read_msghdr; - sqe = io_uring_get_sqe(&g_ring.ring); - OSMO_ASSERT(sqe != NULL); - io_uring_sqe_set_data(sqe, NULL); - LOGPIO(iofd, LOGL_DEBUG, "Cancelling read\n"); - iofd->u.uring.read_msghdr = NULL; + for (idx = 0; idx < iofd->u.uring.read.sqes_submitted; idx++) { + struct osmo_io_uring *ring = container_of(iofd->u.uring.read.ring, struct osmo_io_uring, ring); + msghdr = iofd->u.uring.read.msghdridx; + iofd->u.uring.read.msghdridx = NULL; + /* Submit SQEs of the current ring, if needed. */ + if (&ring->ring == &g_ring->ring) + osmo_io_uring_submit(); + /* If the submission queue is full, use cancel queue. We cannot cancel SQEs on the new ring. */ + sqe = io_uring_get_sqe_and_count(ring); + if (sqe) { + io_uring_sqe_set_data(sqe, NULL); + LOGPIO(iofd, LOGL_DEBUG, "Cancelling read\n"); + io_uring_prep_cancel(sqe, msghdr, 0); + io_uring_submit(&ring->ring); + } else { + llist_add_tail(&msghdr->list, &ring->cancel_queue); + msghdr->in_cancel_queue = true; + } talloc_steal(OTC_GLOBAL, msghdr); msghdr->iofd = NULL; - io_uring_prep_cancel(sqe, msghdr, 0); + } + if (iofd->u.uring.read.sqes_submitted) { + iofd->u.uring.read.ring = NULL; + iofd->u.uring.read.sqes_submitted = 0; } - if (iofd->u.uring.write_msghdr) { - msghdr = iofd->u.uring.write_msghdr; - sqe = io_uring_get_sqe(&g_ring.ring); - OSMO_ASSERT(sqe != NULL); - io_uring_sqe_set_data(sqe, NULL); - LOGPIO(iofd, LOGL_DEBUG, "Cancelling write\n"); - iofd->u.uring.write_msghdr = NULL; + if (iofd->u.uring.write.msghdr) { + struct osmo_io_uring *ring = container_of(iofd->u.uring.write.ring, struct osmo_io_uring, ring); + msghdr = iofd->u.uring.write.msghdr; + iofd->u.uring.write.msghdr = NULL; + for (int idx = 0; idx < msghdr->io_len; idx++) { + msgb_free(msghdr->msgidx); + msghdr->msgidx = NULL; + } + /* Submit SQEs of the current ring, if needed. */ + if (&ring->ring == &g_ring->ring) + osmo_io_uring_submit(); + /* If the submission queue is full, use cancel queue. We cannot cancel SQEs on the new ring. */ + sqe = io_uring_get_sqe_and_count(ring); + if (sqe) { + io_uring_sqe_set_data(sqe, NULL); + LOGPIO(iofd, LOGL_DEBUG, "Cancelling write\n"); + io_uring_prep_cancel(sqe, msghdr, 0); + io_uring_submit(&ring->ring); + } else { + llist_add_tail(&msghdr->list, &ring->cancel_queue); + msghdr->in_cancel_queue = true; + } talloc_steal(OTC_GLOBAL, msghdr); - msgb_free(msghdr->msg); msghdr->iofd = NULL; - io_uring_prep_cancel(sqe, msghdr, 0); + iofd->u.uring.write.ring = NULL; } - io_uring_submit(&g_ring.ring); if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) { osmo_fd_unregister(&iofd->u.uring.connect_ofd); @@ -429,9 +672,9 @@ static void iofd_uring_write_enable(struct osmo_io_fd *iofd) { - iofd->u.uring.write_enabled = true; + iofd->u.uring.write.enabled = true; - if (iofd->u.uring.write_msghdr) + if (iofd->u.uring.write.msghdr) return; /* This function is called again, once the socket is connected. */ @@ -458,7 +701,7 @@ msghdr->iov0.iov_base = msgb_data(msg); msghdr->iov0.iov_len = msgb_length(msg); - sqe = io_uring_get_sqe(&g_ring.ring); + sqe = iofd_uring_get_sqe(iofd, false); if (!sqe) { LOGPIO(iofd, LOGL_ERROR, "Could not get io_uring_sqe\n"); OSMO_ASSERT(0); @@ -466,21 +709,23 @@ io_uring_prep_writev(sqe, iofd->fd, msghdr->iov, 1, 0); io_uring_sqe_set_data(sqe, msghdr); - io_uring_submit(&g_ring.ring); - iofd->u.uring.write_msghdr = msghdr; + iofd_io_uring_submit(); + + iofd->u.uring.write.msghdr = msghdr; + iofd->u.uring.write.ring = &g_ring->ring; } } static void iofd_uring_write_disable(struct osmo_io_fd *iofd) { - iofd->u.uring.write_enabled = false; + iofd->u.uring.write.enabled = false; } static void iofd_uring_read_enable(struct osmo_io_fd *iofd) { - iofd->u.uring.read_enabled = true; + iofd->u.uring.read.enabled = true; - if (iofd->u.uring.read_msghdr) + if (iofd->u.uring.read.sqes_submitted) return; /* This function is called again, once the socket is connected. */ @@ -504,7 +749,7 @@ static void iofd_uring_read_disable(struct osmo_io_fd *iofd) { - iofd->u.uring.read_enabled = false; + iofd->u.uring.read.enabled = false; } static int iofd_uring_close(struct osmo_io_fd *iofd) @@ -520,13 +765,14 @@ } /* OSMO_IO_FD_MODE_RECVMSG_SENDMSG: Don't call this function after enabling read or write. */ - OSMO_ASSERT(!iofd->u.uring.write_enabled && !iofd->u.uring.read_enabled); + OSMO_ASSERT(!iofd->u.uring.write.enabled && !iofd->u.uring.read.enabled); /* Set flag to enable temporary osmo_fd during register() time: */ IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); } const struct iofd_backend_ops iofd_uring_ops = { + .setup = iofd_uring_setup, .register_fd = iofd_uring_register, .unregister_fd = iofd_uring_unregister, .close = iofd_uring_close, @@ -537,4 +783,12 @@ .notify_connected = iofd_uring_notify_connected, }; +void osmo_io_uring_submit(void) +{ + if (OSMO_LIKELY(g_io_uring_submit_needed)) { + io_uring_submit(&g_ring->ring); + g_io_uring_submit_needed = false; + } +} + #endif /* defined(__linux__) */
View file
libosmocore_1.11.3.tar.xz/src/core/select.c -> libosmocore_1.12.0.tar.xz/src/core/select.c
Changed
@@ -426,12 +426,22 @@ return work; } +#if defined(HAVE_URING) +void osmo_io_uring_submit(void); +extern bool g_io_uring_batch; +#endif + static int _osmo_select_main(int polling) { unsigned int n_poll; int rc; int timeout = 0; +#if defined(HAVE_URING) + if (OSMO_UNLIKELY(g_io_uring_batch)) + osmo_io_uring_submit(); +#endif + /* prepare read and write fdsets */ n_poll = poll_fill_fds(); @@ -464,6 +474,11 @@ int rc; struct timeval no_time = {0, 0}; +#if defined(HAVE_URING) + if (OSMO_UNLIKELY(g_io_uring_batch)) + osmo_io_uring_submit(); +#endif + FD_ZERO(&readset); FD_ZERO(&writeset); FD_ZERO(&exceptset);
View file
libosmocore_1.11.3.tar.xz/src/gb/Makefile.am -> libosmocore_1.12.0.tar.xz/src/gb/Makefile.am
Changed
@@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=17:0:3 +LIBVERSION=17:1:3 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall -fno-strict-aliasing \
View file
libosmocore_1.11.3.tar.xz/src/gb/gprs_bssgp.c -> libosmocore_1.12.0.tar.xz/src/gb/gprs_bssgp.c
Changed
@@ -216,8 +216,7 @@ ctx->bvci = bvci; ctx->nsei = nsei; ctx->is_sgsn = true; - /* FIXME: BVCI is not unique, only BVCI+NSEI ?!? */ - ctx->ctrg = rate_ctr_group_alloc(ctx, &bssgp_ctrg_desc, bvci); + ctx->ctrg = rate_ctr_group_alloc(ctx, &bssgp_ctrg_desc, ((uint32_t)nsei << 16) | bvci); if (!ctx->ctrg) goto err_ctrg;
View file
libosmocore_1.11.3.tar.xz/src/gsm/Makefile.am -> libosmocore_1.12.0.tar.xz/src/gsm/Makefile.am
Changed
@@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=22:2:2 +LIBVERSION=23:0:3 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
View file
libosmocore_1.11.3.tar.xz/src/gsm/gsm48_rest_octets.c -> libosmocore_1.12.0.tar.xz/src/gsm/gsm48_rest_octets.c
Changed
@@ -605,7 +605,7 @@ return bv.data_len; } -/* Append selection parameters to bitvec */ +/* 3GPP TS 44.018 Table 10.5.2.34.1 (Optional) "Selection Parameters", append to bitvec */ static void append_selection_params(struct bitvec *bv, const struct osmo_gsm48_si_selection_params *sp) { @@ -620,7 +620,7 @@ } } -/* Append power offset to bitvec */ +/* 3GPP TS 44.018 Table 10.5.2.34.1 "Optional Power offset", append to bitvec */ static void append_power_offset(struct bitvec *bv, const struct osmo_gsm48_si_power_offset *po) { @@ -632,7 +632,7 @@ } } -/* Append GPRS indicator to bitvec */ +/* 3GPP TS 44.018 Table 10.5.2.34.1 "GPRS Indicator", append bitvec */ static void append_gprs_ind(struct bitvec *bv, const struct osmo_gsm48_si3_gprs_ind *gi) { @@ -748,6 +748,11 @@ } else { bitvec_set_bit(&bv, L); } + + /* TODO: + * {L | H < CBQ3 : bit (2) > "Cell Bar Qualify 3" in TS 44.018 Table 10.5.2.11.1 + * {0 | 1 < SI13alt Position : bit >}} ; + */ } else { /* L and break indicator */ bitvec_set_bit(&bv, L);
View file
libosmocore_1.11.3.tar.xz/src/gsm/iuup.c -> libosmocore_1.12.0.tar.xz/src/gsm/iuup.c
Changed
@@ -714,6 +714,13 @@ /* the only permitted 'config req' type is the request to release the instance */ osmo_fsm_inst_state_chg(fi, IUUP_FSM_ST_NULL, 0, 0); break; + case IUUP_FSM_EVT_IUUP_DATA_REQ: + /* Data coming down from RNL (user) towards TNL (transport). + * Discard since we are still not in Data Transfer Ready State. */ + irp = data; + LOGPFSML(fi, LOGL_INFO, "Iu-UP-DATA.req while still initializing, discarding\n"); + msgb_free(irp->oph.msg); + break; case IUUP_FSM_EVT_INIT: itp = data; if (iuup_rx_initialization(iui, itp)) @@ -825,6 +832,7 @@ }, IUUP_FSM_ST_INIT = { .in_event_mask = S(IUUP_FSM_EVT_IUUP_CONFIG_REQ) | + S(IUUP_FSM_EVT_IUUP_DATA_REQ) | S(IUUP_FSM_EVT_INIT) | S(IUUP_FSM_EVT_LAST_INIT_ACK) | S(IUUP_FSM_EVT_INIT_NACK),
View file
libosmocore_1.11.3.tar.xz/src/gsm/lapdm.c -> libosmocore_1.12.0.tar.xz/src/gsm/lapdm.c
Changed
@@ -136,6 +136,7 @@ const char *name) { memset(dl, 0, sizeof(*dl)); + INIT_LLIST_HEAD(&dl->tx_ui_queue); dl->entity = entity; lapd_dl_init2(&dl->dl, 1, 8, 251, name); /* Section 5.8.5 of TS 04.06 */ dl->dl.reestablish = 0; /* GSM uses no reestablish */ @@ -200,7 +201,6 @@ lapdm_dl_init(&le->datalinki, le, (t200_ms) ? t200_msi : 0, n200, name); } else lapdm_dl_init(&le->datalinki, le, (t200_ms) ? t200_msi : 0, n200, NULL); - INIT_LLIST_HEAD(&le->datalinki.tx_ui_queue); } lapdm_entity_set_mode(le, mode); @@ -301,7 +301,7 @@ } } -/* lfush and release all resources in LAPDm channel +/* flush and release all resources in LAPDm channel * * A convenience wrapper calling \ref lapdm_entity_exit on both * entities inside the \ref lapdm_channel
View file
libosmocore_1.11.3.tar.xz/src/vty/Makefile.am -> libosmocore_1.12.0.tar.xz/src/vty/Makefile.am
Changed
@@ -1,18 +1,42 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=13:2:0 +LIBVERSION=13:3:0 -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) -AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS) +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ + -I$(top_builddir) \ + $(NULL) +AM_CFLAGS = \ + -Wall \ + $(TALLOC_CFLAGS) \ + $(PTHREAD_CFLAGS) \ + $(NULL) if ENABLE_VTY lib_LTLIBRARIES = libosmovty.la -libosmovty_la_SOURCES = buffer.c command.c vty.c vector.c utils.c \ - telnet_interface.c logging_vty.c stats_vty.c \ - fsm_vty.c talloc_ctx_vty.c \ - cpu_sched_vty.c tdef_vty.c +libosmovty_la_SOURCES = \ + buffer.c \ + command.c \ + cpu_sched_vty.c \ + fsm_vty.c \ + logging_vty.c \ + misc_vty.c \ + stats_vty.c \ + talloc_ctx_vty.c \ + tdef_vty.c \ + telnet_interface.c \ + utils.c \ + vector.c \ + vty.c \ + $(NULL) + libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -libosmovty_la_LIBADD = $(top_builddir)/src/core/libosmocore.la $(TALLOC_LIBS) $(PTHREAD_LIBS) +libosmovty_la_LIBADD = \ + $(top_builddir)/src/core/libosmocore.la \ + $(TALLOC_LIBS) \ + $(PTHREAD_LIBS) \ + $(NULL) endif
View file
libosmocore_1.11.3.tar.xz/src/vty/command.c -> libosmocore_1.12.0.tar.xz/src/vty/command.c
Changed
@@ -3555,13 +3555,13 @@ config_write_cmd, "write", "Write running configuration to memory, network, or terminal\n") - ALIAS(config_write_file, +ALIAS(config_write_file, config_write_memory_cmd, "write memory", "Write running configuration to memory, network, or terminal\n" "Write configuration to the file (same as write file)\n") - ALIAS(config_write_file, +ALIAS(config_write_file, copy_runningconfig_startupconfig_cmd, "copy running-config startup-config", "Copy configuration\n" @@ -3569,7 +3569,7 @@ "Copy running config to startup config (same as write file)\n") /* Write current configuration into the terminal. */ - DEFUN(config_write_terminal, +DEFUN(config_write_terminal, config_write_terminal_cmd, "write terminal", "Write running configuration to memory, network, or terminal\n" @@ -3606,7 +3606,7 @@ "show running-config", SHOW_STR "running configuration\n") /* Write startup configuration into the terminal. */ - DEFUN(show_startup_config, +DEFUN(show_startup_config, show_startup_config_cmd, "show startup-config", SHOW_STR "Contentes of startup configuration\n") { @@ -3722,7 +3722,7 @@ "The UNENCRYPTED (cleartext) line password\n") /* VTY enable password set. */ - DEFUN(config_enable_password, enable_password_cmd, +DEFUN(config_enable_password, enable_password_cmd, "enable password (8|) WORD", "Modify enable password parameters\n" "Assign the privileged level password\n" @@ -3785,7 +3785,7 @@ "The UNENCRYPTED (cleartext) 'enable' password\n") /* VTY enable password delete. */ - DEFUN(no_config_enable_password, no_enable_password_cmd, +DEFUN(no_config_enable_password, no_enable_password_cmd, "no enable password", NO_STR "Modify enable password parameters\n"
View file
libosmocore_1.11.3.tar.xz/src/vty/cpu_sched_vty.c -> libosmocore_1.12.0.tar.xz/src/vty/cpu_sched_vty.c
Changed
@@ -45,12 +45,10 @@ #include <osmocom/vty/vty.h> #include <osmocom/vty/command.h> -#include <osmocom/vty/tdef_vty.h> -#include <osmocom/core/tdef.h> #include <osmocom/core/fsm.h> #include <osmocom/core/linuxlist.h> -/*! \addtogroup Tdef_VTY +/*! \addtogroup cpu_sched_vty * * CPU Scheduling related VTY API. *
View file
libosmocore_1.12.0.tar.xz/src/vty/misc_vty.c
Added
@@ -0,0 +1,42 @@ +/* + * (C) 2025 by sysmocom - s.f.m.c. GmbH + * Author: Pau Espin Pedrol <pespin@sysmocom.de> + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include <stdlib.h> +#include <string.h> + +#include "config.h" + +#include <osmocom/core/osmo_io.h> + +#include <osmocom/vty/command.h> +#include <osmocom/vty/vty.h> + +DEFUN(show_runtime, show_runtime_cmd, + "show runtime", + SHOW_STR "Display runtime information\n") +{ + enum osmo_io_backend io_backend = osmo_io_get_backend(); + vty_out(vty, "osmo-io backend: %s%s", osmo_io_backend_name(io_backend), VTY_NEWLINE); + return CMD_SUCCESS; +} + +void vty_misc_init(void) +{ + install_lib_element_ve(&show_runtime_cmd); +}
View file
libosmocore_1.11.3.tar.xz/src/vty/vty.c -> libosmocore_1.12.0.tar.xz/src/vty/vty.c
Changed
@@ -65,6 +65,7 @@ #include <osmocom/vty/vty.h> #include <osmocom/vty/command.h> #include <osmocom/vty/buffer.h> +#include <osmocom/vty/vty_internal.h> #include <osmocom/core/talloc.h> #include <osmocom/core/timer.h> #include <osmocom/core/utils.h> @@ -1902,6 +1903,8 @@ install_lib_element(VTY_NODE, &vty_login_cmd); install_lib_element(VTY_NODE, &no_vty_login_cmd); install_lib_element(VTY_NODE, &vty_bind_cmd); + + vty_misc_init(); } /*! Read the configuration file using the VTY code
View file
libosmocore_1.11.3.tar.xz/tests/Makefile.am -> libosmocore_1.12.0.tar.xz/tests/Makefile.am
Changed
@@ -1,3 +1,6 @@ +# Putting '.' first to run tests/osmo-config-merge/ testsuite after the one under tests/: +SUBDIRS = . osmo-config-merge + AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS) AM_LDFLAGS = -no-install @@ -531,7 +534,7 @@ endif endif -DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c +DISTCLEANFILES = atconfig conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c noinst_HEADERS = conv/conv.h
View file
libosmocore_1.11.3.tar.xz/tests/logging/logging_vty_test.vty -> libosmocore_1.12.0.tar.xz/tests/logging/logging_vty_test.vty
Changed
@@ -54,7 +54,7 @@ logging print level (0|1) logging print file (0|1|basename) last logging set-log-mask MASK - logging level (aa|bb|ccc|dddd|eee|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro|lns|lbssgp|lnsdata|lnssignal|liuup|lpfcp|lcsn1|lio) (debug|info|notice|error|fatal) + logging level (aa|bb|ccc|dddd|eee|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro|lns|lbssgp|lnsdata|lnssignal|liuup|lpfcp|lcsn1|lio|ltcap) (debug|info|notice|error|fatal) logging level set-all (debug|info|notice|error|fatal) logging level force-all (debug|info|notice|error|fatal) no logging level force-all @@ -568,7 +568,7 @@ logging_vty_test# list ... - logp (aa|bb|ccc|dddd|eee|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro|lns|lbssgp|lnsdata|lnssignal|liuup|lpfcp|lcsn1|lio) (debug|info|notice|error|fatal) .LOGMESSAGE + logp (aa|bb|ccc|dddd|eee|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro|lns|lbssgp|lnsdata|lnssignal|liuup|lpfcp|lcsn1|lio|ltcap) (debug|info|notice|error|fatal) .LOGMESSAGE ... logging_vty_test# logp? @@ -607,6 +607,7 @@ lpfcp libosmo-pfcp Packet Forwarding Control Protocol lcsn1 libosmo-csn1 Concrete Syntax Notation 1 codec lio libosmocore IO Subsystem + ltcap TCAP logging_vty_test# logp lglobal ? debug Log debug messages and higher levels
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge
Added
+(directory)
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/Makefile.am
Added
@@ -0,0 +1,59 @@ +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) +AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS) +AM_LDFLAGS = -no-install +LDADD = $(top_builddir)/src/core/libosmocore.la $(TALLOC_LIBS) $(PTHREAD_LIBS) + +check_PROGRAMS = $(top_builddir)/utils/osmo-config-merge \ + $(NULL) + +TESTSUITE = $(srcdir)/testsuite + +EXTRA_DIST = testsuite.at \ + $(srcdir)/package.m4 \ + $(TESTSUITE) \ + testA.cfg testA.confmerge testA.ok \ + testB.cfg testB.confmerge testB.ok \ + testB2.cfg testB2.confmerge testB2.ok \ + $(NULL) + +DISTCLEANFILES = atconfig + +# The `:;' works around a Bash 3.2 bug when the output is not writeable. +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + :;{ \ + echo '# Signature of the current package.' && \ + echo 'm4_define(AT_PACKAGE_NAME,' && \ + echo ' $(PACKAGE_NAME))' && \ + echo 'm4_define(AT_PACKAGE_TARNAME,' && \ + echo ' $(PACKAGE_TARNAME))' && \ + echo 'm4_define(AT_PACKAGE_VERSION,' && \ + echo ' $(PACKAGE_VERSION))' && \ + echo 'm4_define(AT_PACKAGE_STRING,' && \ + echo ' $(PACKAGE_STRING))' && \ + echo 'm4_define(AT_PACKAGE_BUGREPORT,' && \ + echo ' $(PACKAGE_BUGREPORT))'; \ + echo 'm4_define(AT_PACKAGE_URL,' && \ + echo ' $(PACKAGE_URL))'; \ + } >'$(srcdir)/package.m4' + +update_exp: $(check_PROGRAMS) + $(top_builddir)/utils/osmo-config-merge $(srcdir)/testA.cfg $(srcdir)/testA.confmerge >$(srcdir)/testA.ok + $(top_builddir)/utils/osmo-config-merge $(srcdir)/testB.cfg $(srcdir)/testB.confmerge >$(srcdir)/testB.ok + $(top_builddir)/utils/osmo-config-merge $(srcdir)/testB2.cfg $(srcdir)/testB2.confmerge >$(srcdir)/testB2.ok + +check-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + +installcheck-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ + $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || \ + $(SHELL) '$(TESTSUITE)' --clean + +AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 + $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + mv $@.tmp $@
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testA.cfg
Added
@@ -0,0 +1,93 @@ +! +! OsmoBTS (0.4.0.446-e0fb) configuration saved from vty +!! +! +log gsmtap 127.0.0.1 + logging level set-all debug + logging filter all 1 +! +log stderr + logging filter all 1 + logging print extended-timestamp 1 + logging print file basename last + logging print category-hex 0 + logging print category 1 + logging print level 1 + logging timestamp 1 + logging color 1 +! + logging level set-all notice + logging level rsl info + logging level meas info + logging level pag info + logging level l1c info + logging level dsp info + logging level pcu info + logging level trx info + logging level osmux info + logging level lmib info + logging level lmux info +! +line vty + no login + bind 127.0.0.1 +! +cpu-sched + policy rr 30 +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + osmotrx ip local 127.0.0.1 + osmotrx ip remote 127.0.0.1 + instance 0 + osmotrx rx-gain 10 + instance 1 + osmotrx rx-gain 10 + instance 2 + osmotrx rx-gain 10 + instance 3 + osmotrx rx-gain 10 +bts 0 + band DCS1800 + ipa unit-id 1234 0 + oml remote-ip 127.0.0.11 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + gsmtap-remote-host 127.0.0.1 + gsmtap-sapi enable-all + no gsmtap-sapi pdtch + no gsmtap-sapi ptcch + min-qual-rach 50 + min-qual-norm -5 + !settsc + pcu-socket /tmp/pcu_sock + osmux + use on + local-ip 127.0.0.11 + local-port 1984 + trx 0 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 0 + trx 1 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 1 + trx 2 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 2 + trx 3 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 3 +ctrl + bind 127.0.0.1
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testA.confmerge
Added
@@ -0,0 +1,10 @@ +bts 0 + oml remote-ip 127.0.0.1 + trx 0 + power-ramp step-size 2000 mdB + trx 1 + power-ramp step-size 2000 mdB + trx 2 + power-ramp step-size 2000 mdB + trx 3 + power-ramp step-size 2000 mdB
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testA.ok
Added
@@ -0,0 +1,98 @@ +! +! OsmoBTS (0.4.0.446-e0fb) configuration saved from vty +!! +! +log gsmtap 127.0.0.1 + logging level set-all debug + logging filter all 1 +! +log stderr + logging filter all 1 + logging print extended-timestamp 1 + logging print file basename last + logging print category-hex 0 + logging print category 1 + logging print level 1 + logging timestamp 1 + logging color 1 + logging level set-all notice + logging level rsl info + logging level meas info + logging level pag info + logging level l1c info + logging level dsp info + logging level pcu info + logging level trx info + logging level osmux info + logging level lmib info + logging level lmux info +! +! +line vty + no login + bind 127.0.0.1 +! +cpu-sched + policy rr 30 +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +phy 0 + osmotrx ip local 127.0.0.1 + osmotrx ip remote 127.0.0.1 + instance 0 + osmotrx rx-gain 10 + instance 1 + osmotrx rx-gain 10 + instance 2 + osmotrx rx-gain 10 + instance 3 + osmotrx rx-gain 10 +bts 0 + band DCS1800 + ipa unit-id 1234 0 + oml remote-ip 127.0.0.11 + rtp jitter-buffer 100 + paging queue-size 200 + paging lifetime 0 + gsmtap-remote-host 127.0.0.1 + gsmtap-sapi enable-all + no gsmtap-sapi pdtch + no gsmtap-sapi ptcch + min-qual-rach 50 + min-qual-norm -5 + !settsc + pcu-socket /tmp/pcu_sock + osmux + use on + local-ip 127.0.0.11 + local-port 1984 + trx 0 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 0 + power-ramp step-size 2000 mdB + trx 1 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 1 + power-ramp step-size 2000 mdB + trx 2 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 2 + power-ramp step-size 2000 mdB + trx 3 + power-ramp max-initial 0 mdBm + power-ramp step-size 8000 mdB + power-ramp step-interval 1 + phy 0 instance 3 + power-ramp step-size 2000 mdB + oml remote-ip 127.0.0.1 +ctrl + bind 127.0.0.1
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testB.cfg
Added
@@ -0,0 +1,130 @@ +! +! OsmoSTP (1.1.0.2-3884) configuration saved from vty +!! +! +log gsmtap 127.0.0.1 + logging level set-all debug + logging filter all 1 +log stderr + logging filter all 1 + logging print file basename last + logging print category-hex 0 + logging print category 1 + logging print level 1 + logging color 1 + logging timestamp 1 + logging print extended-timestamp 1 + logging level set-all debug +! +stats interval 5 +! +line vty + no login + bind 127.0.0.1 +! +cs7 instance 0 + point-code format 24 + asp asp-sender-tcp 9999 2905 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + transport-role server + asp asp-client0-tcp 10002 2906 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + transport-role client + as as-sender-tcp m3ua + asp asp-sender-tcp + routing-key 1123 123 + as as-client-tcp m3ua + routing-key 1155 155 + asp asp-client0-tcp + route-table system + update route 123 16777215 linkset as-sender-tcp + update route 155 16777215 linkset as-client-tcp + listen m3ua 2905 tcp + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted +! +!M3UA AS/ASP: +! + asp asp-sender 9999 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver0 10000 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver1 10001 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-client0 10002 2906 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client60-norctx0 11060 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client61-norctx0 11061 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + as as-sender m3ua + asp asp-sender + routing-key 1023 23 + as as-receiver m3ua + asp asp-receiver0 + asp asp-receiver1 + routing-key 1042 42 + as as-client m3ua + routing-key 1055 55 + asp asp-client0 + as as-client60-norctx m3ua + routing-key 0 60 + asp asp-client60-norctx0 + as as-client61-norctx m3ua + routing-key 0 61 + asp asp-client61-norctx0 +! +! ROUTING TABLE: +! + route-table system + update route 23 16777215 linkset as-sender + update route 42 16777215 linkset as-receiver + update route 55 16777215 linkset as-client + update route 60 16777215 linkset as-client60-norctx + update route 61 16777215 linkset as-client61-norctx +! +!SERVERS: +! + listen m3ua 2905 + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testB.confmerge
Added
@@ -0,0 +1,72 @@ +cs7 instance 0 + ! + ! IPA AS/ASP: + ! + asp ipa-asp-loadshare-sender0 20000 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + asp ipa-asp-loadshare-sender1 20001 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-loadshare-sender ipa + routing-key 0 6 + point-code override dpc 31 + asp ipa-asp-loadshare-sender0 + asp ipa-asp-loadshare-sender1 + asp ipa-asp-loadshare-receiver0 20002 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-loadshare-receiver1 20003 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-loadshare-receiver ipa + traffic-mode loadshare + routing-key 0 7 + point-code override dpc 32 + asp ipa-asp-loadshare-receiver0 + asp ipa-asp-loadshare-receiver1 + ! Port 2004 is reserved for use with ipa-as-dynamic-asp in TTCN-3. + ! OVERRIDE: + asp ipa-asp-override-sender 20005 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-override-sender ipa + routing-key 0 6 + point-code override dpc 33 + asp ipa-asp-override-sender + asp ipa-asp-override-receiver0 20006 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-override-receiver1 20007 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-override-receiver ipa + traffic-mode override + routing-key 0 8 + point-code override dpc 34 + asp ipa-asp-override-receiver0 + asp ipa-asp-override-receiver1 + ! DYNAMIC AS: + as ipa-as-dynamic-asp ipa + routing-key 0 5 + point-code override dpc 23 + ! + ! ROUTING TABLE: + ! + route-table system + update route 31 16777215 linkset ipa-as-loadshare-receiver + update route 33 16777215 linkset ipa-as-override-receiver + update route 5 16777215 linkset ipa-as-dynamic-asp + ! + !SERVERS: + ! + listen ipa 5000 + accept-asp-connections dynamic-permitted
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testB.ok
Added
@@ -0,0 +1,200 @@ +! +! OsmoSTP (1.1.0.2-3884) configuration saved from vty +!! +! +log gsmtap 127.0.0.1 + logging level set-all debug + logging filter all 1 +log stderr + logging filter all 1 + logging print file basename last + logging print category-hex 0 + logging print category 1 + logging print level 1 + logging color 1 + logging timestamp 1 + logging print extended-timestamp 1 + logging level set-all debug +! +stats interval 5 +! +line vty + no login + bind 127.0.0.1 +! +cs7 instance 0 + point-code format 24 + asp asp-sender-tcp 9999 2905 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + transport-role server + asp asp-client0-tcp 10002 2906 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + transport-role client + as as-sender-tcp m3ua + asp asp-sender-tcp + routing-key 1123 123 + as as-client-tcp m3ua + routing-key 1155 155 + asp asp-client0-tcp + route-table system + update route 123 16777215 linkset as-sender-tcp + update route 155 16777215 linkset as-client-tcp + update route 31 16777215 linkset ipa-as-loadshare-receiver + update route 33 16777215 linkset ipa-as-override-receiver + update route 5 16777215 linkset ipa-as-dynamic-asp + listen m3ua 2905 tcp + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted + asp asp-sender 9999 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver0 10000 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver1 10001 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-client0 10002 2906 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client60-norctx0 11060 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client61-norctx0 11061 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + as as-sender m3ua + asp asp-sender + routing-key 1023 23 + as as-receiver m3ua + asp asp-receiver0 + asp asp-receiver1 + routing-key 1042 42 + as as-client m3ua + routing-key 1055 55 + asp asp-client0 + as as-client60-norctx m3ua + routing-key 0 60 + asp asp-client60-norctx0 + as as-client61-norctx m3ua + routing-key 0 61 + asp asp-client61-norctx0 + route-table system + update route 23 16777215 linkset as-sender + update route 42 16777215 linkset as-receiver + update route 55 16777215 linkset as-client + update route 60 16777215 linkset as-client60-norctx + update route 61 16777215 linkset as-client61-norctx + listen m3ua 2905 + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted + ! + ! IPA AS/ASP: + ! + asp ipa-asp-loadshare-sender0 20000 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + asp ipa-asp-loadshare-sender1 20001 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-loadshare-sender ipa + routing-key 0 6 + point-code override dpc 31 + asp ipa-asp-loadshare-sender0 + asp ipa-asp-loadshare-sender1 + asp ipa-asp-loadshare-receiver0 20002 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-loadshare-receiver1 20003 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-loadshare-receiver ipa + traffic-mode loadshare + routing-key 0 7 + point-code override dpc 32 + asp ipa-asp-loadshare-receiver0 + asp ipa-asp-loadshare-receiver1 + ! Port 2004 is reserved for use with ipa-as-dynamic-asp in TTCN-3. + ! OVERRIDE: + asp ipa-asp-override-sender 20005 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-override-sender ipa + routing-key 0 6 + point-code override dpc 33 + asp ipa-asp-override-sender + asp ipa-asp-override-receiver0 20006 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-override-receiver1 20007 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-override-receiver ipa + traffic-mode override + routing-key 0 8 + point-code override dpc 34 + asp ipa-asp-override-receiver0 + asp ipa-asp-override-receiver1 + ! DYNAMIC AS: + as ipa-as-dynamic-asp ipa + routing-key 0 5 + point-code override dpc 23 + ! + ! ROUTING TABLE: + ! + ! + !SERVERS: + ! + listen ipa 5000 + accept-asp-connections dynamic-permitted +! +!M3UA AS/ASP: +! +! +! ROUTING TABLE: +! +! +!SERVERS: +!
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testB2.cfg
Added
@@ -0,0 +1,130 @@ +! +! OsmoSTP (1.1.0.2-3884) configuration saved from vty +!! +! +log gsmtap 127.0.0.1 + logging level set-all debug + logging filter all 1 +log stderr + logging filter all 1 + logging print file basename last + logging print category-hex 0 + logging print category 1 + logging print level 1 + logging color 1 + logging timestamp 1 + logging print extended-timestamp 1 + logging level set-all debug +! +stats interval 5 +! +line vty + no login + bind 127.0.0.1 +! +cs7 instance 0 + point-code format 24 + asp asp-sender-tcp 9999 2905 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + transport-role server + asp asp-client0-tcp 10002 2906 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + transport-role client + as as-sender-tcp m3ua + asp asp-sender-tcp + routing-key 1123 123 + as as-client-tcp m3ua + routing-key 1155 155 + asp asp-client0-tcp + route-table system + update route 123 16777215 linkset as-sender-tcp + update route 155 16777215 linkset as-client-tcp + listen m3ua 2905 tcp + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted +! +!M3UA AS/ASP: +! + asp asp-sender 9999 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver0 10000 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver1 10001 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-client0 10002 2906 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client60-norctx0 11060 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client61-norctx0 11061 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + as as-sender m3ua + asp asp-sender + routing-key 1023 23 + as as-receiver m3ua + asp asp-receiver0 + asp asp-receiver1 + routing-key 1042 42 + as as-client m3ua + routing-key 1055 55 + asp asp-client0 + as as-client60-norctx m3ua + routing-key 0 60 + asp asp-client60-norctx0 + as as-client61-norctx m3ua + routing-key 0 61 + asp asp-client61-norctx0 +! +! ROUTING TABLE: +! + route-table system + update route 23 16777215 linkset as-sender + update route 42 16777215 linkset as-receiver + update route 55 16777215 linkset as-client + update route 60 16777215 linkset as-client60-norctx + update route 61 16777215 linkset as-client61-norctx +! +!SERVERS: +! + listen m3ua 2905 + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testB2.confmerge
Added
@@ -0,0 +1,72 @@ +cs7 instance 0 +! +! IPA AS/ASP: +! + asp ipa-asp-loadshare-sender0 20000 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + asp ipa-asp-loadshare-sender1 20001 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-loadshare-sender ipa + routing-key 0 6 + point-code override dpc 31 + asp ipa-asp-loadshare-sender0 + asp ipa-asp-loadshare-sender1 + asp ipa-asp-loadshare-receiver0 20002 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-loadshare-receiver1 20003 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-loadshare-receiver ipa + traffic-mode loadshare + routing-key 0 7 + point-code override dpc 32 + asp ipa-asp-loadshare-receiver0 + asp ipa-asp-loadshare-receiver1 +! Port 2004 is reserved for use with ipa-as-dynamic-asp in TTCN-3. +! OVERRIDE: + asp ipa-asp-override-sender 20005 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-override-sender ipa + routing-key 0 6 + point-code override dpc 33 + asp ipa-asp-override-sender + asp ipa-asp-override-receiver0 20006 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-override-receiver1 20007 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-override-receiver ipa + traffic-mode override + routing-key 0 8 + point-code override dpc 34 + asp ipa-asp-override-receiver0 + asp ipa-asp-override-receiver1 +! DYNAMIC AS: + as ipa-as-dynamic-asp ipa + routing-key 0 5 + point-code override dpc 23 +! +! ROUTING TABLE: +! + route-table system + update route 31 16777215 linkset ipa-as-loadshare-receiver + update route 33 16777215 linkset ipa-as-override-receiver + update route 5 16777215 linkset ipa-as-dynamic-asp +! +!SERVERS: +! + listen ipa 5000 + accept-asp-connections dynamic-permitted
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testB2.ok
Added
@@ -0,0 +1,200 @@ +! +! OsmoSTP (1.1.0.2-3884) configuration saved from vty +!! +! +log gsmtap 127.0.0.1 + logging level set-all debug + logging filter all 1 +log stderr + logging filter all 1 + logging print file basename last + logging print category-hex 0 + logging print category 1 + logging print level 1 + logging color 1 + logging timestamp 1 + logging print extended-timestamp 1 + logging level set-all debug +! +stats interval 5 +! +line vty + no login + bind 127.0.0.1 +! +cs7 instance 0 + point-code format 24 + asp asp-sender-tcp 9999 2905 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + transport-role server + asp asp-client0-tcp 10002 2906 m3ua tcp + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + transport-role client + as as-sender-tcp m3ua + asp asp-sender-tcp + routing-key 1123 123 + as as-client-tcp m3ua + routing-key 1155 155 + asp asp-client0-tcp + route-table system + update route 123 16777215 linkset as-sender-tcp + update route 155 16777215 linkset as-client-tcp + update route 31 16777215 linkset ipa-as-loadshare-receiver + update route 33 16777215 linkset ipa-as-override-receiver + update route 5 16777215 linkset ipa-as-dynamic-asp + listen m3ua 2905 tcp + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted + asp asp-sender 9999 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver0 10000 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-receiver1 10001 2905 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role sg + sctp-role server + asp asp-client0 10002 2906 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client60-norctx0 11060 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + asp asp-client61-norctx0 11061 2907 m3ua + local-ip 127.0.0.1 + local-ip ::1 + remote-ip 127.0.0.1 + remote-ip ::1 + role asp + sctp-role client + as as-sender m3ua + asp asp-sender + routing-key 1023 23 + as as-receiver m3ua + asp asp-receiver0 + asp asp-receiver1 + routing-key 1042 42 + as as-client m3ua + routing-key 1055 55 + asp asp-client0 + as as-client60-norctx m3ua + routing-key 0 60 + asp asp-client60-norctx0 + as as-client61-norctx m3ua + routing-key 0 61 + asp asp-client61-norctx0 + route-table system + update route 23 16777215 linkset as-sender + update route 42 16777215 linkset as-receiver + update route 55 16777215 linkset as-client + update route 60 16777215 linkset as-client60-norctx + update route 61 16777215 linkset as-client61-norctx + listen m3ua 2905 + local-ip 127.0.0.1 + local-ip ::1 + accept-asp-connections dynamic-permitted + asp ipa-asp-loadshare-sender0 20000 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + asp ipa-asp-loadshare-sender1 20001 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-loadshare-sender ipa + routing-key 0 6 + point-code override dpc 31 + asp ipa-asp-loadshare-sender0 + asp ipa-asp-loadshare-sender1 + asp ipa-asp-loadshare-receiver0 20002 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-loadshare-receiver1 20003 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-loadshare-receiver ipa + traffic-mode loadshare + routing-key 0 7 + point-code override dpc 32 + asp ipa-asp-loadshare-receiver0 + asp ipa-asp-loadshare-receiver1 + asp ipa-asp-override-sender 20005 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + as ipa-as-override-sender ipa + routing-key 0 6 + point-code override dpc 33 + asp ipa-asp-override-sender + asp ipa-asp-override-receiver0 20006 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + asp ipa-asp-override-receiver1 20007 5000 ipa + local-ip 127.0.0.1 + remote-ip 127.0.0.1 + role sg + sctp-role server + as ipa-as-override-receiver ipa + traffic-mode override + routing-key 0 8 + point-code override dpc 34 + asp ipa-asp-override-receiver0 + asp ipa-asp-override-receiver1 + as ipa-as-dynamic-asp ipa + routing-key 0 5 + point-code override dpc 23 + listen ipa 5000 + accept-asp-connections dynamic-permitted +! +!M3UA AS/ASP: +! +! +! ROUTING TABLE: +! +! +!SERVERS: +! +! +! IPA AS/ASP: +! +! Port 2004 is reserved for use with ipa-as-dynamic-asp in TTCN-3. +! OVERRIDE: +! DYNAMIC AS: +! +! ROUTING TABLE: +! +! +!SERVERS: +!
View file
libosmocore_1.12.0.tar.xz/tests/osmo-config-merge/testsuite.at
Added
@@ -0,0 +1,20 @@ +AT_INIT +AT_BANNER(osmo-config-merge regression tests.) + +AT_SETUP(testA) +AT_KEYWORDS(testA) +cat $abs_srcdir/testA.ok > expout +AT_CHECK($abs_top_builddir/utils/osmo-config-merge $abs_srcdir/testA.cfg $abs_srcdir/testA.confmerge, 0, expout) +AT_CLEANUP + +AT_SETUP(testB) +AT_KEYWORDS(testB) +cat $abs_srcdir/testB.ok > expout +AT_CHECK($abs_top_builddir/utils/osmo-config-merge $abs_srcdir/testB.cfg $abs_srcdir/testB.confmerge, 0, expout) +AT_CLEANUP + +AT_SETUP(testB2) +AT_KEYWORDS(testB2) +cat $abs_srcdir/testB2.ok > expout +AT_CHECK($abs_top_builddir/utils/osmo-config-merge $abs_srcdir/testB2.cfg $abs_srcdir/testB2.confmerge, 0, expout) +AT_CLEANUP
View file
libosmocore_1.11.3.tar.xz/tests/osmo_io/osmo_io_test.c -> libosmocore_1.12.0.tar.xz/tests/osmo_io/osmo_io_test.c
Changed
@@ -247,6 +247,112 @@ for (int i = 0; i < 128; i++) osmo_select_main(1); } + +int segmentation_cb(struct osmo_io_fd *iofd, struct msgb *msg) +{ + printf("%s: segmentation_cb() returning %d\n", osmo_iofd_get_name(iofd), 4); + return 4; +} + +static void segment_read_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) +{ + static int seg_number = 0; + + printf("%s: read() msg with rc=%d\n", osmo_iofd_get_name(iofd), rc); + if (rc < 0) { + printf("%s: error: %s\n", osmo_iofd_get_name(iofd), strerror(-rc)); + OSMO_ASSERT(0); + } + OSMO_ASSERT(msg); + if (seg_number < 3) { + printf("%s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg))); + printf("tailroom = %d\n", msgb_tailroom(msg)); + /* Our read buffer is 6 bytes, Our segment is 4 bytes, this results in tailroom of 2 bytes. + * When the pending 2 bytes are combined with subsequent read of 6 bytes, an extra buffer + * with 8 bytes is allocated. Our segment is 4 byte, then this results in a tailroom of 4 + * bytes. */ + if (seg_number == 1) + OSMO_ASSERT(msgb_tailroom(msg) == 4) + else + OSMO_ASSERT(msgb_tailroom(msg) == 2) + OSMO_ASSERT(msgb_length(msg) == sizeof(TESTDATA) / 4); + seg_number++; + } else { + OSMO_ASSERT(rc == 0); + file_eof_read = true; + osmo_iofd_unregister(iofd); + } + talloc_free(msg); +} + +static void test_segmentation(void) +{ + struct osmo_io_fd *iofd; + struct msgb *msg; + uint8_t *buf; + int fd2 = { 0, 0 }; + int rc; + struct osmo_io_ops ioops; + + TEST_START(); + + /* Create pipe */ + rc = pipe(fd); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(fd0); + OSMO_ASSERT(fd1); + + /* First test writing to the pipe: */ + printf("Enable write\n"); + ioops = (struct osmo_io_ops){ .write_cb = file_write_cb }; + iofd = osmo_iofd_setup(ctx, fd1, "seg_iofd", OSMO_IO_FD_MODE_READ_WRITE, &ioops, NULL); + osmo_iofd_register(iofd, fd1); + + msg = msgb_alloc(12, "Test data"); + buf = msgb_put(msg, 12); + memcpy(buf, TESTDATA, 12); + osmo_iofd_write_msgb(iofd, msg); + /* Allow enough cycles to handle the messages */ + file_bytes_write_compl = 0; + for (int i = 0; i < 128; i++) { + OSMO_ASSERT(file_bytes_write_compl <= 12); + if (file_bytes_write_compl == 12) + break; + osmo_select_main(1); + usleep(100 * 1000); + } + fflush(stdout); + OSMO_ASSERT(file_bytes_write_compl == 12); + + osmo_iofd_close(iofd); + + /* Now, re-configure iofd to only read from the pipe. + * Reduce the read buffer size, to verify correct segmentation operation: */ + printf("Enable read\n"); + osmo_iofd_set_alloc_info(iofd, 6, 0); + osmo_iofd_register(iofd, fd0); + ioops = (struct osmo_io_ops){ .read_cb = segment_read_cb, .segmentation_cb2 = segmentation_cb }; + rc = osmo_iofd_set_ioops(iofd, &ioops); + OSMO_ASSERT(rc == 0); + /* Allow enough cycles to handle the message. We expect 3 reads, 4th read will return 0. */ + file_bytes_read = 0; + file_eof_read = false; + for (int i = 0; i < 128; i++) { + if (file_eof_read) + break; + osmo_select_main(1); + usleep(100 * 1000); + } + fflush(stdout); + OSMO_ASSERT(file_eof_read); + + osmo_iofd_free(iofd); + + for (int i = 0; i < 128; i++) + osmo_select_main(1); +} + + static const struct log_info_cat default_categories = { }; @@ -267,6 +373,7 @@ test_file(); test_connected(); test_unconnected(); + test_segmentation(); return EXIT_SUCCESS; }
View file
libosmocore_1.11.3.tar.xz/tests/osmo_io/osmo_io_test.ok -> libosmocore_1.12.0.tar.xz/tests/osmo_io/osmo_io_test.ok
Changed
@@ -16,3 +16,22 @@ ep1: sendto() returned rc=16 ep2: recvfrom() msg with len=16 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 +Running test_segmentation +Enable write +seg_iofd: write() returned rc=12 +01 02 03 04 05 06 07 08 09 0a 0b 0c +Enable read +seg_iofd: segmentation_cb() returning 4 +seg_iofd: read() msg with rc=6 +01 02 03 04 +tailroom = 2 +seg_iofd: segmentation_cb() returning 4 +seg_iofd: segmentation_cb() returning 4 +seg_iofd: read() msg with rc=6 +05 06 07 08 +tailroom = 4 +seg_iofd: segmentation_cb() returning 4 +seg_iofd: read() msg with rc=6 +09 0a 0b 0c +tailroom = 2 +seg_iofd: read() msg with rc=0
View file
libosmocore_1.11.3.tar.xz/tests/testsuite.at -> libosmocore_1.12.0.tar.xz/tests/testsuite.at
Changed
@@ -17,6 +17,7 @@ AT_SETUP(ctrl) AT_KEYWORDS(ctrl) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/ctrl/ctrl_test) cat $abs_srcdir/ctrl/ctrl_test.ok > expout AT_CHECK($abs_top_builddir/tests/ctrl/ctrl_test, 0, expout, ignore) AT_CLEANUP @@ -81,13 +82,12 @@ AT_CHECK($abs_top_builddir/tests/gea/gea_test, 0, expout) AT_CLEANUP -if ENABLE_MSGFILE AT_SETUP(msgfile) AT_KEYWORDS(msgfile) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/msgfile/msgfile_test) cat $abs_srcdir/msgfile/msgfile_test.ok > expout AT_CHECK($abs_top_builddir/tests/msgfile/msgfile_test $abs_srcdir/msgfile/msgconfig.cfg, 0, expout) AT_CLEANUP -endif AT_SETUP(sms) AT_KEYWORDS(sms) @@ -238,6 +238,7 @@ AT_SETUP(fr) AT_KEYWORDS(fr) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/fr/fr_test) cat $abs_srcdir/fr/fr_test.ok > expout cat $abs_srcdir/fr/fr_test.err > experr AT_CHECK($abs_top_builddir/tests/fr/fr_test, 0, expout, experr) @@ -258,6 +259,7 @@ AT_SETUP(vty) AT_KEYWORDS(vty) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/vty/vty_test) cat $abs_srcdir/vty/vty_test.ok > expout cat $abs_srcdir/vty/vty_test.err > experr AT_CHECK($abs_top_builddir/tests/vty/vty_test $abs_srcdir/vty, 0, expout, experr) @@ -265,18 +267,21 @@ AT_SETUP(gprs-bssgp) AT_KEYWORDS(gprs-bssgp) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/gb/gprs_bssgp_test) cat $abs_srcdir/gb/gprs_bssgp_test.ok > expout AT_CHECK($abs_top_builddir/tests/gb/gprs_bssgp_test, 0, expout, ignore) AT_CLEANUP AT_SETUP(gprs-bssgp-rim) AT_KEYWORDS(gprs-bssgp-rim) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/gb/gprs_bssgp_rim_test) cat $abs_srcdir/gb/gprs_bssgp_rim_test.ok > expout AT_CHECK($abs_top_builddir/tests/gb/gprs_bssgp_rim_test, 0, expout, ignore) AT_CLEANUP AT_SETUP(gprs-ns) AT_KEYWORDS(gprs-ns) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/gb/gprs_ns_test) cat $abs_srcdir/gb/gprs_ns_test.ok > expout cat $abs_srcdir/gb/gprs_ns_test.err > experr AT_CHECK($abs_top_builddir/tests/gb/gprs_ns_test, 0, expout, experr) @@ -284,6 +289,7 @@ AT_SETUP(gprs-ns2) AT_KEYWORDS(gprs-ns2) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/gb/gprs_ns2_test) cat $abs_srcdir/gb/gprs_ns2_test.ok > expout cat $abs_srcdir/gb/gprs_ns2_test.err > experr AT_CHECK($abs_top_builddir/tests/gb/gprs_ns2_test, 0, expout, experr) @@ -291,6 +297,7 @@ AT_SETUP(utils) AT_KEYWORDS(utils) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/utils/utils_test) cat $abs_srcdir/utils/utils_test.ok > expout cat $abs_srcdir/utils/utils_test.err > experr AT_CHECK($abs_top_builddir/tests/utils/utils_test, 0, expout, experr) @@ -298,6 +305,7 @@ AT_SETUP(stats) AT_KEYWORDS(stats) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/stats/stats_test) cat $abs_srcdir/stats/stats_test.ok > expout cat $abs_srcdir/stats/stats_test.err > experr AT_CHECK($abs_top_builddir/tests/stats/stats_test, 0, expout, experr) @@ -311,6 +319,7 @@ AT_SETUP(bssgp-fc) AT_KEYWORDS(bssgp-fc) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/gb/bssgp_fc_test) cat $abs_srcdir/gb/bssgp_fc_tests.ok > expout cat $abs_srcdir/gb/bssgp_fc_tests.err > experr AT_CHECK($abs_top_srcdir/tests/gb/bssgp_fc_tests.sh $abs_top_builddir/tests/gb, 0, expout, experr) @@ -318,7 +327,7 @@ AT_SETUP(sim) AT_KEYWORDS(sim) -AT_CHECK(test "x$enable_sim_test" = xyes || exit 77) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/sim/sim_test) cat $abs_srcdir/sim/sim_test.ok > expout AT_CHECK($abs_top_builddir/tests/sim/sim_test, 0, expout, ignore) AT_CLEANUP @@ -343,6 +352,7 @@ AT_SETUP(gsup) AT_KEYWORDS(gsup) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/gsup/gsup_test) cat $abs_srcdir/gsup/gsup_test.ok > expout cat $abs_srcdir/gsup/gsup_test.err > experr AT_CHECK($abs_top_builddir/tests/gsup/gsup_test, 0, expout, experr) @@ -350,6 +360,7 @@ AT_SETUP(fsm) AT_KEYWORDS(fsm) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/fsm/fsm_test) cat $abs_srcdir/fsm/fsm_test.ok > expout cat $abs_srcdir/fsm/fsm_test.err > experr AT_CHECK($abs_top_builddir/tests/fsm/fsm_test, 0, expout, experr) @@ -357,6 +368,7 @@ AT_SETUP(fsm_dealloc) AT_KEYWORDS(fsm_dealloc) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/fsm/fsm_dealloc_test) cat $abs_srcdir/fsm/fsm_dealloc_test.err > experr AT_CHECK($abs_top_builddir/tests/fsm/fsm_dealloc_test, 0, ignore, experr) AT_CLEANUP @@ -384,7 +396,7 @@ AT_SETUP(socket_sctp) AT_KEYWORDS(socket_sctp) -AT_SKIP_IF(! test -e $abs_top_builddir/tests/socket/socket_sctp_test) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/socket/socket_sctp_test) cat $abs_srcdir/socket/socket_sctp_test.ok > expout cat $abs_srcdir/socket/socket_sctp_test.err > experr AT_CHECK($abs_top_builddir/tests/socket/socket_sctp_test, 0, expout, experr) @@ -455,6 +467,7 @@ AT_SETUP(exec) AT_KEYWORDS(exec) +AT_SKIP_IF(test ! -e $abs_top_builddir/tests/exec/exec_test) cat $abs_srcdir/exec/exec_test.ok > expout cat $abs_srcdir/exec/exec_test.err > experr AT_CHECK($abs_top_builddir/tests/exec/exec_test, 0, expout, experr)
View file
libosmocore_1.11.3.tar.xz/utils/osmo-config-merge.c -> libosmocore_1.12.0.tar.xz/utils/osmo-config-merge.c
Changed
@@ -39,6 +39,7 @@ */ #include <stdio.h> +#include <stdbool.h> #include <string.h> #include <errno.h> @@ -89,16 +90,35 @@ return NULL; } +/* Return pointer to line content, or empty string if only whitspace is found */ +static const char *line_lstrip(const char *line) +{ + OSMO_ASSERT(line); + unsigned int len = strlen(line); + for (unsigned int i = 0; i < len; i++) { + if (linei == ' ') + continue; + return &linei; + } + /* points to empty string '\0' */ + return &linelen; +} + /* count the number of spaces / indent level */ static int count_indent(const char *line) { - int i; + const char *content = line_lstrip(line); + return content - line; +} - for (i = 0; i < strlen(line); i++) { - if (linei != ' ') - return i; - } - return i; +static bool line_is_comment(const char *line) +{ + const char *content = line_lstrip(line); + if (content0 == '\0') + return true; + if (content0 == '!' || line0 == '#') + return true; + return false; } /* strip any triling CR / LF */ @@ -141,7 +161,9 @@ line_num++; chomp(line); int indent = count_indent(line); + bool coment = line_is_comment(&lineindent); struct node *n; + if (indent > cur_indent) { if (indent > cur_indent+1) { fprintf(stderr, "File '%s' isn't well-formed in line %u, aborting!\n", @@ -153,20 +175,25 @@ n = node_alloc_child(last); } else if (indent < cur_indent) { int i; + struct node *par = last; for (i = 0; i < cur_indent - indent; i++) { /* go to parent, add another sibling */ - if (last->parent) - last = last->parent; + if (par->parent) + par = par->parent; } - n = node_alloc_child(last->parent); + n = node_alloc_child(par->parent); } else { /* add a new sibling (child of parent) */ n = node_alloc_child(last->parent); } n->line = talloc_strdup(n, line); - last = n; - cur_indent = indent; + /* comments are not part of the indentation structure of the + * file, hence commands after it are not to be affected by them: */ + if (!coment) { + last = n; + cur_indent = indent; + } } fclose(infile);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.