Projects
osmocom:latest
libosmocore
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 12
View file
libosmocore.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmocore Requires: osmocom-latest -Version: 1.10.1 +Version: 1.11.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.10.1.tar.xz +Source: libosmocore_1.11.0.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.6 BuildRequires: libtool >= 2
View file
libosmocore_1.10.1.dsc -> libosmocore_1.11.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.10.1 +Version: 1.11.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: - 043e8c1afab1717e12d54ed95dc139d7bca91a8d 1116648 libosmocore_1.10.1.tar.xz + b63fcf3280a189c490668d0991667b3423224251 1124948 libosmocore_1.11.0.tar.xz Checksums-Sha256: - e3726b0dd854f4a0d4db777f61940100dff33b23aee8b2b8220d2050481aec99 1116648 libosmocore_1.10.1.tar.xz + fce48b56fe3444260196289af5e458413eee60d2ba9d8e58b924748d0b5b7d9a 1124948 libosmocore_1.11.0.tar.xz Files: - bfb0f85472acf18ef48d734915021fa3 1116648 libosmocore_1.10.1.tar.xz + 5650fa0361975d704fdbd8aad02ee66b 1124948 libosmocore_1.11.0.tar.xz
View file
libosmocore_1.10.1.tar.xz/.tarball-version -> libosmocore_1.11.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.10.1 +1.11.0
View file
libosmocore_1.10.1.tar.xz/debian/changelog -> libosmocore_1.11.0.tar.xz/debian/changelog
Changed
@@ -1,16 +1,92 @@ -libosmocore (1.10.1) unstable; urgency=medium +libosmocore (1.11.0) unstable; urgency=medium - Vadim Yanitskiy - * gsm48_encode_bearer_cap(): properly set 'Structure' in octet 4 + Mychaela N. Falconia + * codec: add osmo_hr_sid_classify() + * tests: add unit test for osmo_hr_sid_classify() + * tests: add unit test for osmo_efr_sid_classify() + * tests: add unit test for osmo_fr_sid_classify() + * osmo_iofd_register: fix the case of changing fd + + Alexander Couzens + * gb: add bssgp_parse_cell_id2/bssgp_create_cell_id2 + * add convert functions for old gprs_ra_id and the new osmo_routing_area_id + * gsm_04_08: define missing reject info causes + * protocol: gsm 29.118: add SGSAP_SERV_IND_PAGING_TIMEOUT (osmocom specific) + * gsm 04.08: add GSM48 IE GMM_ADD_IDENTITY/RAI2 + * gsm 04.08: add P-TMSI type values + * gprs/gsm_24_301: add include to be self contained + * gprs/gsm23003: add osmo_mme_id_cmp & osmo_gummei_cmp + * gsm_utils: add gprs_tlli2tmsi() + * gsm23.003: add RNC Id + * gsm23.003: make the header self-contained + * gprs_ns2_sns: add include osmocom/core/talloc.h + * gprs_ns2_sns: do_sns_add: ensure ip4/ip6 pointer is set + * gprs_ns2_sns: move the NS-ALIVE PDU of a new NS-VC after the SNS-ACK + * gprs_ns2_sns: improve search for same NS-VC + * gprs_ns2_sns: fix error cases of SNS_ADD + * gsm48: add additional GSM 24.008 IE for GMM + * Gb/NS: SNS: SNS Ack don't add List of IP4/6 Elements on success. + + Harald Welte + * core/socket.c: Provide more context when printing error message + * cosmetic core/socket.c: Fix indent of 'case' within 'switch' + * core/socket.c: Fix socket binding on IPv4-only hosts + * src/core/socket.c: Fix close of negative fd in system_supports_inet6() + * Fix building in environments that define _GNU_SOURCE + + Neels Hofmeyr + * coverity CID#272974 + * coverity CID#272951 Pau Espin Pedrol + * iuup.c: Add more relevant spec references to the file + * netdev: osmo_netdev_set_ifupdown_ind_cb(): Fix documentation copy-paste error + * core/tun.c: Fix documentation in ret of osmo_tundev_send + * core/tun: Add API osmo_tundev_get_fd + * core/netdev: Add API osmo_netdev_set_mtu() + * core/tun.c: Fix wrong documentation ret type in tundev_open_fd() + * netdev: Explicit cast time() to uint32_t seq_nr + * tun: assert tundev!=NULL in osmo_tundev_send + * cosmetic: ipa: fix typo in documentation + * ctrl: logging improvements * osmo_io: Increase default queue max_length from 32 to 1024 * gsmtap: Increase txqueue max_length from 64 to 1024 * osmo_io: Improve osmo_iofd_notify_connected() documentation * osmo_io: segmentation cb: Initialize null ptr every iteration + * osmo_io: Use early return to simplify code + * osmo_io: uring: Setup connect_notify internal ofd during register() op + * osmo_io: poll: connect_notify: Avoid calling register + * osmo_io: close() op in backend only takes care of closing + * osmo_io: Track IOFD_FLAG_FD_REGISTERED in all backends + * osmo_io: segmented_read: Avoid triggering read events if user unregisters + * osmo_io: Log current queue length upon enqueue failure * osmo_io: iofd_msgb_alloc(): Allow allocating msgb of len=0xffff + * osmo_io: segmentation: Remove unneeded impossible check + * cosmetic: osmo_io: Improvde documentation of read_cb when segmentation is used + * msgb: msgb_copy_resize_c: Fix validation check to avoid memcpy buffer overflow + * osmo_io: Support writing to files with mode OSMO_IO_FD_MODE_READ_WRITE + * tests/osmo_io: Rework test_file() + * tests/osmo_io: Introduce small sleeps waiting for write completion + * tests/osmo_io: Introduce small sleeps waiting for read completion + + Andreas Eversberg + * Remove sync() after writing VTY config + + Vadim Yanitskiy + * gsm_12_21.h: fix values for NM_IPAC_F_GPRS_CODING_MCS1-9 + * gsm48_encode_bearer_cap(): properly set 'Structure' in octet 4 + * tests/gsm0408: remove outdated comment for bcap_csd_2400_v22bis + + Eric Wild + * utils: fix lost inttypes mess for embedded builds + + Daniel Willmann + * gsm_04_08: Add IEs seen during 4G->2G RAU + + Oliver Smith + * utils/osmo-install-dbg-pkgs: new script - -- Pau Espin Pedrol <pespin@sysmocom.de> Wed, 15 Jan 2025 17:31:58 +0100 + -- Oliver Smith <osmith@sysmocom.de> Wed, 12 Feb 2025 09:51:49 +0100 libosmocore (1.10.0) unstable; urgency=medium
View file
libosmocore_1.10.1.tar.xz/debian/control -> libosmocore_1.11.0.tar.xz/debian/control
Changed
@@ -405,6 +405,7 @@ Architecture: any Section: utils Depends: osmocom-latest, ${shlibs:Depends}, + python3, libosmocore, ${misc:Depends} Multi-Arch: same
View file
libosmocore_1.10.1.tar.xz/debian/rules -> libosmocore_1.11.0.tar.xz/debian/rules
Changed
@@ -17,8 +17,12 @@ override_dh_strip: dh_strip --dbg-package=libosmocore-dbg +# osmo-install-dbg-pkgs: the script gets installed here and not in +# debian/libosmocore-utils.install, so the '.py' at the end can be removed override_dh_install: sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'` + install -Dm755 utils/osmo-install-dbg-pkgs.py \ + debian/libosmocore-utils/usr/bin/osmo-install-dbg-pkgs dh_install # Print test results in case of a failure
View file
libosmocore_1.10.1.tar.xz/include/osmocom/codec/codec.h -> libosmocore_1.11.0.tar.xz/include/osmocom/codec/codec.h
Changed
@@ -100,6 +100,9 @@ enum osmo_gsm631_sid_class osmo_fr_sid_classify(const uint8_t *rtp_payload); enum osmo_gsm631_sid_class osmo_efr_sid_classify(const uint8_t *rtp_payload); +enum osmo_gsm631_sid_class osmo_hr_sid_classify(const uint8_t *rtp_payload, + bool bci_flag, + bool *bfi_from_bci); /*! Check if given FR codec frame is any kind of SID, valid or invalid * \paramin rtp_payload Buffer with RTP payload
View file
libosmocore_1.10.1.tar.xz/include/osmocom/core/netdev.h -> libosmocore_1.11.0.tar.xz/include/osmocom/core/netdev.h
Changed
@@ -36,6 +36,8 @@ int osmo_netdev_set_netns_name(struct osmo_netdev *netdev, const char *netns); const char *osmo_netdev_get_netns_name(const struct osmo_netdev *netdev); +int osmo_netdev_set_mtu(struct osmo_netdev *netdev, uint32_t mtu); + void osmo_netdev_set_ifupdown_ind_cb(struct osmo_netdev *netdev, osmo_netdev_ifupdown_ind_cb_t ifupdown_ind_cb); void osmo_netdev_set_dev_name_chg_cb(struct osmo_netdev *netdev, osmo_netdev_dev_name_chg_cb_t dev_name_chg_cb); void osmo_netdev_set_mtu_chg_cb(struct osmo_netdev *netdev, osmo_netdev_mtu_chg_cb_t mtu_chg_cb);
View file
libosmocore_1.10.1.tar.xz/include/osmocom/core/osmo_io.h -> libosmocore_1.11.0.tar.xz/include/osmocom/core/osmo_io.h
Changed
@@ -98,7 +98,11 @@ * \paramin iofd osmo_io_fd for which read() has completed. * \paramin res return value of the read() call, or -errno in case of error. * \paramin msg message buffer containing the read data. Ownership is transferred to the - * call-back, and it must make sure to msgb_free() it eventually! */ + * call-back, and it must make sure to msgb_free() it eventually! + * + * NOTE: If segmentation_cb is in use, the bytes read in res value + * may be different than those provided in the msg parameter! + */ void (*read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg); /*! completion call-back function when write issued via osmo_iofd_write_msgb() has completed
View file
libosmocore_1.10.1.tar.xz/include/osmocom/core/tun.h -> libosmocore_1.11.0.tar.xz/include/osmocom/core/tun.h
Changed
@@ -29,6 +29,8 @@ const char *osmo_tundev_get_name(const struct osmo_tundev *tundev); +int osmo_tundev_get_fd(const struct osmo_tundev *tundev); + int osmo_tundev_set_dev_name(struct osmo_tundev *tundev, const char *dev_name); const char *osmo_tundev_get_dev_name(const struct osmo_tundev *tundev);
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gprs/gprs_bssgp.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gprs/gprs_bssgp.h
Changed
@@ -182,6 +182,12 @@ int bssgp_create_cell_id(uint8_t *buf, const struct gprs_ra_id *raid, uint16_t cid); +int bssgp_parse_cell_id2(struct osmo_routing_area_id *raid, uint16_t *cid, + const uint8_t *buf, size_t buf_len); +int bssgp_create_cell_id2(uint8_t *buf, size_t buf_len, + const struct osmo_routing_area_id *raid, + uint16_t cid); + /* Wrapper around TLV parser to parse BSSGP IEs */ static inline int bssgp_tlv_parse(struct tlv_parsed *tp, const uint8_t *buf, int len) {
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gprs/protocol/gsm_24_301.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gprs/protocol/gsm_24_301.h
Changed
@@ -3,6 +3,10 @@ #pragma once /*! Tracking area TS 24.301, section 9.9.3.32 */ + +#include <stdbool.h> +#include <stdint.h> + struct osmo_eutran_tai { uint16_t mcc; uint16_t mnc;
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gsm/gsm23003.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gsm/gsm23003.h
Changed
@@ -2,6 +2,7 @@ #pragma once +#include <stddef.h> #include <stdint.h> #include <stdbool.h> @@ -55,6 +56,12 @@ uint16_t ci; }; +/* 12.4 */ +struct osmo_rnc_id { + struct osmo_plmn_id plmn; + uint16_t rnc_id; +}; + /* 12.5 */ struct osmo_service_area_id { struct osmo_location_area_id lai; @@ -137,6 +144,9 @@ const char *osmo_cgi_ps_name2(const struct osmo_cell_global_id_ps *cgi_ps); char *osmo_cgi_ps_name_buf(char *buf, size_t buf_len, const struct osmo_cell_global_id_ps *cgi_ps); char *osmo_cgi_ps_name_c(const void *ctx, const struct osmo_cell_global_id_ps *cgi_ps); +const char *osmo_rnc_id_name(const struct osmo_rnc_id *rnc_id); +char *osmo_rnc_id_name_buf(char *buf, size_t buf_len, const struct osmo_rnc_id *rnc_id); +char *osmo_rnc_id_name_c(const void *ctx, const struct osmo_rnc_id *rnc_id); const char *osmo_sai_name(const struct osmo_service_area_id *sai); const char *osmo_sai_name2(const struct osmo_service_area_id *sai); char *osmo_sai_name_buf(char *buf, size_t buf_len, const struct osmo_service_area_id *sai); @@ -167,6 +177,9 @@ int osmo_rai_cmp(const struct osmo_routing_area_id *a, const struct osmo_routing_area_id *b); int osmo_cgi_cmp(const struct osmo_cell_global_id *a, const struct osmo_cell_global_id *b); int osmo_cgi_ps_cmp(const struct osmo_cell_global_id_ps *a, const struct osmo_cell_global_id_ps *b); +int osmo_rnc_id_cmp(const struct osmo_rnc_id *a, const struct osmo_rnc_id *b); +int osmo_mme_id_cmp(const struct osmo_mme_id *a, const struct osmo_mme_id *b); +int osmo_gummei_cmp(const struct osmo_gummei *a, const struct osmo_gummei *b); int osmo_gen_home_network_domain(char *out, const struct osmo_plmn_id *plmn); int osmo_parse_home_network_domain(struct osmo_plmn_id *out, const char *in);
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gsm/gsm48.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gsm/gsm48.h
Changed
@@ -42,6 +42,8 @@ const char *osmo_rai_name(const struct gprs_ra_id *rai); char *osmo_rai_name_buf(char *buf, size_t buf_len, const struct gprs_ra_id *rai); char *osmo_rai_name_c(const void *ctx, const struct gprs_ra_id *rai); +void osmo_rai_to_gprs(struct gprs_ra_id *dest, const struct osmo_routing_area_id *src); +void gprs_rai_to_osmo(struct osmo_routing_area_id *dest, const struct gprs_ra_id *src); int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac)
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gsm/gsm_utils.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gsm/gsm_utils.h
Changed
@@ -211,6 +211,7 @@ int gprs_tlli_type(uint32_t tlli); uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type); +uint32_t gprs_tlli2tmsi(uint32_t tlli); /* Osmocom internal, not part of any gsm spec */ enum gsm_phys_chan_config {
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gsm/protocol/gsm_04_08.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gsm/protocol/gsm_04_08.h
Changed
@@ -2019,9 +2019,13 @@ GSM48_REJECT_PLMN_NOT_ALLOWED = 11, GSM48_REJECT_LOC_NOT_ALLOWED = 12, GSM48_REJECT_ROAMING_NOT_ALLOWED = 13, + GSM48_REJECT_NO_SUIT_CELL_IN_LA = 15, GSM48_REJECT_NETWORK_FAILURE = 17, + GSM48_REJECT_MAC_FAILURE = 20, GSM48_REJECT_SYNCH_FAILURE = 21, GSM48_REJECT_CONGESTION = 22, + GSM48_REJECT_GSM_AUTH_UNACCEPTABLE = 23, + GSM48_REJECT_NOT_AUTH_FOR_CSG = 25, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED = 32, GSM48_REJECT_RQD_SRV_OPT_NOT_SUPPORTED = 33, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER = 34, @@ -2042,6 +2046,8 @@ GSM48_REJECT_IMPLICITLY_DETACHED = 10, GSM48_REJECT_GPRS_NOT_ALLOWED_IN_PLMN = 14, GSM48_REJECT_MSC_TMP_NOT_REACHABLE = 16, + GSM48_REJECT_SMS_PROV_VIA_GPRS_IN_RA = 28, + GSM48_REJECT_NO_PDP_CONTEXT_ACTIVATED = 40, }; extern const struct value_string gsm48_reject_value_names;
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gsm/protocol/gsm_04_08_gprs.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gsm/protocol/gsm_04_08_gprs.h
Changed
@@ -81,27 +81,42 @@ #define GSM48_MT_GMM_SERVICE_REJ 0x0e enum gsm48_gprs_ie_mm { - GSM48_IE_GMM_CIPH_CKSN = 0x08, /* 10.5.1.2 */ - GSM48_IE_GMM_PTMSI_TYPE = 0x0e, /* 10.5.5.29 */ - GSM48_IE_GMM_TMSI_BASED_NRI_C = 0x10, /* 10.5.5.31 */ + GSM48_IE_GMM_CIPH_CKSN = 0x08, /* 10.5.1.2 */ + GSM48_IE_GMM_TMSI_STATUS = 0x09, /* 10.5.5.4 */ + GSM48_IE_GMM_MS_NET_FEAT_SUP = 0x0c, /* 10.5.1.15 */ + GSM48_IE_GMM_DEVICE_PROP = 0x0d, /* 10.5.7.8 */ + GSM48_IE_GMM_PTMSI_TYPE = 0x0e, /* 10.5.5.29 */ + GSM48_IE_GMM_ADD_UPDATE_TYPE = 0x0f, /* 10.5.5.0 */ + GSM48_IE_GMM_TMSI_BASED_NRI_C = 0x10, /* 10.5.5.31 */ + GSM48_IE_GMM_MS_CLASSMARK2 = 0x11, /* 10.5.1.6 */ + GSM48_IE_GMM_OLD_LAI = 0x14, /* 10.5.5.30 */ GSM48_IE_GMM_TIMER_READY = 0x17, /* 10.5.7.3 */ GSM48_IE_GMM_ALLOC_PTMSI = 0x18, /* 10.5.1.4 */ GSM48_IE_GMM_PTMSI_SIG = 0x19, /* 10.5.5.8 */ + GSM48_IE_GMM_ADD_IDENTITY = 0x1a, /* 10.5.1.4 */ + GSM48_IE_GMM_RAI2 = 0x1b, /* 10.5.5.15a */ + GSM48_IE_GMM_MS_CLASSMARK3 = 0x20, /* 10.5.1.7 */ GSM48_IE_GMM_AUTH_RAND = 0x21, /* 10.5.3.1 */ GSM48_IE_GMM_AUTH_SRES = 0x22, /* 10.5.3.2 */ GSM48_IE_GMM_IMEISV = 0x23, /* 10.5.1.4 */ GSM48_IE_GMM_CAUSE = 0x25, /* 10.5.5.14 */ - GSM48_IE_GMM_RX_NPDU_NUM_LIST = 0x26, /* 10.5.5.11 */ + GSM48_IE_GMM_RX_NPDU_NUM_LIST = 0x26, /* 10.5.5.11 */ GSM48_IE_GMM_DRX_PARAM = 0x27, /* 10.5.5.6 */ GSM48_IE_GMM_AUTN = 0x28, /* 10.5.3.1.1 */ - GSM48_IE_GMM_AUTH_RES_EXT = 0x29, /* 10.5.3.2.1 */ + GSM48_IE_GMM_AUTH_RES_EXT = 0x29, /* 10.5.3.2.1 */ GSM48_IE_GMM_TIMER_T3302 = 0x2A, /* 10.5.7.4 */ GSM48_IE_GMM_AUTH_FAIL_PAR = 0x30, /* 10.5.3.2.2 */ GSM48_IE_GMM_MS_NET_CAPA = 0x31, /* 10.5.5.12 */ GSM48_IE_GMM_PDP_CTX_STATUS = 0x32, /* 10.5.7.1 */ GSM48_IE_GMM_PS_LCS_CAPA = 0x33, /* 10.5.5.22 */ GSM48_IE_GMM_GMM_MBMS_CTX_ST = 0x35, /* 10.5.7.6 */ + GSM48_IE_GMM_TIMER_T3312_EXT = 0x39, /* 10.5.7.4a */ GSM48_IE_GMM_TIMER_T3346 = 0x3A, /* 10.5.7.4 */ + GSM48_IE_GMM_SUPP_CODEC_LIST = 0x40, /* 10.5.4.32 */ + GSM48_IE_GMM_UE_NET_CAP = 0x58, /* 10.5.5.26 */ + GSM48_IE_GMM_VD_PREF_UE_USAGE = 0x5d, /* 10.5.5.28 */ + GMM48_IE_GMM_TIMER_T3324 = 0x6a, /* 10.5.7.4 */ + GSM48_IE_GMM_EXT_DRX_PARAMS = 0x6e, /* 10.5.5.32 */ GSM48_IE_GMM_NET_FEAT_SUPPORT = 0xB0, /* 10.5.5.23 */ }; @@ -512,3 +527,10 @@ /* octet 16 */ uint8_t guar_bitrate_down_ext; }; + +/* TS 24.008 Table 10.5.5.29 */ +enum gsm48_ptsmi_type { + PTMSI_TYPE_NATIVE = 0x00, + PTMSI_TYPE_MAPPED = 0x01, +}; +
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gsm/protocol/gsm_12_21.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gsm/protocol/gsm_12_21.h
Changed
@@ -835,15 +835,15 @@ #define NM_IPAC_F_GPRS_CODING_CS3 (1 << 2) #define NM_IPAC_F_GPRS_CODING_CS4 (1 << 3) /*! ip.access support flags for NM_IPAC_EIE_GPRS_CODING (EGPRS) */ -#define NM_IPAC_F_GPRS_CODING_MCS1 (1 << 7) -#define NM_IPAC_F_GPRS_CODING_MCS2 (1 << 8) -#define NM_IPAC_F_GPRS_CODING_MCS3 (1 << 9) -#define NM_IPAC_F_GPRS_CODING_MCS4 (1 << 10) -#define NM_IPAC_F_GPRS_CODING_MCS5 (1 << 11) -#define NM_IPAC_F_GPRS_CODING_MCS6 (1 << 12) -#define NM_IPAC_F_GPRS_CODING_MCS7 (1 << 13) -#define NM_IPAC_F_GPRS_CODING_MCS8 (1 << 14) -#define NM_IPAC_F_GPRS_CODING_MCS9 (1 << 15) +#define NM_IPAC_F_GPRS_CODING_MCS1 (1 << 8) +#define NM_IPAC_F_GPRS_CODING_MCS2 (1 << 9) +#define NM_IPAC_F_GPRS_CODING_MCS3 (1 << 10) +#define NM_IPAC_F_GPRS_CODING_MCS4 (1 << 11) +#define NM_IPAC_F_GPRS_CODING_MCS5 (1 << 12) +#define NM_IPAC_F_GPRS_CODING_MCS6 (1 << 13) +#define NM_IPAC_F_GPRS_CODING_MCS7 (1 << 14) +#define NM_IPAC_F_GPRS_CODING_MCS8 (1 << 15) +#define NM_IPAC_F_GPRS_CODING_MCS9 (1 << 7) /*! ip.access support flags for NM_IPAC_EIE_RTP_FEATURES */ #define NM_IPAC_F_RTP_FEAT_COMPR_CONTROL (1 << 0) /* RTP Compression Control */
View file
libosmocore_1.10.1.tar.xz/include/osmocom/gsm/protocol/gsm_29_118.h -> libosmocore_1.11.0.tar.xz/include/osmocom/gsm/protocol/gsm_29_118.h
Changed
@@ -116,6 +116,7 @@ enum sgsap_service_ind { SGSAP_SERV_IND_CS_CALL = 0x01, SGSAP_SERV_IND_SMS = 0x02, + SGSAP_SERV_IND_PAGING_TIMEOUT = 0xfe, /* Osmocom specific to drop the paging */ }; extern const struct value_string sgsap_service_ind_names; static inline const char *sgsap_service_ind_name(enum sgsap_service_ind si) {
View file
libosmocore_1.10.1.tar.xz/src/codec/Makefile.am -> libosmocore_1.11.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=4:1:0 +LIBVERSION=5:0:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall $(TALLOC_CFLAGS) @@ -18,6 +18,7 @@ gsm620.c \ gsm660.c \ gsm690.c \ + hr_sid_class.c \ ecu.c \ ecu_fr.c \ ecu_fr_old.c \
View file
libosmocore_1.11.0.tar.xz/src/codec/hr_sid_class.c
Added
@@ -0,0 +1,176 @@ +/* + * This module implements osmo_hr_sid_classify() function - an independent + * reimplementation of the logic that was recommended (but not stipulated + * as normative) by ETSI for classifying received TCH/HS frames as + * valid SID, invalid SID or non-SID speech. + * + * Author: Mychaela N. Falconia <falcon@freecalypso.org>, 2024 - however, + * Mother Mychaela's contributions are NOT subject to copyright. + * No rights reserved, all rights relinquished. + * + * 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 <stdint.h> +#include <stdbool.h> + +#include <osmocom/codec/codec.h> + +/* + * Input to the table: any 4-bit nibble. + * Output from the table: number of 1 bits in that nibble. + */ +static const uint8_t ones_in_nibble16 = {0, 1, 1, 2, 1, 2, 2, 3, + 1, 2, 2, 3, 2, 3, 3, 4}; + +/* + * This helper function takes two byte arrays of equal length (data and mask), + * applies the mask to the data, then counts how many bits are set to 1 + * under the mask, and returns that number. + */ +static unsigned count_ones_under_mask(const uint8_t *data, const uint8_t *mask, + unsigned nbytes) +{ + unsigned n, accum; + uint8_t and; + + accum = 0; + for (n = 0; n < nbytes; n++) { + and = *data++ & *mask++; + accum += ones_in_nibbleand >> 4 + ones_in_nibbleand & 0xF; + } + return accum; +} + +/* + * When a GSM-HR SID frame has been decoded correctly in voiced mode, + * the 79 bits of the SID field will be the last bits in the frame. + * In the packed format of TS 101 318, the bits of interest will be + * in the last 10 bytes. The following array is the mask to be applied. + */ +static const uint8_t sid_field_last10_mask10 = { + 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF +}; + +/* + * When a GSM-HR SID frame has been incorrectly decoded in unvoiced mode + * (both mode bits got flipped to 0 by channel errors), the 79 bits + * of the SID field will be badly misordered all over the frame. + * However, they can still be counted for the purpose of SID detection. + * The following array is the mask to be applied to the whole frame + * (14 bytes) to locate the misordered SID field. + */ +static const uint8_t sid_field_misordered14 = { + 0x08, 0xEF, 0x1F, 0x3F, 0xF3, 0xFC, 0xA4, + 0xFF, 0xFA, 0x3F, 0xFF, 0x47, 0xFF, 0xEC +}; + +/* + * In the channel coding scheme on TCH/HS, the HR codec frame of 112 bits + * is divided into 95 class 1 bits and 17 class 2 bits. In the packed + * format of TS 101 318, all 17 class 2 bits will always be in the last + * 4 bytes; however, the specific bits will be different depending on + * whether the frame was decoded in voiced or unvoiced mode. + * The following two arrays are masks to be applied to the last 4 bytes. + */ +static const uint8_t class2_mask_voiced4 = {0x7F, 0x80, 0x3F, 0xE0}; +static const uint8_t class2_mask_unvoiced4 = {0x07, 0x07, 0xFF, 0xE0}; + +/* + * osmo_hr_sid_classify() - this function is an independent reimplementation + * of the logic that was recommended (but not stipulated as normative) by ETSI + * for classifying received TCH/HS frames as valid SID, invalid SID or non-SID + * speech. ETSI's original version is swSidDetection() function in reid.c + * in GSM 06.06 source; the present version implements exactly the same + * logic (same inputs will produce same output), but differs in the following + * ways: + * + * - The frame of channel-decoded 112 payload bits was passed in the form + * of an array of 18 codec parameters in ETSI's version; the present version + * uses the packed format of TS 101 318 instead. + * + * - The C code implementation was written anew by Mother Mychaela; no code + * in this file has been copied directly from GSM 06.06 code drop. + * + * This function is meant to be used only in the same network element + * that performs GSM 05.03 channel decoding (OsmoBTS, new implementations + * of GSM MS), _*NOT*_ in programs or network elements that receive + * HRv1 codec frames from other elements via RTP or Abis-E1 etc! + * + * The BCI logic recommended by ETSI and implemented in practice by at least + * one vendor whose implementation has been reverse-engineered (TI Calypso) + * is included in this function. To understand this logic, please refer + * to this wiki description: + * + * https://osmocom.org/projects/retro-gsm/wiki/HRv1_error_flags + */ +enum osmo_gsm631_sid_class osmo_hr_sid_classify(const uint8_t *rtp_payload, + bool bci_flag, + bool *bfi_from_bci) +{ + uint8_t mode_bits = rtp_payload4 & 0x30; + unsigned sid_field_ones, class1_ones, class2_ones; + unsigned sid_field_zeros, class1_zeros; + unsigned invalid_sid_threshold; + enum osmo_gsm631_sid_class sidc; + + if (mode_bits != 0) { /* decoded as voiced */ + sid_field_ones = count_ones_under_mask(rtp_payload + 4, + sid_field_last10_mask, 10); + class2_ones = count_ones_under_mask(rtp_payload + 10, + class2_mask_voiced, 4); + } else { /* decoded as unvoiced */ + sid_field_ones = count_ones_under_mask(rtp_payload, + sid_field_misordered, 14); + class2_ones = count_ones_under_mask(rtp_payload + 10, + class2_mask_unvoiced, 4); + } + /* All class 2 bits are in SID field, hence class2_ones can never + * be greater than sid_field_ones. */ + class1_ones = sid_field_ones - class2_ones; + /* 79 is the total number of bits in the SID field */ + sid_field_zeros = 79 - sid_field_ones; + /* 62 is the total number of class 1 bits in TCH/HS frame */ + class1_zeros = 62 - class1_ones; + + /* frame classification logic recommended by ETSI */ + if (bci_flag) + invalid_sid_threshold = 16; + else + invalid_sid_threshold = 11; + + if (class1_zeros < 3) + sidc = OSMO_GSM631_SID_CLASS_VALID; + else if (sid_field_zeros < invalid_sid_threshold) + sidc = OSMO_GSM631_SID_CLASS_INVALID; + else + sidc = OSMO_GSM631_SID_CLASS_SPEECH; + + /* If the mode bits got corrupted and the frame was channel-decoded + * as unvoiced, it cannot be taken as valid SID because the bits + * that hold CN parameters have been misordered. Therefore, + * we have to turn it into invalid SID classification. + */ + if (mode_bits == 0 && sidc == OSMO_GSM631_SID_CLASS_VALID) + sidc = OSMO_GSM631_SID_CLASS_INVALID; + + /* ETSI's peculiar logic that "upgrades" BCI error flag to BFI + * (from lowest to highest error severity) when the decoded bit + * pattern matches a set criterion. We leave it up to applications + * whether they choose to apply this logic or not. If this logic + * is not wanted, pass NULL pointer as the last argument. + */ + if (bci_flag && bfi_from_bci && + sid_field_zeros >= 16 && sid_field_zeros <= 25) + *bfi_from_bci = true; + + return sidc; +}
View file
libosmocore_1.10.1.tar.xz/src/core/Makefile.am -> libosmocore_1.11.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=22:1:0 +LIBVERSION=23:0:1 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.10.1.tar.xz/src/core/exec.c -> libosmocore_1.11.0.tar.xz/src/core/exec.c
Changed
@@ -19,7 +19,9 @@ #include "config.h" #ifndef EMBEDDED +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <unistd.h> #include <errno.h>
View file
libosmocore_1.10.1.tar.xz/src/core/libosmocore.map -> libosmocore_1.11.0.tar.xz/src/core/libosmocore.map
Changed
@@ -321,6 +321,7 @@ osmo_netdev_set_dev_name_chg_cb; osmo_netdev_set_ifindex; osmo_netdev_set_ifupdown_ind_cb; +osmo_netdev_set_mtu; osmo_netdev_set_mtu_chg_cb; osmo_netdev_set_netns_name; osmo_netdev_set_priv_data; @@ -569,6 +570,7 @@ osmo_tundev_close; osmo_tundev_free; osmo_tundev_get_dev_name; +osmo_tundev_get_fd; osmo_tundev_get_name; osmo_tundev_get_netdev; osmo_tundev_get_netns_name;
View file
libosmocore_1.10.1.tar.xz/src/core/msgb.c -> libosmocore_1.11.0.tar.xz/src/core/msgb.c
Changed
@@ -327,10 +327,10 @@ { struct msgb *new_msg; - if (new_len < msgb_length(msg)) { + if (new_len < (msg->data - msg->_data) + msgb_length(msg)) { LOGP(DLGLOBAL, LOGL_ERROR, - "Data from old msgb (%u bytes) won't fit into new msgb (%u bytes) after reallocation\n", - msgb_length(msg), new_len); + "Data from old msgb (%u bytes at offset %u) won't fit into new msgb (%u total bytes) after reallocation\n", + msgb_length(msg), (uint16_t)(msg->data - msg->_data), new_len); return NULL; }
View file
libosmocore_1.10.1.tar.xz/src/core/netdev.c -> libosmocore_1.11.0.tar.xz/src/core/netdev.c
Changed
@@ -68,7 +68,7 @@ #include <stdio.h> #include <stdlib.h> -#include <stdio.h> +#include <inttypes.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> @@ -479,7 +479,7 @@ nlh->nlmsg_type = RTM_GETLINK; nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; - nlh->nlmsg_seq = time(NULL); + nlh->nlmsg_seq = (uint32_t)time(NULL); ifm = mnl_nlmsg_put_extra_header(nlh, sizeof(*ifm)); ifm->ifi_family = AF_UNSPEC; @@ -512,7 +512,7 @@ nlh->nlmsg_type = RTM_NEWLINK; nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; - nlh->nlmsg_seq = time(NULL); + nlh->nlmsg_seq = (uint32_t)time(NULL); ifm = mnl_nlmsg_put_extra_header(nlh, sizeof(*ifm)); ifm->ifi_family = AF_UNSPEC; @@ -531,6 +531,35 @@ return 0; } +static int netdev_mnl_set_mtu(struct osmo_mnl *omnl, unsigned int if_index, + const char *dev_name, uint32_t mtu) +{ + char bufMNL_SOCKET_BUFFER_SIZE; + struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf); + struct ifinfomsg *ifm; + unsigned int change = 0; + unsigned int flags = 0; + + nlh->nlmsg_type = RTM_NEWLINK; + nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; + nlh->nlmsg_seq = (uint32_t)time(NULL); + + ifm = mnl_nlmsg_put_extra_header(nlh, sizeof(*ifm)); + ifm->ifi_family = AF_UNSPEC; + ifm->ifi_change = change; + ifm->ifi_flags = flags; + ifm->ifi_index = if_index; + + mnl_attr_put_u32(nlh, IFLA_MTU, mtu); + + if (mnl_socket_sendto(omnl->mnls, nlh, nlh->nlmsg_len) < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "mnl_socket_sendto\n"); + return -EIO; + } + + return 0; +} + static int netdev_mnl_add_addr(struct osmo_mnl *omnl, unsigned int if_index, const struct osmo_sockaddr *osa, uint8_t prefix) { char bufMNL_SOCKET_BUFFER_SIZE; @@ -539,7 +568,7 @@ nlh->nlmsg_type = RTM_NEWADDR; nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE | NLM_F_ACK; - nlh->nlmsg_seq = time(NULL); + nlh->nlmsg_seq = (uint32_t)time(NULL); ifm = mnl_nlmsg_put_extra_header(nlh, sizeof(*ifm)); ifm->ifa_family = osa->u.sa.sa_family; @@ -587,7 +616,7 @@ nlh->nlmsg_type = RTM_NEWROUTE; nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_ACK; - nlh->nlmsg_seq = time(NULL); + nlh->nlmsg_seq = (uint32_t)time(NULL); rtm = mnl_nlmsg_put_extra_header(nlh, sizeof(*rtm)); rtm->rtm_family = dst_osa->u.sa.sa_family; @@ -750,9 +779,9 @@ return netdev->priv_data; } -/*! Set data_ind_cb callback, called when a new packet is received on the network interface. +/*! Set ifupdown_ind_cb callback, called when the link status (UP/DOWN) changes. * \paramin netdev The netdev object where the field is set - * \paramin data_ind_cb the user provided function to be called when the link status (UP/DOWN) changes + * \paramin ifupdown_ind_cb the user provided function to be called when the link status (UP/DOWN) changes */ void osmo_netdev_set_ifupdown_ind_cb(struct osmo_netdev *netdev, osmo_netdev_ifupdown_ind_cb_t ifupdown_ind_cb) { @@ -857,6 +886,38 @@ return netdev->dev_name; } +/*! Set the MTU of the network interface + * \paramin netdev The netdev object where the field is set + * \paramin mtu The MTU to be set on the network interface + * \returns 0 on success; negative on error + * + */ +int osmo_netdev_set_mtu(struct osmo_netdev *netdev, uint32_t mtu) +{ + struct osmo_netns_switch_state switch_state; + int rc; + + if (!netdev->registered) + return -ENODEV; + + LOGNETDEV(netdev, LOGL_NOTICE, "Setting dev %s MTU %" PRIu32 "\n", + netdev->dev_name, mtu); + + NETDEV_NETNS_ENTER(netdev, &switch_state, "set_mtu"); + +#if ENABLE_LIBMNL + rc = netdev_mnl_set_mtu(netdev->netns_ctx->omnl, netdev->ifindex, + netdev->dev_name, mtu); +#else + LOGNETDEV(netdev, LOGL_ERROR, "%s: NOT SUPPORTED. Build libosmocore with --enable-libmnl.\n", __func__); + rc = -ENOTSUP; +#endif + + NETDEV_NETNS_EXIT(netdev, &switch_state, "set_mtu"); + + return rc; +} + /*! Bring netdev interface UP or DOWN. * \paramin netdev The netdev object managing the netdev interface * \paramin ifupdown true to set the interface UP, false to set it DOWN
View file
libosmocore_1.10.1.tar.xz/src/core/osmo_io.c -> libosmocore_1.11.0.tar.xz/src/core/osmo_io.c
Changed
@@ -209,8 +209,11 @@ */ int iofd_txqueue_enqueue(struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr) { - if (iofd->tx_queue.current_length >= iofd->tx_queue.max_length) + if (iofd->tx_queue.current_length >= iofd->tx_queue.max_length) { + LOGPIO(iofd, LOGL_ERROR, "enqueueing message failed (queue full, %u msgs). Rejecting msgb\n", + iofd->tx_queue.current_length); return -ENOSPC; + } llist_add_tail(&msghdr->list, &iofd->tx_queue.msg_queue); iofd->tx_queue.current_length++; @@ -340,8 +343,19 @@ do { pending = NULL; res = iofd_handle_segmentation(iofd, msg, &pending); - if (res != IOFD_SEG_ACT_DEFER || rc < 0) + if (res != IOFD_SEG_ACT_DEFER) { + /* 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. */ 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, + * so discard it: */ + if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) { + msgb_free(pending); + return; + } + } if (res == IOFD_SEG_ACT_HANDLE_MORE) msg = pending; } while (res == IOFD_SEG_ACT_HANDLE_MORE); @@ -512,7 +526,6 @@ 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; } @@ -588,7 +601,6 @@ 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; } @@ -737,9 +749,19 @@ { int rc = 0; + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) { + /* If re-registering same fd, handle as NO-OP. + * And it is an even more explicit NO-OP + * if the caller passed in -1. */ + if (fd < 0 || fd == iofd->fd) + return 0; + /* New FD should go through unregister() first. */ + return -ENOTSUP; + } + if (fd >= 0) iofd->fd = fd; - else if (iofd->fd < 0) { + if (iofd->fd < 0) { /* this might happen if both osmo_iofd_setup() and osmo_iofd_register() are called with -1 */ LOGPIO(iofd, LOGL_ERROR, "Cannot register io_fd using invalid fd == %d\n", iofd->fd); return -EBADF; @@ -750,6 +772,8 @@ return rc; IOFD_FLAG_UNSET(iofd, IOFD_FLAG_CLOSED); + IOFD_FLAG_SET(iofd, IOFD_FLAG_FD_REGISTERED); + if ((iofd->mode == OSMO_IO_FD_MODE_READ_WRITE && iofd->io_ops.read_cb) || (iofd->mode == OSMO_IO_FD_MODE_RECVFROM_SENDTO && iofd->io_ops.recvfrom_cb) || (iofd->mode == OSMO_IO_FD_MODE_RECVMSG_SENDMSG && iofd->io_ops.recvmsg_cb)) { @@ -772,7 +796,14 @@ */ int osmo_iofd_unregister(struct osmo_io_fd *iofd) { - return osmo_iofd_ops.unregister_fd(iofd); + int rc; + + if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) + return 0; + + rc = osmo_iofd_ops.unregister_fd(iofd); + IOFD_FLAG_UNSET(iofd, IOFD_FLAG_FD_REGISTERED); + return rc; } /*! Retrieve the number of messages pending in the transmit queue. @@ -845,6 +876,10 @@ iofd->pending = NULL; + osmo_iofd_ops.read_disable(iofd); + osmo_iofd_ops.write_disable(iofd); + osmo_iofd_unregister(iofd); + rc = osmo_iofd_ops.close(iofd); iofd->fd = -1; return rc;
View file
libosmocore_1.10.1.tar.xz/src/core/osmo_io_poll.c -> libosmocore_1.11.0.tar.xz/src/core/osmo_io_poll.c
Changed
@@ -56,25 +56,36 @@ OSMO_ASSERT(0); } - hdr.msg = msg; - hdr.iov0.iov_base = msg->tail; - hdr.iov0.iov_len = msgb_tailroom(msg); - hdr.hdr = (struct msghdr) { - .msg_iov = &hdr.iov0, - .msg_iovlen = 1, - .msg_name = &hdr.osa.u.sa, - .msg_namelen = sizeof(struct osmo_sockaddr), - }; - if (iofd->mode == OSMO_IO_FD_MODE_RECVMSG_SENDMSG) { - hdr.hdr.msg_control = alloca(iofd->cmsg_size); - hdr.hdr.msg_controllen = iofd->cmsg_size; + switch (iofd->mode) { + case OSMO_IO_FD_MODE_READ_WRITE: + rc = read(ofd->fd, msg->tail, msgb_tailroom(msg)); + if (rc > 0) + msgb_put(msg, rc); + iofd_handle_recv(iofd, msg, (rc < 0 && errno > 0) ? -errno : rc, NULL); + break; + case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: + hdr.msg = msg; + hdr.iov0.iov_base = msg->tail; + hdr.iov0.iov_len = msgb_tailroom(msg); + hdr.hdr = (struct msghdr) { + .msg_iov = &hdr.iov0, + .msg_iovlen = 1, + .msg_name = &hdr.osa.u.sa, + .msg_namelen = sizeof(struct osmo_sockaddr), + }; + if (iofd->mode == OSMO_IO_FD_MODE_RECVMSG_SENDMSG) { + hdr.hdr.msg_control = alloca(iofd->cmsg_size); + hdr.hdr.msg_controllen = iofd->cmsg_size; + } + rc = recvmsg(ofd->fd, &hdr.hdr, flags); + if (rc > 0) + msgb_put(msg, rc); + iofd_handle_recv(iofd, msg, (rc < 0 && errno > 0) ? -errno : rc, &hdr); + break; + default: + OSMO_ASSERT(0); } - - rc = recvmsg(ofd->fd, &hdr.hdr, flags); - if (rc > 0) - msgb_put(msg, rc); - - iofd_handle_recv(iofd, msg, (rc < 0 && errno > 0) ? -errno : rc, &hdr); } if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) @@ -83,7 +94,17 @@ if (what & OSMO_FD_WRITE) { struct iofd_msghdr *msghdr = iofd_txqueue_dequeue(iofd); if (msghdr) { - rc = sendmsg(ofd->fd, &msghdr->hdr, msghdr->flags); + switch (iofd->mode) { + case OSMO_IO_FD_MODE_READ_WRITE: + rc = write(ofd->fd, msghdr->iov0.iov_base, msghdr->iov0.iov_len); + break; + case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: + rc = sendmsg(ofd->fd, &msghdr->hdr, msghdr->flags); + break; + default: + OSMO_ASSERT(0); + } iofd_handle_send_completion(iofd, (rc < 0 && errno > 0) ? -errno : rc, msghdr); } else { /* Socket is writable, but we have no data to send. A non-blocking/async @@ -128,32 +149,24 @@ struct osmo_fd *ofd = &iofd->u.poll.ofd; int rc; - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) - return 0; osmo_fd_setup(ofd, iofd->fd, 0, &iofd_poll_ofd_cb_dispatch, iofd, 0); + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) + osmo_fd_write_enable(&iofd->u.poll.ofd); + rc = osmo_fd_register(ofd); - if (!rc) - IOFD_FLAG_SET(iofd, IOFD_FLAG_FD_REGISTERED); return rc; } static int iofd_poll_unregister(struct osmo_io_fd *iofd) { struct osmo_fd *ofd = &iofd->u.poll.ofd; - - if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) - return 0; osmo_fd_unregister(ofd); - IOFD_FLAG_UNSET(iofd, IOFD_FLAG_FD_REGISTERED); - return 0; } static int iofd_poll_close(struct osmo_io_fd *iofd) { - iofd_poll_unregister(iofd); osmo_fd_close(&iofd->u.poll.ofd); - return 0; } @@ -179,11 +192,9 @@ static void iofd_poll_notify_connected(struct osmo_io_fd *iofd) { - int rc; + /* Set flag to enable during register() time: */ + IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); - rc = iofd_poll_register(iofd); - if (rc < 0) - return; osmo_fd_write_enable(&iofd->u.poll.ofd); }
View file
libosmocore_1.10.1.tar.xz/src/core/osmo_io_uring.c -> libosmocore_1.11.0.tar.xz/src/core/osmo_io_uring.c
Changed
@@ -140,17 +140,17 @@ msghdr->iov0.iov_len = msgb_tailroom(msg); switch (action) { - case IOFD_ACT_READ: - break; case IOFD_ACT_RECVMSG: msghdr->hdr.msg_control = msghdr->cmsg; msghdr->hdr.msg_controllen = iofd->cmsg_size; /* fall-through */ case IOFD_ACT_RECVFROM: - msghdr->hdr.msg_iov = &msghdr->iov0; - msghdr->hdr.msg_iovlen = 1; msghdr->hdr.msg_name = &msghdr->osa.u.sa; msghdr->hdr.msg_namelen = osmo_sockaddr_size(&msghdr->osa); + /* fall-through */ + case IOFD_ACT_READ: + msghdr->hdr.msg_iov = &msghdr->iov0; + msghdr->hdr.msg_iovlen = 1; break; default: OSMO_ASSERT(0); @@ -164,7 +164,7 @@ switch (action) { case IOFD_ACT_READ: - io_uring_prep_readv(sqe, iofd->fd, msghdr->iov, 1, 0); + io_uring_prep_readv(sqe, iofd->fd, msghdr->iov, 1, -1); break; case IOFD_ACT_RECVMSG: case IOFD_ACT_RECVFROM: @@ -307,6 +307,8 @@ switch (msghdr->action) { case IOFD_ACT_WRITE: + io_uring_prep_writev(sqe, msghdr->iofd->fd, msghdr->iov, 1, -1); + break; case IOFD_ACT_SENDTO: case IOFD_ACT_SENDMSG: io_uring_prep_sendmsg(sqe, msghdr->iofd->fd, &msghdr->hdr, msghdr->flags); @@ -324,8 +326,65 @@ static void iofd_uring_write_enable(struct osmo_io_fd *iofd); static void iofd_uring_read_enable(struct osmo_io_fd *iofd); + +/* called via osmocom poll/select main handling once outbound non-blocking connect() completes */ +static int iofd_uring_connected_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct osmo_io_fd *iofd = ofd->data; + + LOGPIO(iofd, LOGL_DEBUG, "Socket connected or failed.\n"); + + if (!(what & OSMO_FD_WRITE)) + return 0; + + /* Unregister from poll/select handling. */ + osmo_fd_unregister(ofd); + IOFD_FLAG_UNSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); + + /* Notify the application about this via a zero-length write completion call-back. */ + IOFD_FLAG_SET(iofd, IOFD_FLAG_IN_CALLBACK); + switch (iofd->mode) { + case OSMO_IO_FD_MODE_READ_WRITE: + iofd->io_ops.write_cb(iofd, 0, NULL); + break; + case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + iofd->io_ops.sendto_cb(iofd, 0, NULL, NULL); + break; + case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: + iofd->io_ops.sendmsg_cb(iofd, 0, NULL); + break; + } + 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)) + iofd_uring_write_enable(iofd); + 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) + talloc_free(iofd); + return 0; +} + static int iofd_uring_register(struct osmo_io_fd *iofd) { + if (iofd->mode != OSMO_IO_FD_MODE_RECVMSG_SENDMSG) + return 0; /* Nothing to be done */ + + /* OSMO_IO_FD_MODE_RECVMSG_SENDMSG: + * Use a temporary osmo_fd which we can use to notify us once the connection is established + * or failed (indicated by FD becoming writable). This is needed as (at least for SCTP sockets) + * one cannot submit a zero-length writev/sendmsg in order to get notification when the socekt + * is writable.*/ + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) { + osmo_fd_setup(&iofd->u.uring.connect_ofd, iofd->fd, OSMO_FD_WRITE, + iofd_uring_connected_cb, iofd, 0); + if (osmo_fd_register(&iofd->u.uring.connect_ofd) < 0) { + LOGPIO(iofd, LOGL_ERROR, "Failed to register FD for connect event.\n"); + return -EBADFD; + } + } return 0; } @@ -450,72 +509,21 @@ static int iofd_uring_close(struct osmo_io_fd *iofd) { - iofd_uring_read_disable(iofd); - iofd_uring_write_disable(iofd); - iofd_uring_unregister(iofd); return close(iofd->fd); } -/* called via osmocom poll/select main handling once outbound non-blocking connect() completes */ -static int iofd_uring_connected_cb(struct osmo_fd *ofd, unsigned int what) +static void iofd_uring_notify_connected(struct osmo_io_fd *iofd) { - struct osmo_io_fd *iofd = ofd->data; - - LOGPIO(iofd, LOGL_DEBUG, "Socket connected or failed.\n"); - - if (!(what & OSMO_FD_WRITE)) - return 0; - - /* Unregister from poll/select handling. */ - osmo_fd_unregister(ofd); - IOFD_FLAG_UNSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); - - /* Notify the application about this via a zero-length write completion call-back. */ - IOFD_FLAG_SET(iofd, IOFD_FLAG_IN_CALLBACK); - switch (iofd->mode) { - case OSMO_IO_FD_MODE_READ_WRITE: - iofd->io_ops.write_cb(iofd, 0, NULL); - break; - case OSMO_IO_FD_MODE_RECVFROM_SENDTO: - iofd->io_ops.sendto_cb(iofd, 0, NULL, NULL); - break; - case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: - iofd->io_ops.sendmsg_cb(iofd, 0, NULL); - break; - } - 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->mode != OSMO_IO_FD_MODE_RECVMSG_SENDMSG) { iofd_uring_write_enable(iofd); - if (iofd->u.uring.read_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) - iofd_uring_read_enable(iofd); + return; + } - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_TO_FREE) && !iofd->u.uring.read_msghdr && !iofd->u.uring.write_msghdr) - talloc_free(iofd); - return 0; -} + /* 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); -static void iofd_uring_notify_connected(struct osmo_io_fd *iofd) -{ - if (iofd->mode == 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); - - /* Use a temporary osmo_fd which we can use to notify us once the connection is established - * or failed (indicated by FD becoming writable). - * This is needed as (at least for SCTP sockets) one cannot submit a zero-length writev/sendmsg - * in order to get notification when the socekt is writable.*/ - if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) { - osmo_fd_setup(&iofd->u.uring.connect_ofd, iofd->fd, OSMO_FD_WRITE, - iofd_uring_connected_cb, iofd, 0); - if (osmo_fd_register(&iofd->u.uring.connect_ofd) < 0) - LOGPIO(iofd, LOGL_ERROR, "Failed to register FD for connect event.\n"); - else - IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); - } - } else - iofd_uring_write_enable(iofd); + /* 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 = {
View file
libosmocore_1.10.1.tar.xz/src/core/socket.c -> libosmocore_1.11.0.tar.xz/src/core/socket.c
Changed
@@ -26,7 +26,9 @@ * \file socket.c */ #ifdef HAVE_SYS_SOCKET_H +#ifndef _GNU_SOURCE #define _GNU_SOURCE /* for struct ucred on glibc >= 2.8 */ +#endif #include <osmocom/core/logging.h> #include <osmocom/core/select.h> @@ -172,8 +174,8 @@ sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sfd == -1) { - LOGP(DLGLOBAL, LOGL_ERROR, - "unable to create socket: %s\n", strerror(errno)); + LOGP(DLGLOBAL, LOGL_ERROR, "unable to create socket(%d, %d, %d): %s\n", + rp->ai_family, rp->ai_socktype, rp->ai_protocol, strerror(errno)); return sfd; } @@ -278,6 +280,24 @@ return 0; } +/*! Determine if the system supports AF_INET6 sockets at all. + * We call socket(AF_INET6) once and cache the result value. */ +static bool system_supports_inet6(void) +{ + static int cached_val = -1; + + if (cached_val < 0) { + int rc = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + if (rc < 0 && errno == EAFNOSUPPORT) { + cached_val = 0; + } else if (rc >= 0) { + cached_val = 1; + close(rc); + } + } + return cached_val == 1; +} + /*! Initialize a socket (including bind and/or connect) * \paramin family Address Family like AF_INET, AF_INET6, AF_UNSPEC * \paramin type Socket type like SOCK_DGRAM, SOCK_STREAM @@ -343,26 +363,31 @@ /* It must do a full run to ensure AF_UNSPEC does not fail. * In case first local valid entry is IPv4 and only remote valid entry * is IPv6 or vice versa */ - if (family == AF_UNSPEC) { + if (!system_supports_inet6()) { + /* if no AF_INET6 is supported, then the decision is easy...*/ + local_ipv4 = true; + remote_ipv4 = true; + family = AF_INET; + } else if (family == AF_UNSPEC) { for (rp = local; rp != NULL; rp = rp->ai_next) { switch (rp->ai_family) { - case AF_INET: - local_ipv4 = true; - break; - case AF_INET6: - local_ipv6 = true; - break; + case AF_INET: + local_ipv4 = true; + break; + case AF_INET6: + local_ipv6 = true; + break; } } for (rp = remote; rp != NULL; rp = rp->ai_next) { switch (rp->ai_family) { - case AF_INET: - remote_ipv4 = true; - break; - case AF_INET6: - remote_ipv6 = true; - break; + case AF_INET: + remote_ipv4 = true; + break; + case AF_INET6: + remote_ipv6 = true; + break; } }
View file
libosmocore_1.10.1.tar.xz/src/core/thread.c -> libosmocore_1.11.0.tar.xz/src/core/thread.c
Changed
@@ -28,8 +28,10 @@ /* If HAVE_GETTID, then "_GNU_SOURCE" may need to be defined to use gettid() */ #if HAVE_GETTID +#ifndef _GNU_SOURCE #define _GNU_SOURCE -#endif +#endif /* ifndef _GNU_SOURCE */ +#endif /* if HAVE_GETTID */ #include <unistd.h> #include <sys/types.h>
View file
libosmocore_1.10.1.tar.xz/src/core/tun.c -> libosmocore_1.11.0.tar.xz/src/core/tun.c
Changed
@@ -268,7 +268,7 @@ /*! Open and configure fd of the tunnel device. * \paramin tundev The tundev object whose tunnel interface to open * \paramin flags internal linux flags to pass when creating the device (not used yet) - * \returns 0 on success; negative on error + * \returns tun fd on success; negative on error */ static int tundev_open_fd(struct osmo_tundev *tundev, int flags) { @@ -489,6 +489,15 @@ return tundev->name; } +/*! Get FD associated to the tundev object. + * \paramin tundev The tundev object from where to retrieve the field + * \returns The fd of the currently open tundev, negative otherwise + */ +int osmo_tundev_get_fd(const struct osmo_tundev *tundev) +{ + return tundev->wqueue.bfd.fd; +} + /*! Set name used to name the tunnel interface created by the tundev object. * \paramin tundev The tundev object where the field is set * \paramin dev_name The tunnel interface name to use @@ -556,13 +565,16 @@ /*! Submit a packet to the tunnel device managed by the tundev object * \paramin tundev The tundev object owning the tunnel device where to inject the packet * \paramin msg The msgb containg the packet to transfer - * \returns The current value of the configured network namespace + * \returns 0 on success; negative on error * * This function takes the ownership of msg in all cases. */ int osmo_tundev_send(struct osmo_tundev *tundev, struct msgb *msg) { - int rc = osmo_wqueue_enqueue(&tundev->wqueue, msg); + int rc; + + OSMO_ASSERT(tundev); + rc = osmo_wqueue_enqueue(&tundev->wqueue, msg); if (rc < 0) { LOGTUN(tundev, LOGL_ERROR, "Failed to enqueue the packet\n"); msgb_free(msg);
View file
libosmocore_1.10.1.tar.xz/src/core/utils.c -> libosmocore_1.11.0.tar.xz/src/core/utils.c
Changed
@@ -25,6 +25,14 @@ #include <stdint.h> #include <errno.h> #include <stdio.h> +#if !defined(PRId64) || !defined(PRIu64) +/* +it gets lost every few years.. +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953844 +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067692 +*/ +#include <sys/types.h> +#endif #include <inttypes.h> #include <limits.h>
View file
libosmocore_1.10.1.tar.xz/src/ctrl/Makefile.am -> libosmocore_1.11.0.tar.xz/src/ctrl/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=9:0:9 +LIBVERSION=9:1:9 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
View file
libosmocore_1.10.1.tar.xz/src/ctrl/control_cmd.c -> libosmocore_1.11.0.tar.xz/src/ctrl/control_cmd.c
Changed
@@ -425,7 +425,7 @@ osmo_escape_str(var, -1)); goto err; } - LOGP(DLCTRL, LOGL_DEBUG, "Command: GET %s\n", cmd->variable); + LOGP(DLCTRL, LOGL_DEBUG, "Command: GET %s %s\n", cmd->id, cmd->variable); break; case CTRL_TYPE_SET: var = strtok_r(NULL, " ", &saveptr); @@ -457,7 +457,7 @@ goto err; } - LOGP(DLCTRL, LOGL_DEBUG, "Command: SET %s = \"%s\"\n", cmd->variable, + LOGP(DLCTRL, LOGL_DEBUG, "Command: SET %s %s = \"%s\"\n", cmd->id, cmd->variable, osmo_escape_str(cmd->value, -1)); break; #define REPLY_CASE(TYPE, NAME) \ @@ -481,11 +481,11 @@ cmd->reply = talloc_strdup(cmd, val); \ if (!cmd->variable || !cmd->reply) \ goto oom; \ - LOGP(DLCTRL, LOGL_DEBUG, "Command: " NAME " %s: %s\n", cmd->variable, \ + LOGP(DLCTRL, LOGL_DEBUG, "Command: " NAME " %s %s: %s\n", cmd->id, cmd->variable, \ osmo_escape_str(cmd->reply, -1)); \ break - REPLY_CASE(CTRL_TYPE_GET_REPLY, "GET REPLY"); - REPLY_CASE(CTRL_TYPE_SET_REPLY, "SET REPLY"); + REPLY_CASE(CTRL_TYPE_GET_REPLY, "GET_REPLY"); + REPLY_CASE(CTRL_TYPE_SET_REPLY, "SET_REPLY"); REPLY_CASE(CTRL_TYPE_TRAP, "TRAP"); #undef REPLY_CASE case CTRL_TYPE_ERROR:
View file
libosmocore_1.10.1.tar.xz/src/ctrl/control_if.c -> libosmocore_1.11.0.tar.xz/src/ctrl/control_if.c
Changed
@@ -445,10 +445,10 @@ if (!cmd) { /* should never happen */ + LOGP(DLCTRL, LOGL_ERROR, "Command parser error: %s\n", msgb_hexdump(msg)); cmd = talloc_zero(ccon, struct ctrl_cmd); if (!cmd) return -ENOMEM; - LOGP(DLCTRL, LOGL_ERROR, "Command parser error.\n"); cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Command parser error."; @@ -474,6 +474,8 @@ send_reply: /* There is a reply or error that should be reported back to the sender. */ + LOGP(DLCTRL, LOGL_DEBUG, "Tx Command reply: %s %s %s %s\n", + get_value_string(ctrl_type_vals, cmd->type), cmd->id, cmd->variable, cmd->reply); ctrl_cmd_send2(ccon, cmd); just_free: talloc_free(cmd);
View file
libosmocore_1.10.1.tar.xz/src/gb/Makefile.am -> libosmocore_1.11.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=16:1:2 +LIBVERSION=17:0:3 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall -fno-strict-aliasing \
View file
libosmocore_1.10.1.tar.xz/src/gb/gprs_bssgp.c -> libosmocore_1.11.0.tar.xz/src/gb/gprs_bssgp.c
Changed
@@ -354,6 +354,24 @@ return osmo_load16be(buf+6); } +/*! Parse the value of a BSSGP Cell identity (04.08 RAI + Cell Id) */ +int bssgp_parse_cell_id2(struct osmo_routing_area_id *raid, uint16_t *cid, + const uint8_t *buf, size_t buf_len) +{ + if (buf_len < 8) + return -EINVAL; + + /* 6 octets RAC */ + if (raid) + osmo_routing_area_id_decode(raid, buf, buf_len); + + /* 2 octets CID */ + if (cid) + *cid = osmo_load16be(buf + sizeof(struct gsm48_ra_id)); + + return 0; +} + int bssgp_create_cell_id(uint8_t *buf, const struct gprs_ra_id *raid, uint16_t cid) { @@ -364,6 +382,23 @@ return 8; } + +/*! Encode the 04.08 RAI, Cell Id into BSSGP Cell identity */ +int bssgp_create_cell_id2(uint8_t *buf, size_t buf_len, + const struct osmo_routing_area_id *raid, + const uint16_t cid) +{ + if (buf_len < 8) + return -ENOMEM; + + /* 6 octets RAC */ + osmo_routing_area_id_encode_buf(buf, buf_len, raid); + + /* 2 octets CID */ + osmo_store16be(cid, buf + sizeof(struct gsm48_ra_id)); + + return 8; +} /* Chapter 8.4 BVC-Reset Procedure */ static int bssgp_rx_bvc_reset(struct msgb *msg, struct tlv_parsed *tp,
View file
libosmocore_1.10.1.tar.xz/src/gb/gprs_ns2_sns.c -> libosmocore_1.11.0.tar.xz/src/gb/gprs_ns2_sns.c
Changed
@@ -47,6 +47,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/socket.h> #include <osmocom/core/sockaddr_str.h> +#include <osmocom/core/talloc.h> #include <osmocom/gsm/tlv.h> #include <osmocom/gprs/gprs_msgb.h> #include <osmocom/gprs/gprs_ns2.h> @@ -500,7 +501,8 @@ { /* check for duplicates */ for (unsigned int i = 0; i < elems->num_ip4; i++) { - if (memcmp(&elems->ip4i, ip4, sizeof(*ip4))) + if (elems->ip4i.ip_addr != ip4->ip_addr || + elems->ip4i.udp_port != ip4->udp_port) continue; return -1; } @@ -519,8 +521,10 @@ unsigned int i; for (i = 0; i < elems->num_ip4; i++) { - if (memcmp(&elems->ip4i, ip4, sizeof(*ip4))) + if (elems->ip4i.ip_addr != ip4->ip_addr || + elems->ip4i.udp_port != ip4->udp_port) continue; + /* all array elements < i remain as they are; all > i are shifted left by one */ memmove(&elems->ip4i, &elems->ip4i+1, elems->num_ip4-i-1); elems->num_ip4 -= 1; @@ -573,7 +577,8 @@ unsigned int i; for (i = 0; i < elems->num_ip6; i++) { - if (memcmp(&elems->ip6i, ip6, sizeof(*ip6))) + if (memcmp(&elems->ip6i.ip_addr, &ip6->ip_addr, sizeof(ip6->ip_addr)) || + elems->ip6i.udp_port != ip6->udp_port) continue; /* all array elements < i remain as they are; all > i are shifted left by one */ memmove(&elems->ip6i, &elems->ip6i+1, elems->num_ip6-i-1); @@ -744,12 +749,16 @@ case AF_INET: if (gss->remote.num_ip4 >= gss->num_max_ip4_remote) return -NS_CAUSE_INVAL_NR_NS_VC; + if (!ip4) + return -NS_CAUSE_PROTO_ERR_UNSPEC; /* TODO: log message duplicate */ rc = add_ip4_elem(gss, &gss->remote, ip4); break; case AF_INET6: if (gss->remote.num_ip6 >= gss->num_max_ip6_remote) return -NS_CAUSE_INVAL_NR_NS_VC; + if (!ip6) + return -NS_CAUSE_PROTO_ERR_UNSPEC; /* TODO: log message duplicate */ rc = add_ip6_elem(gss, &gss->remote, ip6); break; @@ -787,8 +796,6 @@ break; } - gprs_ns2_start_alive_all_nsvcs(nse); - return 0; } @@ -1234,7 +1241,7 @@ do_sns_delete(fi, &v4_listj, NULL); cause = -rc; ns2_tx_sns_ack(gss->sns_nsvc, trans_id, &cause, NULL, 0, NULL, 0); - break; + return; } } } else { /* IPv6 */ @@ -1255,13 +1262,15 @@ do_sns_delete(fi, NULL, &v6_listj); cause = -rc; ns2_tx_sns_ack(gss->sns_nsvc, trans_id, &cause, NULL, 0, NULL, 0); - break; + return; } } } /* TODO: correct behaviour is to answer to the *same* NSVC from which the SNS_ADD was received */ - ns2_tx_sns_ack(gss->sns_nsvc, trans_id, NULL, v4_list, num_v4, v6_list, num_v6); + ns2_tx_sns_ack(gss->sns_nsvc, trans_id, NULL, NULL, 0, NULL, 0); + + gprs_ns2_start_alive_all_nsvcs(gss->nse); } static void ns2_sns_st_configured_delete(struct osmo_fsm_inst *fi, @@ -1431,7 +1440,8 @@ ns2_tx_sns_ack(gss->sns_nsvc, trans_id, &cause, NULL, 0, NULL, 0); return; } - ns2_tx_sns_ack(gss->sns_nsvc, trans_id, NULL, v4_list, num_v4, v6_list, num_v6); + + ns2_tx_sns_ack(gss->sns_nsvc, trans_id, NULL, NULL, 0, NULL, 0); } static void ns2_sns_st_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
View file
libosmocore_1.10.1.tar.xz/src/gb/libosmogb.map -> libosmocore_1.11.0.tar.xz/src/gb/libosmogb.map
Changed
@@ -2,6 +2,7 @@ global: bssgp_cause_str; bssgp_create_cell_id; +bssgp_create_cell_id2; bssgp_create_rim_ri; bssgp_dec_app_err_cont_nacc; bssgp_dec_ran_inf_ack_rim_cont; @@ -32,6 +33,7 @@ bssgp_msgb_ra_put; bssgp_nacc_cause_strs; bssgp_parse_cell_id; +bssgp_parse_cell_id2; bssgp_parse_rim_pdu; bssgp_parse_rim_ri; bssgp_parse_rim_ra;
View file
libosmocore_1.10.1.tar.xz/src/gsm/Makefile.am -> libosmocore_1.11.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=21:1:1 +LIBVERSION=22:0:2 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
View file
libosmocore_1.10.1.tar.xz/src/gsm/gsm23003.c -> libosmocore_1.11.0.tar.xz/src/gsm/gsm23003.c
Changed
@@ -357,6 +357,44 @@ return osmo_cgi_ps_name_buf(buf, sizeof(buf), cgi_ps); } +/*! Return string representation of RNC in caller-provided output buffer. + * \paramout buf pointer to caller-provided output buffer + * \paramin buf_len size of buf in bytes + * \paramin rnc RNC to be stringified + * \returns buf + */ +char *osmo_rnc_id_name_buf(char *buf, size_t buf_len, const struct osmo_rnc_id *rnc) +{ + char plmn16; + snprintf(buf, buf_len, "%s-%d", osmo_plmn_name_buf(plmn, sizeof(plmn), &rnc->plmn), + rnc->rnc_id); + return buf; +} + +/*! Return string representation of RNC in static output buffer. + * \paramin rnc RNC to be stringified + * \returns pointer to static output buffer + */ +const char *osmo_rnc_id_name(const struct osmo_rnc_id *rnc) +{ + static __thread char buf32; + return osmo_rnc_id_name_buf(buf, sizeof(buf), rnc); +} + +/*! Return string representation of RNC in static output buffer. + * \paramout buf pointer to caller-provided output buffer + * \paramin buf_len size of buf in bytes + * \paramin rnc RNC to be stringified + * \returns pointer to static output buffer + */ +char *osmo_rnc_id_name_c(const void *ctx, const struct osmo_rnc_id *rnc) +{ + char *buf = talloc_size(ctx, 32); + if (!buf) + return NULL; + return osmo_rnc_id_name_buf(buf, 32, rnc); +} + /*! Return MCC-MNC-LAC-RAC-CI as string, in a talloc-allocated output buffer. * \paramin ctx talloc context from which to allocate output buffer * \paramin cgi_ps CGI-PS to encode. @@ -656,6 +694,58 @@ return 0; } +/* Compare two RNC Ids + * The order of comparison is PLMN, RNCId. + * \param ain "Left" side RNC Id. + * \param bin "Right" side RNC Id. + * \returns 0 if the RNC Ids are equal, -1 if a < b, 1 if a > b. */ +int osmo_rnc_id_cmp(const struct osmo_rnc_id *a, const struct osmo_rnc_id *b) +{ + int rc = osmo_plmn_cmp(&a->plmn, &b->plmn); + if (rc) + return rc; + + if (a->rnc_id < b->rnc_id) + return -1; + if (a->rnc_id > b->rnc_id) + return 1; + return 0; +} + +/* Compare two MME Ids + * The order of comparison is MME GroupId, MME Code. + * \param ain "Left" side MME Id. + * \param bin "Right" side MME Id. + * \returns 0 if the MME Ids are equal, -1 if a < b, 1 if a > b. */ +int osmo_mme_id_cmp(const struct osmo_mme_id *a, const struct osmo_mme_id *b) +{ + if (a->group_id < b->group_id) + return -1; + if (a->group_id > b->group_id) + return 1; + + if (a->code < b->code) + return -1; + if (a->code > b->code) + return 1; + + return 0; +} + +/* Compare two GUMMEI + * The order of comparison is MCC, MNC, MME GroupId, MME Code. + * \param ain "Left" side GUMMEI. + * \param bin "Right" side GUMMEI. + * \returns 0 if the GUMMEI are equal, -1 if a < b, 1 if a > b. */ +int osmo_gummei_cmp(const struct osmo_gummei *a, const struct osmo_gummei *b) +{ + int rc = osmo_plmn_cmp(&a->plmn, &b->plmn); + if (rc) + return rc; + + return osmo_mme_id_cmp(&a->mme, &b->mme); +} + /*! Generate TS 23.003 Section 19.2 Home Network Realm/Domain (text form) * \param outout caller-provided output buffer, at least 33 bytes long * \param plmnin Osmocom representation of PLMN ID (MCC + MNC)
View file
libosmocore_1.10.1.tar.xz/src/gsm/gsm23236.c -> libosmocore_1.11.0.tar.xz/src/gsm/gsm23236.c
Changed
@@ -487,7 +487,7 @@ int osmo_nri_ranges_vty_add(const char **message, struct osmo_nri_range *added_range, struct osmo_nri_ranges *nri_ranges, int argc, const char **argv, uint8_t nri_bitlen) { - struct osmo_nri_range add_range; + struct osmo_nri_range add_range = {}; if (osmo_nri_parse_range(&add_range, argv0, argc > 1 ? argv1 : NULL)) { *message = "Error: cannot parse NRI range"; return -1; @@ -523,7 +523,7 @@ int osmo_nri_ranges_vty_del(const char **message, struct osmo_nri_range *removed_range, struct osmo_nri_ranges *nri_ranges, int argc, const char **argv) { - struct osmo_nri_range del_range; + struct osmo_nri_range del_range = {}; if (osmo_nri_parse_range(&del_range, argv0, argc > 1 ? argv1 : NULL)) { *message = "Error: cannot parse NRI range"; return -1;
View file
libosmocore_1.10.1.tar.xz/src/gsm/gsm48.c -> libosmocore_1.11.0.tar.xz/src/gsm/gsm48.c
Changed
@@ -222,6 +222,34 @@ return osmo_rai_name_buf(buf, 32, rai); } +/*! Convert osmo_routing_area_id (new) into gprs_ra_id (old) */ +void osmo_rai_to_gprs(struct gprs_ra_id *dest, const struct osmo_routing_area_id *src) +{ + OSMO_ASSERT(src); + OSMO_ASSERT(dest); + + dest->mcc = src->lac.plmn.mcc; + dest->mnc = src->lac.plmn.mnc; + dest->mnc_3_digits = src->lac.plmn.mnc_3_digits; + + dest->lac = src->lac.lac; + dest->rac = src->rac; +} + +/*! Convert gprs_ra_id (old) into osmo_routing_area_id (new) */ +void gprs_rai_to_osmo(struct osmo_routing_area_id *dest, const struct gprs_ra_id *src) +{ + OSMO_ASSERT(src); + OSMO_ASSERT(dest); + + dest->lac.plmn.mcc = src->mcc; + dest->lac.plmn.mnc = src->mnc; + dest->lac.plmn.mnc_3_digits = src->mnc_3_digits; + + dest->lac.lac = src->lac; + dest->rac = src->rac; +} + /* FIXME: convert to value_string */ static const char *cc_state_names32 = { "NULL", @@ -1826,9 +1854,13 @@ { GSM48_REJECT_PLMN_NOT_ALLOWED, "PLMN_NOT_ALLOWED" }, { GSM48_REJECT_LOC_NOT_ALLOWED, "LOC_NOT_ALLOWED" }, { GSM48_REJECT_ROAMING_NOT_ALLOWED, "ROAMING_NOT_ALLOWED" }, + { GSM48_REJECT_NO_SUIT_CELL_IN_LA, "NO_SUIT_CELL_IN_LA" }, { GSM48_REJECT_NETWORK_FAILURE, "NETWORK_FAILURE" }, + { GSM48_REJECT_MAC_FAILURE, "MAC_FAILURE" }, { GSM48_REJECT_SYNCH_FAILURE, "SYNCH_FAILURE" }, { GSM48_REJECT_CONGESTION, "CONGESTION" }, + { GSM48_REJECT_GSM_AUTH_UNACCEPTABLE, "GSM_AUTH_UNACCEPTABLE" }, + { GSM48_REJECT_NOT_AUTH_FOR_CSG, "NOT_AUTH_FOR_CSG" }, { GSM48_REJECT_SRV_OPT_NOT_SUPPORTED, "SRV_OPT_NOT_SUPPORTED" }, { GSM48_REJECT_RQD_SRV_OPT_NOT_SUPPORTED, "RQD_SRV_OPT_NOT_SUPPORTED" }, { GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER, "SRV_OPT_TMP_OUT_OF_ORDER" }, @@ -1847,6 +1879,8 @@ { GSM48_REJECT_IMPLICITLY_DETACHED, "IMPLICITLY_DETACHED" }, { GSM48_REJECT_GPRS_NOT_ALLOWED_IN_PLMN, "GPRS_NOT_ALLOWED_IN_PLMN" }, { GSM48_REJECT_MSC_TMP_NOT_REACHABLE, "MSC_TMP_NOT_REACHABLE" }, + { GSM48_REJECT_SMS_PROV_VIA_GPRS_IN_RA, "SMS_PROV_VIA_GPRS_IN_RA" }, + { GSM48_REJECT_NO_PDP_CONTEXT_ACTIVATED, "NO_PDP_CONTEXT_ACTIVATED" }, { 0, NULL } };
View file
libosmocore_1.10.1.tar.xz/src/gsm/gsm_utils.c -> libosmocore_1.11.0.tar.xz/src/gsm/gsm_utils.c
Changed
@@ -1019,6 +1019,27 @@ return TLLI_RESERVED; } +/*! Determine P-TMSI from foreign and local TLLIs + * + * \paramin tlli P-TMSI + * \paramin type TLLI Type we want to derive from \a p_tmsi + * \returns P-TMSI or 0xffffffff on error. */ +uint32_t gprs_tlli2tmsi(uint32_t tlli) +{ + uint32_t ptmsi = 0xc0000000; + + switch (gprs_tlli_type(tlli)) { + case TLLI_LOCAL: + case TLLI_FOREIGN: + break; + default: + return 0xffffffff; + } + + ptmsi |= tlli; + return ptmsi; +} + /*! Determine TLLI from P-TMSI * \paramin p_tmsi P-TMSI * \paramin type TLLI Type we want to derive from \a p_tmsi
View file
libosmocore_1.10.1.tar.xz/src/gsm/ipa.c -> libosmocore_1.11.0.tar.xz/src/gsm/ipa.c
Changed
@@ -404,7 +404,7 @@ return msg; } -/*! Generate IPA CCM ID RESP based on requets payload +/*! Generate IPA CCM ID RESP based on request payload * \paramin dev Descriptor describing identity data for response * \paramin data Payload of the IPA CCM ID GET request * \paramin len Length of \a data in octets
View file
libosmocore_1.10.1.tar.xz/src/gsm/iuup.c -> libosmocore_1.11.0.tar.xz/src/gsm/iuup.c
Changed
@@ -1,5 +1,9 @@ /*! \file iu_up.c - * IuUP (Iu User Plane) according to 3GPP TS 25.415 */ + * IuUP (Iu User Plane) according to 3GPP TS 25.415 + * See also 3GPP TS 25.414 regarding data transport. + * See also 3GPP TS 29.414 and 3GPP TS 29.415 regarding Nb counterparts + * of the above specs. + */ /* * (C) 2017 by Harald Welte <laforge@gnumonks.org> *
View file
libosmocore_1.10.1.tar.xz/src/gsm/libosmogsm.map -> libosmocore_1.11.0.tar.xz/src/gsm/libosmogsm.map
Changed
@@ -73,6 +73,7 @@ gprs_cipher_key_length; gprs_tlli_type; gprs_tmsi2tlli; +gprs_tlli2tmsi; gprs_ms_net_cap_gea_supported; gprs_msgt_gmm_names; @@ -487,6 +488,8 @@ osmo_rai_name2; osmo_rai_name2_buf; osmo_rai_name2_c; +osmo_rai_to_gprs; +gprs_rai_to_osmo; osmo_cgi_cmp; osmo_cgi_name; osmo_cgi_name_buf; @@ -497,9 +500,15 @@ osmo_cgi_ps_name_buf; osmo_cgi_ps_name_c; osmo_cgi_ps_name2; +osmo_rnc_id_name; +osmo_rnc_id_name_buf; +osmo_rnc_id_name_c; +osmo_rnc_id_cmp; osmo_gummei_name; osmo_gummei_name_buf; osmo_gummei_name_c; +osmo_gummei_cmp; +osmo_mme_id_cmp; osmo_mnc_from_str; osmo_mnc_cmp; osmo_plmn_cmp;
View file
libosmocore_1.10.1.tar.xz/src/vty/Makefile.am -> libosmocore_1.11.0.tar.xz/src/vty/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=13:1:0 +LIBVERSION=13:2:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS)
View file
libosmocore_1.10.1.tar.xz/src/vty/command.c -> libosmocore_1.11.0.tar.xz/src/vty/command.c
Changed
@@ -3451,7 +3451,6 @@ unlink(config_file_tmp); return -3; } - sync(); if (unlink(config_file) != 0) { *outpath = talloc_strdup(tall_vty_cmd_ctx, config_file); talloc_free(config_file_sav); @@ -3468,7 +3467,6 @@ return -5; } unlink(config_file_tmp); - sync(); talloc_free(config_file_sav); talloc_free(config_file_tmp);
View file
libosmocore_1.10.1.tar.xz/src/vty/cpu_sched_vty.c -> libosmocore_1.11.0.tar.xz/src/vty/cpu_sched_vty.c
Changed
@@ -23,7 +23,9 @@ * SPDX-License-Identifier: GPLv2+ */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include "config.h"
View file
libosmocore_1.10.1.tar.xz/tests/Makefile.am -> libosmocore_1.11.0.tar.xz/tests/Makefile.am
Changed
@@ -26,7 +26,9 @@ abis/abis_test endian/endian_test sercomm/sercomm_test \ prbs/prbs_test gsm23003/gsm23003_test \ gsm23236/gsm23236_test \ - codec/codec_ecu_fr_test timer/clk_override_test \ + codec/codec_ecu_fr_test codec/codec_efr_sid_test \ + codec/codec_fr_sid_test codec/codec_hr_sid_test \ + timer/clk_override_test \ oap/oap_client_test gsm29205/gsm29205_test \ logging/logging_vty_test \ vty/vty_transcript_test \ @@ -265,6 +267,15 @@ codec_codec_ecu_fr_test_SOURCES = codec/codec_ecu_fr_test.c codec_codec_ecu_fr_test_LDADD = $(top_builddir)/src/codec/libosmocodec.la $(LDADD) +codec_codec_efr_sid_test_SOURCES = codec/codec_efr_sid_test.c +codec_codec_efr_sid_test_LDADD = $(top_builddir)/src/codec/libosmocodec.la $(LDADD) + +codec_codec_fr_sid_test_SOURCES = codec/codec_fr_sid_test.c +codec_codec_fr_sid_test_LDADD = $(top_builddir)/src/codec/libosmocodec.la $(LDADD) + +codec_codec_hr_sid_test_SOURCES = codec/codec_hr_sid_test.c +codec_codec_hr_sid_test_LDADD = $(top_builddir)/src/codec/libosmocodec.la $(LDADD) + loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c loggingrb_loggingrb_test_LDADD = $(LDADD) @@ -438,6 +449,9 @@ loggingrb/logging_test.err strrb/strrb_test.ok \ codec/codec_test.ok \ codec/codec_ecu_fr_test.ok \ + codec/codec_efr_sid_test.ok codec/codec_efr_sid_test.in \ + codec/codec_fr_sid_test.ok codec/codec_fr_sid_test.in \ + codec/codec_hr_sid_test.ok codec/codec_hr_sid_test.in \ vty/vty_test.ok vty/vty_test.err \ vty/fail_not_de-indented.cfg \ vty/fail_tabs_and_spaces.cfg \ @@ -598,6 +612,12 @@ >$(srcdir)/codec/codec_test.ok codec/codec_ecu_fr_test \ >$(srcdir)/codec/codec_ecu_fr_test.ok + codec/codec_efr_sid_test $(srcdir)/codec/codec_efr_sid_test.in \ + >$(srcdir)/codec/codec_efr_sid_test.ok + codec/codec_fr_sid_test $(srcdir)/codec/codec_fr_sid_test.in \ + >$(srcdir)/codec/codec_fr_sid_test.ok + codec/codec_hr_sid_test $(srcdir)/codec/codec_hr_sid_test.in \ + >$(srcdir)/codec/codec_hr_sid_test.ok if ENABLE_GB fr/fr_test \ >$(srcdir)/fr/fr_test.ok
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_efr_sid_test.c
Added
@@ -0,0 +1,97 @@ +/* + * This program is a test for osmo_efr_sid_classify(). It reads a set of + * EFR codec frames in hex format (TS 101 318 RTP format represented in hex, + * each frame as its own hex line) and feeds each test frame to + * osmo_efr_sid_classify(). It then prints the output next to each input. + * + * Author: Mychaela N. Falconia <falcon@freecalypso.org>, 2024 - however, + * Mother Mychaela's contributions are NOT subject to copyright. + * No rights reserved, all rights relinquished. + * + * 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 <ctype.h> +#include <stdio.h> +#include <stdint.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +#include <osmocom/core/utils.h> +#include <osmocom/codec/codec.h> + +static void process_record(const char *hex_str) +{ + uint8_t frame_bytesGSM_EFR_BYTES; + enum osmo_gsm631_sid_class sidc; + + osmo_hexparse(hex_str, frame_bytes, GSM_EFR_BYTES); + sidc = osmo_efr_sid_classify(frame_bytes); + printf("%s ==> %d\n", hex_str, (int) sidc); +} + +static void process_line(char *linebuf, const char *infname, int lineno) +{ + char *cp = linebuf, *hex_str; + int ndig; + + while (isspace(*cp)) + cp++; + if (*cp == '\0' || *cp == '#') + return; + /* expect string of 62 hex digits */ + hex_str = cp; + for (ndig = 0; ndig < GSM_EFR_BYTES * 2; ndig++) { + if (!isxdigit(*cp)) + goto inv; + cp++; + } + if (*cp) { + if (!isspace(*cp)) + goto inv; + *cp++ = '\0'; + } + /* must be end of non-comment line */ + while (isspace(*cp)) + cp++; + if (*cp != '\0' && *cp != '#') + goto inv; + + process_record(hex_str); + return; + +inv: fprintf(stderr, "%s line %d: invalid syntax\n", infname, lineno); + exit(1); +} + +int main(int argc, char **argv) +{ + const char *infname; + FILE *inf; + char linebuf128; + int lineno; + + if (argc != 2) { + fprintf(stderr, "usage: %s input-file\n", argv0); + exit(1); + } + infname = argv1; + inf = fopen(infname, "r"); + if (!inf) { + perror(infname); + exit(1); + } + for (lineno = 1; fgets(linebuf, sizeof(linebuf), inf); lineno++) + process_line(linebuf, infname, lineno); + fclose(inf); + exit(0); +}
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_efr_sid_test.in
Added
@@ -0,0 +1,183 @@ +# This file is input for the EFR SID classifier test program. +# It has been generated here: +# +# https://www.freecalypso.org/hg/vband-misc/file/tip/efr-sid +# +# Unit-test-desc file in the above directory contains +# a detailed description. + +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5802FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5804FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B58067FFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806BFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806DFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806EFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806F7FFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FBFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FDFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FEFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FF7FF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFBFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFDFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFEFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFF7F80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFBF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFDF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFEF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFF780001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFB80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFD80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFE80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF00001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E1BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E2BFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E33FFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E39FFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3AFFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3B7FFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BBFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BDFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BEFFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BF7FFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFBFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFDFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFEFFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFF7FE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFBFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFDFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFEFE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFF7E0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFBE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFDE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFEE0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFF60000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFA0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFC0000800FFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE00008007FFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800BFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800DFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800EFFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800F7FFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FBFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FDFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FEFFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FF7FFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFBFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFDFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFEFFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFF7FF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFBFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFDFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFEFF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFF7F000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFBF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFDF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFEF000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFF7000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFB000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFD000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFE000040FFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF0000407FFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040BFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040DFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040EFFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040F7FCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FBFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FDFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FEFCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FF7CFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFBCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFDCFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFECFFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFF4FFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFF8FFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFC7FC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCBFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCDFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCEFC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCF7C00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFBC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFDC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFEC00010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFF400010 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFF800010 +C286DD29B5802FFFFF80001E3BFFFFE00008007FFFFF000040FFFCFFC00010 +C286DD29B5804FFFFF80001E3BFFFFE0000800BFFFFF000040FFFCFFC00010 +C286DD29B58067FFFF80001E3BFFFFE0000800DFFFFF000040FFFCFFC00010 +C286DD29B5806BFFFF80001E3BFFFFE0000800EFFFFF000040FFFCFFC00010 +C286DD29B5806DFFFF80001E3BFFFFE0000800F7FFFF000040FFFCFFC00010 +C286DD29B5806EFFFF80001E3BFFFFE0000800FBFFFF000040FFFCFFC00010 +C286DD29B5806F7FFF80001E3BFFFFE0000800FDFFFF000040FFFCFFC00010 +C286DD29B5806FBFFF80001E3BFFFFE0000800FEFFFF000040FFFCFFC00010 +C286DD29B5806FDFFF80001E3BFFFFE0000800FF7FFF000040FFFCFFC00010 +C286DD29B5806FEFFF80001E3BFFFFE0000800FFBFFF000040FFFCFFC00010 +C286DD29B5806FF7FF80001E3BFFFFE0000800FFDFFF000040FFFCFFC00010 +C286DD29B5806FFBFF80001E3BFFFFE0000800FFEFFF000040FFFCFFC00010 +C286DD29B5806FFDFF80001E3BFFFFE0000800FFF7FF000040FFFCFFC00010 +C286DD29B5806FFEFF80001E3BFFFFE0000800FFFBFF000040FFFCFFC00010 +C286DD29B5806FFF7F80001E3BFFFFE0000800FFFDFF000040FFFCFFC00010 +C286DD29B5806FFFBF80001E3BFFFFE0000800FFFEFF000040FFFCFFC00010 +C286DD29B5806FFFDF80001E3BFFFFE0000800FFFF7F000040FFFCFFC00010 +C286DD29B5806FFFEF80001E3BFFFFE0000800FFFFBF000040FFFCFFC00010 +C286DD29B5806FFFF780001E3BFFFFE0000800FFFFDF000040FFFCFFC00010 +C286DD29B5806FFFFB80001E3BFFFFE0000800FFFFEF000040FFFCFFC00010 +C286DD29B5806FFFFD80001E3BFFFFE0000800FFFFF7000040FFFCFFC00010 +C286DD29B5806FFFFE80001E3BFFFFE0000800FFFFFB000040FFFCFFC00010 +C286DD29B5806FFFFF00001E3BFFFFE0000800FFFFFD000040FFFCFFC00010 +C286DD29B5806FFFFF80001E1BFFFFE0000800FFFFFE000040FFFCFFC00010 +C286DD29B5806FFFFF80001E2BFFFFE0000800FFFFFF0000407FFCFFC00010 +C286DD29B5806FFFFF80001E33FFFFE0000800FFFFFF000040BFFCFFC00010 +C286DD29B5806FFFFF80001E39FFFFE0000800FFFFFF000040DFFCFFC00010 +C286DD29B5806FFFFF80001E3AFFFFE0000800FFFFFF000040EFFCFFC00010 +C286DD29B5806FFFFF80001E3B7FFFE0000800FFFFFF000040F7FCFFC00010 +C286DD29B5806FFFFF80001E3BBFFFE0000800FFFFFF000040FBFCFFC00010 +C286DD29B5806FFFFF80001E3BDFFFE0000800FFFFFF000040FDFCFFC00010 +C286DD29B5806FFFFF80001E3BEFFFE0000800FFFFFF000040FEFCFFC00010 +C286DD29B5806FFFFF80001E3BF7FFE0000800FFFFFF000040FF7CFFC00010 +C286DD29B5806FFFFF80001E3BFBFFE0000800FFFFFF000040FFBCFFC00010 +C286DD29B5806FFFFF80001E3BFDFFE0000800FFFFFF000040FFDCFFC00010 +C286DD29B5806FFFFF80001E3BFEFFE0000800FFFFFF000040FFECFFC00010 +C286DD29B5806FFFFF80001E3BFF7FE0000800FFFFFF000040FFF4FFC00010 +C286DD29B5806FFFFF80001E3BFFBFE0000800FFFFFF000040FFF8FFC00010 +C286DD29B5806FFFFF80001E3BFFDFE0000800FFFFFF000040FFFC7FC00010 +C286DD29B5806FFFFF80001E3BFFEFE0000800FFFFFF000040FFFCBFC00010 +C286DD29B5806FFFFF80001E3BFFF7E0000800FFFFFF000040FFFCDFC00010 +C286DD29B5806FFFFF80001E3BFFFBE0000800FFFFFF000040FFFCEFC00010 +C286DD29B5806FFFFF80001E3BFFFDE0000800FFFFFF000040FFFCF7C00010 +C286DD29B5806FFFFF80001E3BFFFEE0000800FFFFFF000040FFFCFBC00010 +C286DD29B5806FFFFF80001E3BFFFF60000800FFFFFF000040FFFCFDC00010 +C286DD29B5806FFFFF80001E3BFFFFA0000800FFFFFF000040FFFCFEC00010 +C286DD29B5806FFFFF80001E3BFFFFC0000800FFFFFF000040FFFCFF400010 +C286DD29B5806FFFFF80001E3BFFFFE00008007FFFFF000040FFFCFF800010 +C286DD29B5802F7DF780001E2BDF7DE0000800BEFBEF000040BEF8FFC00010 +C286DD29B5804FBEFB80001E33EFBEE0000800DF7DF7000040DF7C7FC00010 +C286DD29B58067DF7D80001E39F7DF60000800EFBEFB000040EFBCBFC00010 +C286DD29B5806BEFBE80001E3AFBEFA0000800F7DF7D000040F7DCDFC00010 +C286DD29B5806DF7DF00001E3B7DF7C0000800FBEFBE000040FBECEFC00010 +C286DD29B5806EFBEF80001E1BBEFBE00008007DF7DF0000407DF4F7C00010 +C286DD29B5806F7DF780001E2BDF7DE0000800BEFBEF000040BEF8FBC00010 +C286DD29B5806FBEFB80001E33EFBEE0000800DF7DF7000040DF7C7DC00010 +C286DD29B5806FDF7D80001E39F7DF60000800EFBEFB000040EFBCBEC00010 +C286DD29B5806FEFBE80001E3AFBEFA0000800F7DF7D000040F7DCDF400010 +C286DD29B5806FF7DF00001E3B7DF7C0000800FBEFBE000040FBECEF800010 +C286DD29B5802EF7BD80001E33DEF7A0000800EF7BDE000040F7FCFFC00010 +C286DD29B5804F7BDE80001E39EF7BC0000800F7BDEF0000407BFCFFC00010 +C286DD29B58067BDEF00001E3AF7BDE00008007BDEF7000040BDFCFFC00010 +C286DD29B5806BDEF780001E1B7BDEE0000800BDEF7B000040DEFCFFC00010 +C286DD29B5806DEF7B80001E2BBDEF60000800DEF7BD000040EF7CFFC00010 +C286DD29B5806EF7BD80001E33DEF7A0000800EF7BDE000040F7BCFFC00010 +C286DD29B5806F7BDE80001E39EF7BC0000800F7BDEF0000407BDCFFC00010 +C286DD29B5806FBDEF00001E3AF7BDE00008007BDEF7000040BDECFFC00010 +C286DD29B5806FDEF780001E1B7BDEE0000800BDEF7B000040DEF4FFC00010 +C286DD29B5806FEF7B80001E2BBDEF60000800DEF7BD000040EF78FFC00010 +C286DD29B5806FF7BD80001E33DEF7A0000800EF7BDE000040F7BC7FC00010 +C286DD29B5806FFBDE80001E39EF7BC0000800F7BDEF0000407BDCBFC00010 +C286DD29B5806FFDEF00001E3AF7BDE00008007BDEF7000040BDECDFC00010 +C286DD29B5806FFEF780001E1B7BDEE0000800BDEF7B000040DEF4EFC00010 +C286DD29B5806FFF7B80001E2BBDEF60000800DEF7BD000040EF78F7C00010 +C286DD29B5806FFFBD80001E33DEF7A0000800EF7BDE000040F7BC7BC00010 +C286DD29B5806FFFDE80001E39EF7BC0000800F7BDEF0000407BDCBDC00010 +C286DD29B5806FFFEF00001E3AF7BDE00008007BDEF7000040BDECDEC00010 +C286DD29B5806FFFF780001E1B7BDEE0000800BDEF7B000040DEF4EF400010 +C286DD29B5806FFFFB80001E2BBDEF60000800DEF7BD000040EF78F7800010
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_efr_sid_test.ok
Added
@@ -0,0 +1,175 @@ +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5802FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5804FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B58067FFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806BFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806DFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806EFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806F7FFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FBFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FDFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FEFFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FF7FF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFBFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFDFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFEFF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFF7F80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFBF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFDF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFEF80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFF780001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFB80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFD80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFE80001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF00001E3BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E1BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E2BFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E33FFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E39FFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3AFFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3B7FFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BBFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BDFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BEFFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BF7FFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFBFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFDFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFEFFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFF7FE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFBFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFDFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFEFE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFF7E0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFBE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFDE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFEE0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFF60000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFA0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFC0000800FFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE00008007FFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800BFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800DFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800EFFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800F7FFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FBFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FDFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FEFFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FF7FFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFBFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFDFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFEFFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFF7FF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFBFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFDFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFEFF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFF7F000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFBF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFDF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFEF000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFF7000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFB000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFD000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFE000040FFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF0000407FFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040BFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040DFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040EFFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040F7FCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FBFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FDFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FEFCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FF7CFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFBCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFDCFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFECFFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFF4FFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFF8FFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFC7FC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCBFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCDFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCEFC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCF7C00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFBC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFDC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFEC00010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFF400010 ==> 2 +C286DD29B5806FFFFF80001E3BFFFFE0000800FFFFFF000040FFFCFF800010 ==> 2 +C286DD29B5802FFFFF80001E3BFFFFE00008007FFFFF000040FFFCFFC00010 ==> 1 +C286DD29B5804FFFFF80001E3BFFFFE0000800BFFFFF000040FFFCFFC00010 ==> 1 +C286DD29B58067FFFF80001E3BFFFFE0000800DFFFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806BFFFF80001E3BFFFFE0000800EFFFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806DFFFF80001E3BFFFFE0000800F7FFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806EFFFF80001E3BFFFFE0000800FBFFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806F7FFF80001E3BFFFFE0000800FDFFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FBFFF80001E3BFFFFE0000800FEFFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FDFFF80001E3BFFFFE0000800FF7FFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FEFFF80001E3BFFFFE0000800FFBFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FF7FF80001E3BFFFFE0000800FFDFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFBFF80001E3BFFFFE0000800FFEFFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFDFF80001E3BFFFFE0000800FFF7FF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFEFF80001E3BFFFFE0000800FFFBFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFF7F80001E3BFFFFE0000800FFFDFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFBF80001E3BFFFFE0000800FFFEFF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFDF80001E3BFFFFE0000800FFFF7F000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFEF80001E3BFFFFE0000800FFFFBF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFF780001E3BFFFFE0000800FFFFDF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFFB80001E3BFFFFE0000800FFFFEF000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFFD80001E3BFFFFE0000800FFFFF7000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFFE80001E3BFFFFE0000800FFFFFB000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFFF00001E3BFFFFE0000800FFFFFD000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E1BFFFFE0000800FFFFFE000040FFFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E2BFFFFE0000800FFFFFF0000407FFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E33FFFFE0000800FFFFFF000040BFFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E39FFFFE0000800FFFFFF000040DFFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3AFFFFE0000800FFFFFF000040EFFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3B7FFFE0000800FFFFFF000040F7FCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BBFFFE0000800FFFFFF000040FBFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BDFFFE0000800FFFFFF000040FDFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BEFFFE0000800FFFFFF000040FEFCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BF7FFE0000800FFFFFF000040FF7CFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFBFFE0000800FFFFFF000040FFBCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFDFFE0000800FFFFFF000040FFDCFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFEFFE0000800FFFFFF000040FFECFFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFF7FE0000800FFFFFF000040FFF4FFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFBFE0000800FFFFFF000040FFF8FFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFDFE0000800FFFFFF000040FFFC7FC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFEFE0000800FFFFFF000040FFFCBFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFF7E0000800FFFFFF000040FFFCDFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFFBE0000800FFFFFF000040FFFCEFC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFFDE0000800FFFFFF000040FFFCF7C00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFFEE0000800FFFFFF000040FFFCFBC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFFF60000800FFFFFF000040FFFCFDC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFFFA0000800FFFFFF000040FFFCFEC00010 ==> 1 +C286DD29B5806FFFFF80001E3BFFFFC0000800FFFFFF000040FFFCFF400010 ==> 1 +C286DD29B5806FFFFF80001E3BFFFFE00008007FFFFF000040FFFCFF800010 ==> 1 +C286DD29B5802F7DF780001E2BDF7DE0000800BEFBEF000040BEF8FFC00010 ==> 1 +C286DD29B5804FBEFB80001E33EFBEE0000800DF7DF7000040DF7C7FC00010 ==> 1 +C286DD29B58067DF7D80001E39F7DF60000800EFBEFB000040EFBCBFC00010 ==> 1 +C286DD29B5806BEFBE80001E3AFBEFA0000800F7DF7D000040F7DCDFC00010 ==> 1 +C286DD29B5806DF7DF00001E3B7DF7C0000800FBEFBE000040FBECEFC00010 ==> 1 +C286DD29B5806EFBEF80001E1BBEFBE00008007DF7DF0000407DF4F7C00010 ==> 1 +C286DD29B5806F7DF780001E2BDF7DE0000800BEFBEF000040BEF8FBC00010 ==> 1 +C286DD29B5806FBEFB80001E33EFBEE0000800DF7DF7000040DF7C7DC00010 ==> 1 +C286DD29B5806FDF7D80001E39F7DF60000800EFBEFB000040EFBCBEC00010 ==> 1 +C286DD29B5806FEFBE80001E3AFBEFA0000800F7DF7D000040F7DCDF400010 ==> 1 +C286DD29B5806FF7DF00001E3B7DF7C0000800FBEFBE000040FBECEF800010 ==> 1 +C286DD29B5802EF7BD80001E33DEF7A0000800EF7BDE000040F7FCFFC00010 ==> 0 +C286DD29B5804F7BDE80001E39EF7BC0000800F7BDEF0000407BFCFFC00010 ==> 0 +C286DD29B58067BDEF00001E3AF7BDE00008007BDEF7000040BDFCFFC00010 ==> 0 +C286DD29B5806BDEF780001E1B7BDEE0000800BDEF7B000040DEFCFFC00010 ==> 0 +C286DD29B5806DEF7B80001E2BBDEF60000800DEF7BD000040EF7CFFC00010 ==> 0 +C286DD29B5806EF7BD80001E33DEF7A0000800EF7BDE000040F7BCFFC00010 ==> 0 +C286DD29B5806F7BDE80001E39EF7BC0000800F7BDEF0000407BDCFFC00010 ==> 0 +C286DD29B5806FBDEF00001E3AF7BDE00008007BDEF7000040BDECFFC00010 ==> 0 +C286DD29B5806FDEF780001E1B7BDEE0000800BDEF7B000040DEF4FFC00010 ==> 0 +C286DD29B5806FEF7B80001E2BBDEF60000800DEF7BD000040EF78FFC00010 ==> 0 +C286DD29B5806FF7BD80001E33DEF7A0000800EF7BDE000040F7BC7FC00010 ==> 0 +C286DD29B5806FFBDE80001E39EF7BC0000800F7BDEF0000407BDCBFC00010 ==> 0 +C286DD29B5806FFDEF00001E3AF7BDE00008007BDEF7000040BDECDFC00010 ==> 0 +C286DD29B5806FFEF780001E1B7BDEE0000800BDEF7B000040DEF4EFC00010 ==> 0 +C286DD29B5806FFF7B80001E2BBDEF60000800DEF7BD000040EF78F7C00010 ==> 0 +C286DD29B5806FFFBD80001E33DEF7A0000800EF7BDE000040F7BC7BC00010 ==> 0 +C286DD29B5806FFFDE80001E39EF7BC0000800F7BDEF0000407BDCBDC00010 ==> 0 +C286DD29B5806FFFEF00001E3AF7BDE00008007BDEF7000040BDECDEC00010 ==> 0 +C286DD29B5806FFFF780001E1B7BDEE0000800BDEF7B000040DEF4EF400010 ==> 0 +C286DD29B5806FFFFB80001E2BBDEF60000800DEF7BD000040EF78F7800010 ==> 0
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_fr_sid_test.c
Added
@@ -0,0 +1,97 @@ +/* + * This program is a test for osmo_fr_sid_classify(). It reads a set of + * FRv1 codec frames in hex format (TS 101 318 RTP format represented in hex, + * each frame as its own hex line) and feeds each test frame to + * osmo_fr_sid_classify(). It then prints the output next to each input. + * + * Author: Mychaela N. Falconia <falcon@freecalypso.org>, 2024 - however, + * Mother Mychaela's contributions are NOT subject to copyright. + * No rights reserved, all rights relinquished. + * + * 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 <ctype.h> +#include <stdio.h> +#include <stdint.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +#include <osmocom/core/utils.h> +#include <osmocom/codec/codec.h> + +static void process_record(const char *hex_str) +{ + uint8_t frame_bytesGSM_FR_BYTES; + enum osmo_gsm631_sid_class sidc; + + osmo_hexparse(hex_str, frame_bytes, GSM_FR_BYTES); + sidc = osmo_fr_sid_classify(frame_bytes); + printf("%s ==> %d\n", hex_str, (int) sidc); +} + +static void process_line(char *linebuf, const char *infname, int lineno) +{ + char *cp = linebuf, *hex_str; + int ndig; + + while (isspace(*cp)) + cp++; + if (*cp == '\0' || *cp == '#') + return; + /* expect string of 66 hex digits */ + hex_str = cp; + for (ndig = 0; ndig < GSM_FR_BYTES * 2; ndig++) { + if (!isxdigit(*cp)) + goto inv; + cp++; + } + if (*cp) { + if (!isspace(*cp)) + goto inv; + *cp++ = '\0'; + } + /* must be end of non-comment line */ + while (isspace(*cp)) + cp++; + if (*cp != '\0' && *cp != '#') + goto inv; + + process_record(hex_str); + return; + +inv: fprintf(stderr, "%s line %d: invalid syntax\n", infname, lineno); + exit(1); +} + +int main(int argc, char **argv) +{ + const char *infname; + FILE *inf; + char linebuf128; + int lineno; + + if (argc != 2) { + fprintf(stderr, "usage: %s input-file\n", argv0); + exit(1); + } + infname = argv1; + inf = fopen(infname, "r"); + if (!inf) { + perror(infname); + exit(1); + } + for (lineno = 1; fgets(linebuf, sizeof(linebuf), inf); lineno++) + process_line(linebuf, infname, lineno); + fclose(inf); + exit(0); +}
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_fr_sid_test.in
Added
@@ -0,0 +1,184 @@ +# This file is input for the FRv1 SID classifier test program. +# It has been generated here: +# +# https://www.freecalypso.org/hg/vband-misc/file/tip/fr-sid +# +# It is based on the same principle as the EFR version: +# +# https://www.freecalypso.org/hg/vband-misc/file/tip/efr-sid/Unit-test-desc + +DAE6DB659B00010000000000000100000000000001000000000000010000000000 +DAE6DB659B00014000000000000100000000000001000000000000010000000000 +DAE6DB659B00012000000000000100000000000001000000000000010000000000 +DAE6DB659B00010800000000000100000000000001000000000000010000000000 +DAE6DB659B00010400000000000100000000000001000000000000010000000000 +DAE6DB659B00010100000000000100000000000001000000000000010000000000 +DAE6DB659B00010080000000000100000000000001000000000000010000000000 +DAE6DB659B00010020000000000100000000000001000000000000010000000000 +DAE6DB659B00010010000000000100000000000001000000000000010000000000 +DAE6DB659B00010004000000000100000000000001000000000000010000000000 +DAE6DB659B00010002000000000100000000000001000000000000010000000000 +DAE6DB659B00010000800000000100000000000001000000000000010000000000 +DAE6DB659B00010000400000000100000000000001000000000000010000000000 +DAE6DB659B00010000100000000100000000000001000000000000010000000000 +DAE6DB659B00010000080000000100000000000001000000000000010000000000 +DAE6DB659B00010000020000000100000000000001000000000000010000000000 +DAE6DB659B00010000010000000100000000000001000000000000010000000000 +DAE6DB659B00010000004000000100000000000001000000000000010000000000 +DAE6DB659B00010000002000000100000000000001000000000000010000000000 +DAE6DB659B00010000000800000100000000000001000000000000010000000000 +DAE6DB659B00010000000400000100000000000001000000000000010000000000 +DAE6DB659B00010000000100000100000000000001000000000000010000000000 +DAE6DB659B00010000000080000100000000000001000000000000010000000000 +DAE6DB659B00010000000020000100000000000001000000000000010000000000 +DAE6DB659B00010000000010000100000000000001000000000000010000000000 +DAE6DB659B00010000000004000100000000000001000000000000010000000000 +DAE6DB659B00010000000002000100000000000001000000000000010000000000 +DAE6DB659B00010000000000000140000000000001000000000000010000000000 +DAE6DB659B00010000000000000120000000000001000000000000010000000000 +DAE6DB659B00010000000000000108000000000001000000000000010000000000 +DAE6DB659B00010000000000000104000000000001000000000000010000000000 +DAE6DB659B00010000000000000101000000000001000000000000010000000000 +DAE6DB659B00010000000000000100800000000001000000000000010000000000 +DAE6DB659B00010000000000000100200000000001000000000000010000000000 +DAE6DB659B00010000000000000100100000000001000000000000010000000000 +DAE6DB659B00010000000000000100040000000001000000000000010000000000 +DAE6DB659B00010000000000000100020000000001000000000000010000000000 +DAE6DB659B00010000000000000100008000000001000000000000010000000000 +DAE6DB659B00010000000000000100004000000001000000000000010000000000 +DAE6DB659B00010000000000000100001000000001000000000000010000000000 +DAE6DB659B00010000000000000100000800000001000000000000010000000000 +DAE6DB659B00010000000000000100000200000001000000000000010000000000 +DAE6DB659B00010000000000000100000100000001000000000000010000000000 +DAE6DB659B00010000000000000100000040000001000000000000010000000000 +DAE6DB659B00010000000000000100000020000001000000000000010000000000 +DAE6DB659B00010000000000000100000008000001000000000000010000000000 +DAE6DB659B00010000000000000100000004000001000000000000010000000000 +DAE6DB659B00010000000000000100000001000001000000000000010000000000 +DAE6DB659B00010000000000000100000000800001000000000000010000000000 +DAE6DB659B00010000000000000100000000200001000000000000010000000000 +DAE6DB659B00010000000000000100000000100001000000000000010000000000 +DAE6DB659B00010000000000000100000000040001000000000000010000000000 +DAE6DB659B00010000000000000100000000020001000000000000010000000000 +DAE6DB659B00010000000000000100000000000001400000000000010000000000 +DAE6DB659B00010000000000000100000000000001200000000000010000000000 +DAE6DB659B00010000000000000100000000000001080000000000010000000000 +DAE6DB659B00010000000000000100000000000001040000000000010000000000 +DAE6DB659B00010000000000000100000000000001010000000000010000000000 +DAE6DB659B00010000000000000100000000000001008000000000010000000000 +DAE6DB659B00010000000000000100000000000001002000000000010000000000 +DAE6DB659B00010000000000000100000000000001001000000000010000000000 +DAE6DB659B00010000000000000100000000000001000400000000010000000000 +DAE6DB659B00010000000000000100000000000001000200000000010000000000 +DAE6DB659B00010000000000000100000000000001000080000000010000000000 +DAE6DB659B00010000000000000100000000000001000040000000010000000000 +DAE6DB659B00010000000000000100000000000001000010000000010000000000 +DAE6DB659B00010000000000000100000000000001000008000000010000000000 +DAE6DB659B00010000000000000100000000000001000002000000010000000000 +DAE6DB659B00010000000000000100000000000001000001000000010000000000 +DAE6DB659B00010000000000000100000000000001000000400000010000000000 +DAE6DB659B00010000000000000100000000000001000000200000010000000000 +DAE6DB659B00010000000000000100000000000001000000080000010000000000 +DAE6DB659B00010000000000000100000000000001000000040000010000000000 +DAE6DB659B00010000000000000100000000000001000000010000010000000000 +DAE6DB659B00010000000000000100000000000001000000008000010000000000 +DAE6DB659B00010000000000000100000000000001000000002000010000000000 +DAE6DB659B00010000000000000100000000000001000000001000010000000000 +DAE6DB659B00010000000000000100000000000001000000000400010000000000 +DAE6DB659B00010000000000000100000000000001000000000200010000000000 +DAE6DB659B00010000000000000100000000000001000000000000014000000000 +DAE6DB659B00010000000000000100000000000001000000000000012000000000 +DAE6DB659B00010000000000000100000000000001000000000000010800000000 +DAE6DB659B00010000000000000100000000000001000000000000010400000000 +DAE6DB659B00010000000000000100000000000001000000000000010100000000 +DAE6DB659B00010000000000000100000000000001000000000000010080000000 +DAE6DB659B00010000000000000100000000000001000000000000010020000000 +DAE6DB659B00010000000000000100000000000001000000000000010010000000 +DAE6DB659B00010000000000000100000000000001000000000000010004000000 +DAE6DB659B00010000000000000100000000000001000000000000010000800000 +DAE6DB659B00010000000000000100000000000001000000000000010000100000 +DAE6DB659B00010000000000000100000000000001000000000000010000020000 +DAE6DB659B00010000000000000100000000000001000000000000010000004000 +DAE6DB659B00010000000000000100000000000001000000000000010000000800 +DAE6DB659B00010000000000000100000000000001000000000000010000000100 +DAE6DB659B00010000000000000100000000000001000000000000010000000020 +DAE6DB659B00010000000000000100000000000001000000000000010000000004 +DAE6DB659B00014000000000000100000000800001000000000000010000000000 +DAE6DB659B00012000000000000100000000200001000000000000010000000000 +DAE6DB659B00010800000000000100000000100001000000000000010000000000 +DAE6DB659B00010400000000000100000000040001000000000000010000000000 +DAE6DB659B00010100000000000100000000020001000000000000010000000000 +DAE6DB659B00010080000000000100000000000001400000000000010000000000 +DAE6DB659B00010020000000000100000000000001200000000000010000000000 +DAE6DB659B00010010000000000100000000000001080000000000010000000000 +DAE6DB659B00010004000000000100000000000001040000000000010000000000 +DAE6DB659B00010002000000000100000000000001010000000000010000000000 +DAE6DB659B00010000800000000100000000000001008000000000010000000000 +DAE6DB659B00010000400000000100000000000001002000000000010000000000 +DAE6DB659B00010000100000000100000000000001001000000000010000000000 +DAE6DB659B00010000080000000100000000000001000400000000010000000000 +DAE6DB659B00010000020000000100000000000001000200000000010000000000 +DAE6DB659B00010000010000000100000000000001000080000000010000000000 +DAE6DB659B00010000004000000100000000000001000040000000010000000000 +DAE6DB659B00010000002000000100000000000001000010000000010000000000 +DAE6DB659B00010000000800000100000000000001000008000000010000000000 +DAE6DB659B00010000000400000100000000000001000002000000010000000000 +DAE6DB659B00010000000100000100000000000001000001000000010000000000 +DAE6DB659B00010000000080000100000000000001000000400000010000000000 +DAE6DB659B00010000000020000100000000000001000000200000010000000000 +DAE6DB659B00010000000010000100000000000001000000080000010000000000 +DAE6DB659B00010000000004000100000000000001000000040000010000000000 +DAE6DB659B00010000000002000100000000000001000000010000010000000000 +DAE6DB659B00010000000000000140000000000001000000008000010000000000 +DAE6DB659B00010000000000000120000000000001000000002000010000000000 +DAE6DB659B00010000000000000108000000000001000000001000010000000000 +DAE6DB659B00010000000000000104000000000001000000000400010000000000 +DAE6DB659B00010000000000000101000000000001000000000200010000000000 +DAE6DB659B00010000000000000100800000000001000000000000014000000000 +DAE6DB659B00010000000000000100200000000001000000000000012000000000 +DAE6DB659B00010000000000000100100000000001000000000000010800000000 +DAE6DB659B00010000000000000100040000000001000000000000010400000000 +DAE6DB659B00010000000000000100020000000001000000000000010100000000 +DAE6DB659B00010000000000000100008000000001000000000000010080000000 +DAE6DB659B00010000000000000100004000000001000000000000010020000000 +DAE6DB659B00010000000000000100001000000001000000000000010010000000 +DAE6DB659B00010000000000000100000800000001000000000000010004000000 +DAE6DB659B00010000000000000100000200000001000000000000010000800000 +DAE6DB659B00010000000000000100000100000001000000000000010000100000 +DAE6DB659B00010000000000000100000040000001000000000000010000020000 +DAE6DB659B00010000000000000100000020000001000000000000010000004000 +DAE6DB659B00010000000000000100000008000001000000000000010000000800 +DAE6DB659B00010000000000000100000004000001000000000000010000000100 +DAE6DB659B00010000000000000100000001000001000000000000010000000020 +DAE6DB659B00010000000000000100000000800001000000000000010000000004 +DAE6DB659B00014020100804000101008040200001080402010000014020000000 +DAE6DB659B00012010080402000100804020100001040201008000012010000000 +DAE6DB659B00010804020100000140201008040001010080402000010804000000 +DAE6DB659B00010402010080000120100804020001008040201000010400800000 +DAE6DB659B00010100804020000108040201000001402010080400010100100000 +DAE6DB659B00010080402010000104020100800001201008040200010080020000 +DAE6DB659B00010020100804000101008040200001080402010000014020004000 +DAE6DB659B00010010080402000100804020100001040201008000012010000800 +DAE6DB659B00010004020100000140201008040001010080402000010804000100 +DAE6DB659B00010002010080000120100804020001008040201000010400800020 +DAE6DB659B00010000804020000108040201000001402010080400010100100004 +DAE6DB659B00014080810102000101020204040001040408081000010000000000 +DAE6DB659B00012020404080000140808101020001010202040400010000000000 +DAE6DB659B00010810102020000120204040800001408081010200010000000000 +DAE6DB659B00010404080810000108101020200001202040408000014000000000 +DAE6DB659B00010102020404000104040808100001081010202000012000000000 +DAE6DB659B00010080810102000101020204040001040408081000010800000000 +DAE6DB659B00010020404080000140808101020001010202040400010400000000 +DAE6DB659B00010010102020000120204040800001408081010200010100000000 +DAE6DB659B00010004080810000108101020200001202040408000014080000000 +DAE6DB659B00010002020404000104040808100001081010202000012020000000 +DAE6DB659B00010000810102000101020204040001040408081000010810000000 +DAE6DB659B00010000404080000140808101020001010202040400010404000000 +DAE6DB659B00010000102020000120204040800001408081010200010100800000 +DAE6DB659B00010000080810000108101020200001202040408000014080100000 +DAE6DB659B00010000020404000104040808100001081010202000012020020000 +DAE6DB659B00010000010102000101020204040001040408081000010810004000 +DAE6DB659B00010000004080000140808101020001010202040400010404000800 +DAE6DB659B00010000002020000120204040800001408081010200010100800100 +DAE6DB659B00010000000810000108101020200001202040408000014080100020 +DAE6DB659B00010000000404000104040808100001081010202000012020020004
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_fr_sid_test.ok
Added
@@ -0,0 +1,175 @@ +DAE6DB659B00010000000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00014000000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00012000000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010800000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010400000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010100000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010080000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010020000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010010000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010004000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010002000000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000800000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000400000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000100000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000080000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000020000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000010000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000004000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000002000000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000800000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000400000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000100000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000080000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000020000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000010000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000004000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000002000100000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000140000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000120000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000108000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000104000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000101000000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100800000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100200000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100100000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100040000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100020000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100008000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100004000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100001000000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000800000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000200000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000100000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000040000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000020000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000008000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000004000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000001000001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000800001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000200001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000100001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000040001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000020001000000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001400000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001200000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001080000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001040000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001010000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001008000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001002000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001001000000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000400000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000200000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000080000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000040000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000010000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000008000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000002000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000001000000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000400000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000200000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000080000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000040000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000010000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000008000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000002000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000001000010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000400010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000200010000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000014000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000012000000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010800000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010400000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010100000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010080000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010020000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010010000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010004000000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000800000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000100000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000020000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000004000 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000000800 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000000100 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000000020 ==> 2 +DAE6DB659B00010000000000000100000000000001000000000000010000000004 ==> 2 +DAE6DB659B00014000000000000100000000800001000000000000010000000000 ==> 1 +DAE6DB659B00012000000000000100000000200001000000000000010000000000 ==> 1 +DAE6DB659B00010800000000000100000000100001000000000000010000000000 ==> 1 +DAE6DB659B00010400000000000100000000040001000000000000010000000000 ==> 1 +DAE6DB659B00010100000000000100000000020001000000000000010000000000 ==> 1 +DAE6DB659B00010080000000000100000000000001400000000000010000000000 ==> 1 +DAE6DB659B00010020000000000100000000000001200000000000010000000000 ==> 1 +DAE6DB659B00010010000000000100000000000001080000000000010000000000 ==> 1 +DAE6DB659B00010004000000000100000000000001040000000000010000000000 ==> 1 +DAE6DB659B00010002000000000100000000000001010000000000010000000000 ==> 1 +DAE6DB659B00010000800000000100000000000001008000000000010000000000 ==> 1 +DAE6DB659B00010000400000000100000000000001002000000000010000000000 ==> 1 +DAE6DB659B00010000100000000100000000000001001000000000010000000000 ==> 1 +DAE6DB659B00010000080000000100000000000001000400000000010000000000 ==> 1 +DAE6DB659B00010000020000000100000000000001000200000000010000000000 ==> 1 +DAE6DB659B00010000010000000100000000000001000080000000010000000000 ==> 1 +DAE6DB659B00010000004000000100000000000001000040000000010000000000 ==> 1 +DAE6DB659B00010000002000000100000000000001000010000000010000000000 ==> 1 +DAE6DB659B00010000000800000100000000000001000008000000010000000000 ==> 1 +DAE6DB659B00010000000400000100000000000001000002000000010000000000 ==> 1 +DAE6DB659B00010000000100000100000000000001000001000000010000000000 ==> 1 +DAE6DB659B00010000000080000100000000000001000000400000010000000000 ==> 1 +DAE6DB659B00010000000020000100000000000001000000200000010000000000 ==> 1 +DAE6DB659B00010000000010000100000000000001000000080000010000000000 ==> 1 +DAE6DB659B00010000000004000100000000000001000000040000010000000000 ==> 1 +DAE6DB659B00010000000002000100000000000001000000010000010000000000 ==> 1 +DAE6DB659B00010000000000000140000000000001000000008000010000000000 ==> 1 +DAE6DB659B00010000000000000120000000000001000000002000010000000000 ==> 1 +DAE6DB659B00010000000000000108000000000001000000001000010000000000 ==> 1 +DAE6DB659B00010000000000000104000000000001000000000400010000000000 ==> 1 +DAE6DB659B00010000000000000101000000000001000000000200010000000000 ==> 1 +DAE6DB659B00010000000000000100800000000001000000000000014000000000 ==> 1 +DAE6DB659B00010000000000000100200000000001000000000000012000000000 ==> 1 +DAE6DB659B00010000000000000100100000000001000000000000010800000000 ==> 1 +DAE6DB659B00010000000000000100040000000001000000000000010400000000 ==> 1 +DAE6DB659B00010000000000000100020000000001000000000000010100000000 ==> 1 +DAE6DB659B00010000000000000100008000000001000000000000010080000000 ==> 1 +DAE6DB659B00010000000000000100004000000001000000000000010020000000 ==> 1 +DAE6DB659B00010000000000000100001000000001000000000000010010000000 ==> 1 +DAE6DB659B00010000000000000100000800000001000000000000010004000000 ==> 1 +DAE6DB659B00010000000000000100000200000001000000000000010000800000 ==> 1 +DAE6DB659B00010000000000000100000100000001000000000000010000100000 ==> 1 +DAE6DB659B00010000000000000100000040000001000000000000010000020000 ==> 1 +DAE6DB659B00010000000000000100000020000001000000000000010000004000 ==> 1 +DAE6DB659B00010000000000000100000008000001000000000000010000000800 ==> 1 +DAE6DB659B00010000000000000100000004000001000000000000010000000100 ==> 1 +DAE6DB659B00010000000000000100000001000001000000000000010000000020 ==> 1 +DAE6DB659B00010000000000000100000000800001000000000000010000000004 ==> 1 +DAE6DB659B00014020100804000101008040200001080402010000014020000000 ==> 1 +DAE6DB659B00012010080402000100804020100001040201008000012010000000 ==> 1 +DAE6DB659B00010804020100000140201008040001010080402000010804000000 ==> 1 +DAE6DB659B00010402010080000120100804020001008040201000010400800000 ==> 1 +DAE6DB659B00010100804020000108040201000001402010080400010100100000 ==> 1 +DAE6DB659B00010080402010000104020100800001201008040200010080020000 ==> 1 +DAE6DB659B00010020100804000101008040200001080402010000014020004000 ==> 1 +DAE6DB659B00010010080402000100804020100001040201008000012010000800 ==> 1 +DAE6DB659B00010004020100000140201008040001010080402000010804000100 ==> 1 +DAE6DB659B00010002010080000120100804020001008040201000010400800020 ==> 1 +DAE6DB659B00010000804020000108040201000001402010080400010100100004 ==> 1 +DAE6DB659B00014080810102000101020204040001040408081000010000000000 ==> 0 +DAE6DB659B00012020404080000140808101020001010202040400010000000000 ==> 0 +DAE6DB659B00010810102020000120204040800001408081010200010000000000 ==> 0 +DAE6DB659B00010404080810000108101020200001202040408000014000000000 ==> 0 +DAE6DB659B00010102020404000104040808100001081010202000012000000000 ==> 0 +DAE6DB659B00010080810102000101020204040001040408081000010800000000 ==> 0 +DAE6DB659B00010020404080000140808101020001010202040400010400000000 ==> 0 +DAE6DB659B00010010102020000120204040800001408081010200010100000000 ==> 0 +DAE6DB659B00010004080810000108101020200001202040408000014080000000 ==> 0 +DAE6DB659B00010002020404000104040808100001081010202000012020000000 ==> 0 +DAE6DB659B00010000810102000101020204040001040408081000010810000000 ==> 0 +DAE6DB659B00010000404080000140808101020001010202040400010404000000 ==> 0 +DAE6DB659B00010000102020000120204040800001408081010200010100800000 ==> 0 +DAE6DB659B00010000080810000108101020200001202040408000014080100000 ==> 0 +DAE6DB659B00010000020404000104040808100001081010202000012020020000 ==> 0 +DAE6DB659B00010000010102000101020204040001040408081000010810004000 ==> 0 +DAE6DB659B00010000004080000140808101020001010202040400010404000800 ==> 0 +DAE6DB659B00010000002020000120204040800001408081010200010100800100 ==> 0 +DAE6DB659B00010000000810000108101020200001202040408000014080100020 ==> 0 +DAE6DB659B00010000000404000104040808100001081010202000012020020004 ==> 0
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_hr_sid_test.c
Added
@@ -0,0 +1,144 @@ +/* + * This program is a test for osmo_hr_sid_classify(). It reads a set of + * TCH/HS Rx bit patterns in TI DSP format (originally captured from a + * Calypso MS under conditions of induced radio errors), converts each + * bit pattern to TS 101 318 format (using same bit reordering function + * as libosmocoding gsm0503 implementation), and feeds each test line + * to osmo_hr_sid_classify(). It then prints the output next to each input. + * + * Author: Mychaela N. Falconia <falcon@freecalypso.org>, 2024 - however, + * Mother Mychaela's contributions are NOT subject to copyright. + * No rights reserved, all rights relinquished. + * + * 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 <ctype.h> +#include <stdio.h> +#include <stdint.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +#include <osmocom/core/bits.h> +#include <osmocom/core/utils.h> +#include <osmocom/codec/codec.h> + +#define HR_CODEC_BITS (GSM_HR_BYTES * 8) +#define HR_BYTES_TIDSP (GSM_HR_BYTES + 1) + +/* re-arrange according to TS 05.03 Table 3a (receiver) */ +/* function copied from src/coding/gsm0503_coding.c */ +static void tch_hr_d_to_b(ubit_t *b_bits, const ubit_t *d_bits) +{ + int i; + + const uint16_t *map; + + if (!d_bits93 && !d_bits94) + map = gsm620_unvoiced_bitorder; + else + map = gsm620_voiced_bitorder; + + for (i = 0; i < 112; i++) + b_bitsmapi = d_bitsi; +} + +static void process_record(const char *hex_str, bool bci_flag) +{ + uint8_t dsp_rx_bytesHR_BYTES_TIDSP; + ubit_t bits_transmission_orderHR_BYTES_TIDSP * 8; + ubit_t bits_codec_orderHR_CODEC_BITS; + uint8_t hr_bytes_ts101318GSM_HR_BYTES; + bool bfi_flag = false; + enum osmo_gsm631_sid_class sidc; + + osmo_hexparse(hex_str, dsp_rx_bytes, HR_BYTES_TIDSP); + osmo_pbit2ubit(bits_transmission_order, dsp_rx_bytes, + HR_BYTES_TIDSP * 8); + /* TI DSP format has a gap of 4 bits between class 1 and class 2 + * portions - get rid of it. 95 is the number of class 1 bits, + * 17 is the number of class 2 bits. */ + memmove(bits_transmission_order + 95, + bits_transmission_order + 95 + 4, 17); + tch_hr_d_to_b(bits_codec_order, bits_transmission_order); + osmo_ubit2pbit(hr_bytes_ts101318, bits_codec_order, HR_CODEC_BITS); + + sidc = osmo_hr_sid_classify(hr_bytes_ts101318, bci_flag, &bfi_flag); + printf("%s %d ==> %d %d\n", hex_str, (int) bci_flag, + (int) sidc, (int) bfi_flag); +} + +static void process_line(char *linebuf, const char *infname, int lineno) +{ + char *cp = linebuf, *hex_str; + int ndig; + bool bci_flag; + + while (isspace(*cp)) + cp++; + if (*cp == '\0' || *cp == '#') + return; + /* expect string of 30 hex digits */ + hex_str = cp; + for (ndig = 0; ndig < HR_BYTES_TIDSP * 2; ndig++) { + if (!isxdigit(*cp)) + goto inv; + cp++; + } + if (!isspace(*cp)) + goto inv; + *cp++ = '\0'; + while (isspace(*cp)) + cp++; + /* 0 or 1 must follow, giving BCI flag */ + if (*cp == '0') + bci_flag = false; + else if (*cp == '1') + bci_flag = true; + else + goto inv; + cp++; + /* must be end of non-comment line */ + while (isspace(*cp)) + cp++; + if (*cp != '\0' && *cp != '#') + goto inv; + + process_record(hex_str, bci_flag); + return; + +inv: fprintf(stderr, "%s line %d: invalid syntax\n", infname, lineno); + exit(1); +} + +int main(int argc, char **argv) +{ + const char *infname; + FILE *inf; + char linebuf128; + int lineno; + + if (argc != 2) { + fprintf(stderr, "usage: %s input-file\n", argv0); + exit(1); + } + infname = argv1; + inf = fopen(infname, "r"); + if (!inf) { + perror(infname); + exit(1); + } + for (lineno = 1; fgets(linebuf, sizeof(linebuf), inf); lineno++) + process_line(linebuf, infname, lineno); + fclose(inf); + exit(0); +}
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_hr_sid_test.in
Added
@@ -0,0 +1,61 @@ +# This file is input for the HR SID classifier test program. All TCH/HS +# Rx bit strings contained in this file have been taken from hr-test1.dl +# or hr-test2.dl, attached to this wiki page: +# +# https://osmocom.org/projects/retro-gsm/wiki/HRv1_error_flags +# +# Each Rx bit string (15 hex bytes) is from TI DSP; the 0 or 1 that follows +# is the BCI flag to be fed to the SID classifier. The original DSP status +# word is noted in the comments; running the unit test program will show +# whether or not our SID classification agrees with that produced by +# TI Calypso DSP. + +# perfect, error-free SID: hr-test2.dl line 171, C010 +FFFFFFFFFFFFFFFFFFFFFFFE1FFFF0 0 + +# mode bits cleared to 0, all other bits still 1s +FFFFFFFFFFFFFFFFFFFFFFF81FFFF0 0 + +# selected error lines +FFFFFFFFFFFFFFFFFFFFFFFE0FFF70 0 # hr-test2.dl line 4226, C010 +FFFFFFFFFFFFFFFFFFFFFFFE13FFF0 1 # hr-test2.dl line 4256, C012 +FFFFFFFFFFFFFFFFFFFFFFFE17FFF0 1 # hr-test2.dl line 4258, C012 +FFFD01FFFFFFFFFFFFFFFFFE0FFFF0 1 # hr-test2.dl line 4598, C00A +FFFFFFFFFFFCC296452940FE1FFEF0 1 # hr-test2.dl line 5141, C00F +FFFFFFFFFFFCC296452940FE1FFEF0 0 # same bits without BCI +FF6E76F40C276FFFFFFFFFFE0FFFF0 1 # hr-test2.dl line 5173, C003 +FF6E76F40C276FFFFFFFFFFE0FFFF0 0 # same bits without BCI +FFFFFFFFFDFFFFFFFFFFFFFE0FFFF0 1 # hr-test2.dl line 5206, C012 +FFFFFFFFFDFFFFFFFFFFFFFE0FFFF0 0 # same bits without BCI +FFFFFFFFFFD0DFFFFFFFFFFE07FEF0 1 # hr-test2.dl line 5261, C00A +FFFFFFFFFFD0DFFFFFFFFFFE07FEF0 0 # same bits without BCI +FFFFFFFFFFFF41EAC9676FFE1F7DF0 1 # hr-test2.dl line 5738, C00F +FFFFFFFFFFFF41EAC9676FFE1F7DF0 0 # same bits without BCI + +FFFFFFFFFFFF847D5B9DBFFE1937B0 1 # hr-test2.dl line 6175, C00F +FFFFFFFFFFFF847D5B9DBFFE1937B0 0 # same bits without BCI +FFFFFFFFFFFFFFFFFFFFFFD01FFEB0 1 # hr-test2.dl line 6188, C017 +FFFFFFFFFFFFFFFFFFFFFFD01FFEB0 0 # same bits without BCI +FDBD7D552CB25FFFFFFFFFFE1DFBB0 1 # hr-test2.dl line 6191, C002 +FDBD7D552CB25FFFFFFFFFFE1DFBB0 0 # same bits without BCI +FFD2F0A52B8FFFFFFFFEDE600FFDF0 1 # hr-test2.dl line 6195, C007 +FFD2F0A52B8FFFFFFFFEDE600FFDF0 0 # same bits without BCI +FFFFFFFFCC7FFFFFFFF4EE601C31D0 1 # hr-test2.dl line 6318, C007 +FFFFFFFFCC7FFFFFFFF4EE601C31D0 0 # same bits without BCI +FFFFFFFFFFFFFFFFFFFFA5901BEFD0 1 # hr-test2.dl line 6545, C00F +FFFFFFFFFFFFFFFFFFFFA5901BEFD0 0 # same bits without BCI +FFFFFFFFEA97FFFFFFE765901FFFB0 1 # hr-test2.dl line 6973, C00F +FFFFFFFFEA97FFFFFFE765901FFFB0 0 # same bits without BCI + +FFFFFFFFF8C8A5E29DA0DFFE07FFF0 1 # hr-test2.dl line 7158, C00F +FFFFFFFFF8C8A5E29DA0DFFE07FFF0 0 # same bits without BCI +FFFD01853B7206E63FFFFFFE1FBFD0 1 # hr-test2.dl line 7175, C003 +FFFD01853B7206E63FFFFFFE1FBFD0 0 # same bits without BCI +E6ACC7FFFF40FFFFFFFFFFFE1FF770 1 # hr-test2.dl line 7195, C00B +E6ACC7FFFF40FFFFFFFFFFFE1FF770 0 # same bits without BCI + +# hr-test1.dl, PRBS without major errors +55A5404BFAED58A3BE33A978092A40 0 # hr-test1.dl line 1051, C000 +CFE44B516ED5D1F54E4615AA101260 0 # hr-test1.dl line 2710, C000 +D7881D40AA0F68106195DCD41568C0 0 # hr-test1.dl line 4306, C000 +D4CFB4961F8F9F11313454560690E0 1 # hr-test1.dl line 4631, C002
View file
libosmocore_1.11.0.tar.xz/tests/codec/codec_hr_sid_test.ok
Added
@@ -0,0 +1,40 @@ +FFFFFFFFFFFFFFFFFFFFFFFE1FFFF0 0 ==> 2 0 +FFFFFFFFFFFFFFFFFFFFFFF81FFFF0 0 ==> 1 0 +FFFFFFFFFFFFFFFFFFFFFFFE0FFF70 0 ==> 2 0 +FFFFFFFFFFFFFFFFFFFFFFFE13FFF0 1 ==> 2 0 +FFFFFFFFFFFFFFFFFFFFFFFE17FFF0 1 ==> 2 0 +FFFD01FFFFFFFFFFFFFFFFFE0FFFF0 1 ==> 1 0 +FFFFFFFFFFFCC296452940FE1FFEF0 1 ==> 1 0 +FFFFFFFFFFFCC296452940FE1FFEF0 0 ==> 0 0 +FF6E76F40C276FFFFFFFFFFE0FFFF0 1 ==> 0 1 +FF6E76F40C276FFFFFFFFFFE0FFFF0 0 ==> 0 0 +FFFFFFFFFDFFFFFFFFFFFFFE0FFFF0 1 ==> 2 0 +FFFFFFFFFDFFFFFFFFFFFFFE0FFFF0 0 ==> 2 0 +FFFFFFFFFFD0DFFFFFFFFFFE07FEF0 1 ==> 1 0 +FFFFFFFFFFD0DFFFFFFFFFFE07FEF0 0 ==> 1 0 +FFFFFFFFFFFF41EAC9676FFE1F7DF0 1 ==> 1 0 +FFFFFFFFFFFF41EAC9676FFE1F7DF0 0 ==> 0 0 +FFFFFFFFFFFF847D5B9DBFFE1937B0 1 ==> 1 0 +FFFFFFFFFFFF847D5B9DBFFE1937B0 0 ==> 0 0 +FFFFFFFFFFFFFFFFFFFFFFD01FFEB0 1 ==> 1 0 +FFFFFFFFFFFFFFFFFFFFFFD01FFEB0 0 ==> 1 0 +FDBD7D552CB25FFFFFFFFFFE1DFBB0 1 ==> 0 1 +FDBD7D552CB25FFFFFFFFFFE1DFBB0 0 ==> 0 0 +FFD2F0A52B8FFFFFFFFEDE600FFDF0 1 ==> 0 1 +FFD2F0A52B8FFFFFFFFEDE600FFDF0 0 ==> 0 0 +FFFFFFFFCC7FFFFFFFF4EE601C31D0 1 ==> 0 1 +FFFFFFFFCC7FFFFFFFF4EE601C31D0 0 ==> 0 0 +FFFFFFFFFFFFFFFFFFFFA5901BEFD0 1 ==> 1 0 +FFFFFFFFFFFFFFFFFFFFA5901BEFD0 0 ==> 1 0 +FFFFFFFFEA97FFFFFFE765901FFFB0 1 ==> 1 0 +FFFFFFFFEA97FFFFFFE765901FFFB0 0 ==> 0 0 +FFFFFFFFF8C8A5E29DA0DFFE07FFF0 1 ==> 1 0 +FFFFFFFFF8C8A5E29DA0DFFE07FFF0 0 ==> 0 0 +FFFD01853B7206E63FFFFFFE1FBFD0 1 ==> 0 1 +FFFD01853B7206E63FFFFFFE1FBFD0 0 ==> 0 0 +E6ACC7FFFF40FFFFFFFFFFFE1FF770 1 ==> 1 0 +E6ACC7FFFF40FFFFFFFFFFFE1FF770 0 ==> 0 0 +55A5404BFAED58A3BE33A978092A40 0 ==> 0 0 +CFE44B516ED5D1F54E4615AA101260 0 ==> 0 0 +D7881D40AA0F68106195DCD41568C0 0 ==> 0 0 +D4CFB4961F8F9F11313454560690E0 1 ==> 0 0
View file
libosmocore_1.10.1.tar.xz/tests/fr/fr_test.c -> libosmocore_1.11.0.tar.xz/tests/fr/fr_test.c
Changed
@@ -14,7 +14,9 @@ * */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <osmocom/core/application.h> #include <osmocom/gprs/gprs_ns.h>
View file
libosmocore_1.10.1.tar.xz/tests/gprs/gprs_test.c -> libosmocore_1.11.0.tar.xz/tests/gprs/gprs_test.c
Changed
@@ -7,6 +7,7 @@ #include <osmocom/core/utils.h> #include <osmocom/core/logging.h> #include <osmocom/gsm/apn.h> +#include <osmocom/gsm/gsm_utils.h> static void apn_round_trip(const uint8_t *input, size_t len, const char *wanted_output) { @@ -110,6 +111,16 @@ } } +static void test_ptmsi_tlli(void) +{ + OSMO_ASSERT(gprs_tlli2tmsi(0xc0010203) == 0xc0010203); + OSMO_ASSERT(gprs_tlli2tmsi(0x80010203) == 0xc0010203); + OSMO_ASSERT(gprs_tlli2tmsi(0x00010203) == 0xffffffff); + + OSMO_ASSERT(gprs_tmsi2tlli(0xc0010203, TLLI_LOCAL) == 0xc0010203); + OSMO_ASSERT(gprs_tmsi2tlli(0xc0010203, TLLI_FOREIGN) == 0x80010203); +} + const struct log_info_cat default_categories = { }; @@ -124,6 +135,7 @@ osmo_init_logging2(ctx, &info); test_gsm_03_03_apn(); + test_ptmsi_tlli(); printf("Done.\n"); return EXIT_SUCCESS;
View file
libosmocore_1.10.1.tar.xz/tests/gsm0408/gsm0408_test.c -> libosmocore_1.11.0.tar.xz/tests/gsm0408/gsm0408_test.c
Changed
@@ -131,9 +131,7 @@ static const struct bcap_test bcap_tests = { { csd_9600_v110_lv, &bcap_csd_9600_v110, "CSD 9600/V.110/transparent" }, { csd_4800_rlp_lv, &bcap_csd_4800_rlp, "CSD 4800/RLP/non-transparent" }, - { /* XXX: this testcase is expected to fail because octet 4 is not represented in - * 'struct gsm_mncc_bearer_cap' and the encoder unconditionally hard-codes it to 0x88. */ - csd_2400_v22bis_lv, &bcap_csd_2400_v22bis, "CSD 2400/V.22bis/transparent" }, + { csd_2400_v22bis_lv, &bcap_csd_2400_v22bis, "CSD 2400/V.22bis/transparent" }, { speech_all_lv, &bcap_speech_all, "Speech, all codecs" }, { speech_no3a_lv, &bcap_speech_no3a, "Speech, without octet 3a" }, };
View file
libosmocore_1.10.1.tar.xz/tests/logging/logging_vty_test.c -> libosmocore_1.11.0.tar.xz/tests/logging/logging_vty_test.c
Changed
@@ -17,7 +17,9 @@ * */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <getopt.h> #include <signal.h>
View file
libosmocore_1.10.1.tar.xz/tests/osmo_io/osmo_io_test.c -> libosmocore_1.11.0.tar.xz/tests/osmo_io/osmo_io_test.c
Changed
@@ -20,6 +20,7 @@ #include <stdio.h> #include <stdint.h> +#include <stdbool.h> #include <stdlib.h> #include <unistd.h> #include <string.h> @@ -45,6 +46,98 @@ static void *ctx = NULL; +static unsigned file_bytes_read = 0; +static unsigned file_bytes_write_compl = 0; +static bool file_eof_read = false; +static void file_read_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) +{ + 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)); + if (msg) { + printf("%s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg))); + file_bytes_read += msgb_length(msg); + talloc_free(msg); + } + if (rc == 0) { + file_eof_read = true; + osmo_iofd_close(iofd); + } +} + +static void file_write_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) +{ + printf("%s: write() returned rc=%d\n", osmo_iofd_get_name(iofd), rc); + if (rc < 0) + printf("%s: error: %s\n", osmo_iofd_get_name(iofd), strerror(-rc)); + if (msg) { + printf("%s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg))); + file_bytes_write_compl += msgb_length(msg); + } +} + +static void test_file(void) +{ + struct osmo_io_fd *iofd; + struct msgb *msg; + uint8_t *buf; + int fd; + int rc; + struct osmo_io_ops ioops; + + TEST_START(); + + /* Create temporary file and pass fd to iofd: */ + FILE *fp = tmpfile(); + OSMO_ASSERT(fp); + fd = fileno(fp); + + /* First test writing to the file: */ + printf("Enable write\n"); + ioops = (struct osmo_io_ops){ .write_cb = file_write_cb }; + iofd = osmo_iofd_setup(ctx, fd, "file-iofd", OSMO_IO_FD_MODE_READ_WRITE, &ioops, NULL); + osmo_iofd_register(iofd, fd); + + msg = msgb_alloc(1024, "Test data"); + buf = msgb_put(msg, sizeof(TESTDATA)); + memcpy(buf, TESTDATA, sizeof(TESTDATA)); + osmo_iofd_write_msgb(iofd, msg); + /* Allow enough cycles to handle the messages */ + for (int i = 0; i < 128; i++) { + OSMO_ASSERT(file_bytes_write_compl <= sizeof(TESTDATA)); + if (file_bytes_write_compl == sizeof(TESTDATA)) + break; + osmo_select_main(1); + usleep(100 * 1000); + } + fflush(stdout); + OSMO_ASSERT(file_bytes_write_compl == sizeof(TESTDATA)); + + /* Now, re-configure iofd to only read from the fd. Adjust the read/write offset beforehand: */ + printf("Enable read\n"); + rc = lseek(fd, 0, SEEK_SET); + OSMO_ASSERT(rc == 0); + ioops = (struct osmo_io_ops){ .read_cb = file_read_cb }; + rc = osmo_iofd_set_ioops(iofd, &ioops); + OSMO_ASSERT(rc == 0); + /* Allow enough cycles to handle the message. We expect 2 reads, 2nd read will return 0. */ + for (int i = 0; i < 128; i++) { + OSMO_ASSERT(file_bytes_read <= sizeof(TESTDATA)); + if (file_bytes_read == sizeof(TESTDATA) && file_eof_read) + break; + osmo_select_main(1); + usleep(100 * 1000); + } + fflush(stdout); + OSMO_ASSERT(file_bytes_read == sizeof(TESTDATA)); + OSMO_ASSERT(file_eof_read); + + osmo_iofd_free(iofd); + + for (int i = 0; i < 128; i++) + osmo_select_main(1); +} + static void read_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) { printf("%s: read() msg with len=%d\n", osmo_iofd_get_name(iofd), rc); @@ -171,6 +264,7 @@ log_set_print_category(osmo_stderr_target, 0); log_set_print_category_hex(osmo_stderr_target, 0); + test_file(); test_connected(); test_unconnected();
View file
libosmocore_1.10.1.tar.xz/tests/osmo_io/osmo_io_test.ok -> libosmocore_1.11.0.tar.xz/tests/osmo_io/osmo_io_test.ok
Changed
@@ -1,3 +1,12 @@ +Running test_file +Enable write +file-iofd: write() returned rc=16 +01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 +Enable read +file-iofd: read() msg with rc=16 +01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 +file-iofd: read() msg with rc=0 + Running test_connected ep1: write() returned rc=0 ep1: write() returned rc=16
View file
libosmocore_1.10.1.tar.xz/tests/tdef/tdef_vty_config_root_test.c -> libosmocore_1.11.0.tar.xz/tests/tdef/tdef_vty_config_root_test.c
Changed
@@ -19,7 +19,9 @@ * GNU General Public License for more details. */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <getopt.h> #include <signal.h> #include <limits.h>
View file
libosmocore_1.10.1.tar.xz/tests/tdef/tdef_vty_config_subnode_test.c -> libosmocore_1.11.0.tar.xz/tests/tdef/tdef_vty_config_subnode_test.c
Changed
@@ -19,7 +19,9 @@ * GNU General Public License for more details. */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <getopt.h> #include <signal.h> #include <limits.h>
View file
libosmocore_1.10.1.tar.xz/tests/tdef/tdef_vty_dynamic_test.c -> libosmocore_1.11.0.tar.xz/tests/tdef/tdef_vty_dynamic_test.c
Changed
@@ -19,7 +19,9 @@ * GNU General Public License for more details. */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <getopt.h> #include <signal.h> #include <limits.h>
View file
libosmocore_1.10.1.tar.xz/tests/testsuite.at -> libosmocore_1.11.0.tar.xz/tests/testsuite.at
Changed
@@ -218,6 +218,24 @@ AT_CHECK($abs_top_builddir/tests/codec/codec_ecu_fr_test, 0, expout, ignore) AT_CLEANUP +AT_SETUP(codec_efr_sid) +AT_KEYWORDS(codec_efr_sid) +cat $abs_srcdir/codec/codec_efr_sid_test.ok > expout +AT_CHECK($abs_top_builddir/tests/codec/codec_efr_sid_test $abs_srcdir/codec/codec_efr_sid_test.in, 0, expout, ignore) +AT_CLEANUP + +AT_SETUP(codec_fr_sid) +AT_KEYWORDS(codec_fr_sid) +cat $abs_srcdir/codec/codec_fr_sid_test.ok > expout +AT_CHECK($abs_top_builddir/tests/codec/codec_fr_sid_test $abs_srcdir/codec/codec_fr_sid_test.in, 0, expout, ignore) +AT_CLEANUP + +AT_SETUP(codec_hr_sid) +AT_KEYWORDS(codec_hr_sid) +cat $abs_srcdir/codec/codec_hr_sid_test.ok > expout +AT_CHECK($abs_top_builddir/tests/codec/codec_hr_sid_test $abs_srcdir/codec/codec_hr_sid_test.in, 0, expout, ignore) +AT_CLEANUP + AT_SETUP(fr) AT_KEYWORDS(fr) cat $abs_srcdir/fr/fr_test.ok > expout
View file
libosmocore_1.11.0.tar.xz/utils/osmo-install-dbg-pkgs.py
Added
@@ -0,0 +1,155 @@ +#!/usr/bin/env python3 +# Copyright 2025 sysmocom - s.f.m.c. GmbH +# SPDX-License-Identifier: GPL-2.0-or-later +import argparse +import copy +import fnmatch +import os +import shutil +import string +import subprocess +import sys + +args = None + + +def parse_arguments(): + global args + + parser = argparse.ArgumentParser( + description="Install debug packages for all installed Osmocom packages and dependencies" + ) + parser.add_argument( + "-y", + "--yes", + action="store_true", + help="run non-interactively", + ) + args = parser.parse_args() + + +def check_package_manager(): + rel = "/etc/os-release" + + if not os.path.exists(rel): + print(f"ERROR: {rel} does not exist") + sys.exit(1) + + with open(rel) as f: + for line in f: + if "ID=debian" in line or "ID_LIKE=debian" in line: + return + + print("ERROR: only 'apt' is supported by this script") + sys.exit(1) + + +def check_requirements(): + if not shutil.which("apt-rdepends"): + print("ERROR: please install apt-rdepends first:") + print(" apt install apt-rdepends") + sys.exit(1) + + +def get_installed_osmocom_packages(): + """Get installed Osmocom packages by parsing 'dpkg -l' output. Lines with + installed packages look like this: 'ii libosmocore22:amd64 ...'""" + ret = set() + p = subprocess.run("dpkg", "-l", capture_output=True, text=True, check=True) + lines = p.stdout.split("\n") + + patterns = + "gapk*", + "libasn1c*", + "libgtpnl*", + "libosmo*", + "libsmpp34*", + "osmo-*", + + + for line in lines: + if not line.startswith("ii "): + continue + package = line.split(" ", 4)2.split(":", 1)0 + for pattern in patterns: + if fnmatch.fnmatch(package, pattern): + ret.add(package) + break + + return ret + + +def get_recursive_dependencies(pkgs): + """Iterate over apt-rdepends output, it looks like: + osmo-mgw + Depends: libc6 (>= 2.34) + Depends: libosmoabis13""" + ret = copy.copy(pkgs) + + p = subprocess.run("apt-rdepends" + list(pkgs), capture_output=True, text=True, check=True) + lines = p.stdout.split("\n") + for line in lines: + if not line.startswith(" Depends: "): + continue + ret.add(line.strip().split(" ", 3)1) + + return ret + + +def get_debug_pkgs(): + p = subprocess.run("apt-cache pkgnames | grep -- -dbg", shell=True, text=True, capture_output=True) + return p.stdout.split("\n") + + +def get_debug_pkgs_relevant(debug_pkgs, pkgs_with_deps): + ret = + for pkg in pkgs_with_deps: + names = f"{pkg}-dbg", f"{pkg}-dbgsym" + + pkg_nodigits = pkg.rstrip(string.digits) + if pkg != pkg_nodigits: + names += f"{pkg_nodigits}-dbg", f"{pkg_nodigits}-dbgsym" + + for name in names: + if name in debug_pkgs: + ret += name + break + + return ret + + +def install_packages(pkgs): + cmd = + if os.geteuid() != 0: + cmd += "sudo" + cmd += "apt", "install" + if args.yes: + cmd += "-y" + cmd += pkgs + + print(f"+ {cmd}") + p = subprocess.run(cmd) + sys.exit(p.returncode) + + +def main(): + parse_arguments() + check_package_manager() + check_requirements() + + print("Getting installed Osmocom packages...") + pkgs = get_installed_osmocom_packages() + print("Getting dependencies of installed Osmocom packages...") + pkgs_with_deps = get_recursive_dependencies(pkgs) + print("Getting available debug packages...") + debug_pkgs = get_debug_pkgs() + print("Getting relevant debug packages...") + debug_pkgs_relevant = get_debug_pkgs_relevant(debug_pkgs, pkgs_with_deps) + debug_pkgs_relevant = sorted(list(debug_pkgs_relevant)) + + print("Running apt install...") + install_packages(debug_pkgs_relevant) + + +if __name__ == "__main__": + main()
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
.