lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2024

  • 1 participants
  • 1559 discussions
[L] Change in osmocom-bb[master]: mobile: implement sending CSD data over UNIX socket
by fixeria 20 Jan '24

20 Jan '24
Attention is currently required from: jolly, laforge, osmith, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35583?usp=email ) Change subject: mobile: implement sending CSD data over UNIX socket ...................................................................... Patch Set 6: (2 comments) File src/host/layer23/src/mobile/tch_data_sock.c: https://gerrit.osmocom.org/c/osmocom-bb/+/35583/comment/e235081d_97ceac1b PS5, Line 168: osmo_fd_read_disable(&state->listen_bfd); > You disable read of socket listening fd. […] Ack, thanks. Fixed in the next patchset revision. File src/host/layer23/src/mobile/tch_data_sock.c: https://gerrit.osmocom.org/c/osmocom-bb/+/35583/comment/ecfa861f_539b350b PS6, Line 111: osmo_fd_write_disable(bfd); > afaiu this should only be done when llist becomes empty, aka after te "while" Ack. We also leak `msg` here... Fixed in the next patchset revision. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35583?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Id054af7b3d9d0a41715f7981deb420f6e09bf30c Gerrit-Change-Number: 35583 Gerrit-PatchSet: 6 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: jolly <andreas(a)eversberg.eu> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 20 Jan 2024 00:26:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: gsup: Convert PDP-Type IE to PDP-Address IE
by pespin 20 Jan '24

20 Jan '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35627?usp=email ) Change subject: gsup: Convert PDP-Type IE to PDP-Address IE ...................................................................... gsup: Convert PDP-Type IE to PDP-Address IE The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6 --- M TODO-RELEASE M include/osmocom/gsm/gsup.h M src/gsm/Makefile.am M src/gsm/gsup.c M tests/Makefile.am M tests/gsup/gsup_test.err 6 files changed, 162 insertions(+), 15 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve diff --git a/TODO-RELEASE b/TODO-RELEASE index 3a0c80c..a8e812b 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -17,3 +17,4 @@ gsm ABI change add T200 timer states to lapdm_datalink gsm ABI change add UI queue to struct lapdm_datalink gsm ADD gsup.h: struct osmo_gsup_pdp_info fields pdp_type_nr, pdp_type_org, deprecate pdp_type. +gsm ABI change gsup.h: Add field pdp_address in struct osmo_gsup_pdp_info shifts the struct, and in turn fields in struct osmo_gsup_message. diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 49d1264..a17a729 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -37,11 +37,13 @@ * */ #pragma once +#if (!EMBEDDED) #include <stdint.h> #include <osmocom/core/msgb.h> #include <osmocom/core/defs.h> #include <osmocom/core/endian.h> +#include <osmocom/core/socket.h> #include <osmocom/gsm/gsup_sms.h> #include <osmocom/gsm/protocol/gsm_23_003.h> #include <osmocom/gsm/protocol/gsm_03_40.h> @@ -60,8 +62,6 @@ #define OSMO_GSUP_MAX_MSISDN_LEN 9 #define OSMO_GSUP_MAX_CALLED_PARTY_BCD_LEN 43 /* TS 24.008 10.5.4.7 */ -#define OSMO_GSUP_PDP_TYPE_SIZE 2 - /*! Information Element Identifiers for GSUP IEs */ enum osmo_gsup_iei { OSMO_GSUP_IMSI_IE = 0x01, @@ -75,7 +75,8 @@ OSMO_GSUP_HLR_NUMBER_IE = 0x09, OSMO_GSUP_MESSAGE_CLASS_IE = 0x0a, OSMO_GSUP_PDP_CONTEXT_ID_IE = 0x10, - OSMO_GSUP_PDP_TYPE_IE = 0x11, + OSMO_GSUP_PDP_ADDRESS_IE = 0x11, +#define OSMO_GSUP_PDP_TYPE_IE OSMO_GSUP_PDP_ADDRESS_IE /* Backward compat */ OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, OSMO_GSUP_PDP_QOS_IE = 0x13, OSMO_GSUP_CHARG_CHAR_IE = 0x14, @@ -275,6 +276,7 @@ #endif }; }; + struct osmo_sockaddr pdp_address[2]; /*! APN information, still in encoded form. Can be NULL if no * APN information included */ const uint8_t *apn_enc; @@ -412,4 +414,5 @@ int osmo_gsup_get_err_msg_type(enum osmo_gsup_message_type type_in) OSMO_DEPRECATED("Use OSMO_GSUP_TO_MSGT_ERROR() instead"); +#endif /* (!EMBEDDED) */ /*! @} */ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 67ecf9d..e6b687d 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -33,10 +33,13 @@ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ tuak/KeccakP-1600-3gpp.c tuak/tuak.c auth_tuak.c \ - gsup.c gsup_sms.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ + gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ gsm23003.c gsm23236.c mncc.c bts_features.c oap_client.c \ gsm29118.c gsm48_rest_octets.c cbsp.c gsm48049.c \ gad.c bsslap.c bssmap_le.c kdf.c iuup.c gsm44021.c gsm44068.c rlp.c +if !EMBEDDED +libgsmint_la_SOURCES += gsup.c gsup_sms.c +endif # !EMBEDDED libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/core/libosmocore.la $(top_builddir)/src/isdn/libosmoisdn.la diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 00a9a60..3daf75c 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -126,6 +126,62 @@ return OSMO_GSUP_TO_MSGT_ERROR(type_in); } +static int decode_pdp_address(const uint8_t *data, size_t data_len, struct osmo_gsup_pdp_info *pdp_info) +{ + const struct gsm48_pdp_address *pdp_addr = (const struct gsm48_pdp_address *)data; + /* Explicitly pre-nitialize them to AF_UNSPEC to signal they are empty: */ + pdp_info->pdp_address[0].u.sa.sa_family = AF_UNSPEC; + pdp_info->pdp_address[1].u.sa.sa_family = AF_UNSPEC; + + if (data_len < 2) + return -GMM_CAUSE_PROTO_ERR_UNSPEC; + + pdp_info->pdp_type_org = pdp_addr->organization; + pdp_info->pdp_type_nr = pdp_addr->type; + + if (pdp_info->pdp_type_org != PDP_TYPE_ORG_IETF) + return -GMM_CAUSE_PROTO_ERR_UNSPEC; + + /* Skip type-org + type-nr for easy calculations below: */ + data_len -= 2; + + switch (pdp_info->pdp_type_nr) { + case PDP_TYPE_N_IETF_IPv4: + if (data_len == 0) + return 0; /* empty, marked as AF_UNSET. */ + if (data_len != sizeof(pdp_addr->ietf.v4)) + return -GMM_CAUSE_PROTO_ERR_UNSPEC; + pdp_info->pdp_address[0].u.sa.sa_family = AF_INET; + pdp_info->pdp_address[0].u.sin.sin_addr.s_addr = pdp_addr->ietf.v4; + return 0; + case PDP_TYPE_N_IETF_IPv6: + if (data_len == 0) + return 0; /* empty, marked as AF_UNSET. */ + if (data_len != sizeof(pdp_addr->ietf.v6)) + return -GMM_CAUSE_PROTO_ERR_UNSPEC; + pdp_info->pdp_address[0].u.sa.sa_family = AF_INET6; + memcpy(&pdp_info->pdp_address[0].u.sin6.sin6_addr, + pdp_addr->ietf.v6, + sizeof(pdp_addr->ietf.v6)); + return 0; + case PDP_TYPE_N_IETF_IPv4v6: + if (data_len == 0) + return 0; /* empty, marked as AF_UNSET. */ + if (data_len != sizeof(pdp_addr->ietf.v4v6)) + return -GMM_CAUSE_PROTO_ERR_UNSPEC; + pdp_info->pdp_address[0].u.sa.sa_family = AF_INET; + pdp_info->pdp_address[0].u.sin.sin_addr.s_addr = pdp_addr->ietf.v4v6.v4; + pdp_info->pdp_address[1].u.sa.sa_family = AF_INET6; + memcpy(&pdp_info->pdp_address[1].u.sin6.sin6_addr, + pdp_addr->ietf.v4v6.v6, + sizeof(pdp_addr->ietf.v4v6.v6)); + return 0; + default: + /* reserved, both pdp_info->pdp_address are preinitialied to AF_UNSET. */ + return 0; + } +} + static int decode_pdp_info(uint8_t *data, size_t data_len, struct osmo_gsup_pdp_info *pdp_info) { @@ -149,11 +205,9 @@ pdp_info->context_id = osmo_decode_big_endian(value, value_len); break; - case OSMO_GSUP_PDP_TYPE_IE: - if (value_len < 2) - return -GMM_CAUSE_PROTO_ERR_UNSPEC; - pdp_info->pdp_type_org = value[0] & 0x0f; - pdp_info->pdp_type_nr = value[1]; + case OSMO_GSUP_PDP_ADDRESS_IE: + if ((rc = decode_pdp_address(value, value_len, pdp_info)) < 0) + return rc; break; case OSMO_GSUP_ACCESS_POINT_NAME_IE: @@ -359,7 +413,7 @@ switch (iei) { case OSMO_GSUP_IMSI_IE: - case OSMO_GSUP_PDP_TYPE_IE: + case OSMO_GSUP_PDP_ADDRESS_IE: case OSMO_GSUP_ACCESS_POINT_NAME_IE: case OSMO_GSUP_SRES_IE: case OSMO_GSUP_KC_IE: @@ -605,12 +659,42 @@ if (pdp_info->pdp_type_org == PDP_TYPE_ORG_IETF) { struct gsm48_pdp_address pdp_addr; + uint8_t pdp_addr_len = 2; pdp_addr.spare = 0x0f; pdp_addr.organization = pdp_info->pdp_type_org; pdp_addr.type = pdp_info->pdp_type_nr; - msgb_tlv_put(msg, OSMO_GSUP_PDP_TYPE_IE, - OSMO_GSUP_PDP_TYPE_SIZE, + switch (pdp_info->pdp_type_nr) { + case PDP_TYPE_N_IETF_IPv4: + if (pdp_info->pdp_address[0].u.sa.sa_family == AF_INET) { + pdp_addr.ietf.v4 = pdp_info->pdp_address[0].u.sin.sin_addr.s_addr; + pdp_addr_len += sizeof(pdp_addr.ietf.v4); + } + break; + case PDP_TYPE_N_IETF_IPv6: + if (pdp_info->pdp_address[0].u.sa.sa_family == AF_INET6) { + memcpy(pdp_addr.ietf.v6, + &pdp_info->pdp_address[0].u.sin6.sin6_addr, + sizeof(pdp_addr.ietf.v6)); + pdp_addr_len += sizeof(pdp_addr.ietf.v6); + } + break; + case PDP_TYPE_N_IETF_IPv4v6: + if (pdp_info->pdp_address[0].u.sa.sa_family == AF_INET) { + pdp_addr.ietf.v4v6.v4 = pdp_info->pdp_address[0].u.sin.sin_addr.s_addr; + pdp_addr_len += sizeof(pdp_addr.ietf.v4v6.v4); + } + if (pdp_info->pdp_address[0].u.sa.sa_family == AF_INET6) { + memcpy(pdp_addr.ietf.v4v6.v6, + &pdp_info->pdp_address[1].u.sin6.sin6_addr, + sizeof(pdp_addr.ietf.v4v6.v6)); + pdp_addr_len += sizeof(pdp_addr.ietf.v4v6.v6); + } + break; + } + + msgb_tlv_put(msg, OSMO_GSUP_PDP_ADDRESS_IE, + pdp_addr_len, (const uint8_t *)&pdp_addr); } diff --git a/tests/Makefile.am b/tests/Makefile.am index 153f2e8..5042b3c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,7 +20,7 @@ comp128/comp128_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ bits/bitfield_test \ - tlv/tlv_test gsup/gsup_test oap/oap_test \ + tlv/tlv_test oap/oap_test \ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ @@ -87,9 +87,11 @@ if !EMBEDDED check_PROGRAMS += \ + gsup/gsup_test \ stats/stats_test \ stats/stats_vty_test \ - exec/exec_test + exec/exec_test \ + $(NULL) endif if ENABLE_GB @@ -647,9 +649,11 @@ >$(srcdir)/timer/clk_override_test.ok tlv/tlv_test \ >$(srcdir)/tlv/tlv_test.ok +if !EMBEDDED gsup/gsup_test \ >$(srcdir)/gsup/gsup_test.ok \ 2>$(srcdir)/gsup/gsup_test.err +endif if ENABLE_CTRL fsm/fsm_test \ >$(srcdir)/fsm/fsm_test.ok \ diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index fc3c86e..73a0776 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -164,7 +164,7 @@ message 2: tested 21248 modifications, 2577 parse failures message 3: tested 2816 modifications, 510 parse failures message 4: tested 3584 modifications, 770 parse failures - message 5: tested 20736 modifications, 4028 parse failures + message 5: tested 20736 modifications, 4517 parse failures message 6: tested 3584 modifications, 771 parse failures message 7: tested 3584 modifications, 770 parse failures message 8: tested 2816 modifications, 510 parse failures -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35627?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6 Gerrit-Change-Number: 35627 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: gsm_04_08_gprs.h: Introduce packed struct gsm48_pdp_address
by pespin 20 Jan '24

20 Jan '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35625?usp=email ) Change subject: gsm_04_08_gprs.h: Introduce packed struct gsm48_pdp_address ...................................................................... gsm_04_08_gprs.h: Introduce packed struct gsm48_pdp_address This can be used in several protocols, such as GTP, GSUP, etc. Related: OS#6091 Change-Id: I453ced42dd36df3a6ddb5db67093df5a22cad18c --- M include/osmocom/gsm/protocol/gsm_04_08_gprs.h 1 file changed, 47 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index 8799d65..2671aaf 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -294,10 +294,11 @@ PDP_S_MODIFY_PENDING, }; -/* Table 10.5.155/3GPP TS 24.008 */ +/* TS 24.008 Table 10.5.155/3GPP */ enum gsm48_pdp_type_org { PDP_TYPE_ORG_ETSI = 0x00, PDP_TYPE_ORG_IETF = 0x01, + PDP_TYPE_ORG_EMPTY = 0x0f, }; enum gsm48_pdp_type_nr { PDP_TYPE_N_ETSI_RESERVED = 0x00, @@ -306,6 +307,39 @@ PDP_TYPE_N_IETF_IPv6 = 0x57, PDP_TYPE_N_IETF_IPv4v6 = 0x8D, }; +/* TS 24.008 10.5.6.4 "Packet data protocol address" value + * Note: This can be reused for 3GPP TS 29.060 7.7.27 "End User Address" + * with minor changes in the values, like spare being 1111 instead. +*/ +struct gsm48_pdp_address { +#if OSMO_IS_LITTLE_ENDIAN +uint8_t organization:4, /* enum gsm48_pdp_type_org */ + spare:4; /* 0000 */ +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ +uint8_t spare:4, organization:4; +#endif +uint8_t type; /* enum gsm48_pdp_type_nr */ + union { + /* PDP_TYPE_ORG_ETSI */ + union { + } etsi; + /* PDP_TYPE_ORG_IETF */ + union { + /* PDP_TYPE_N_IETF_IPv4 */ + uint32_t v4; + + /* PDP_TYPE_N_IETF_IPv6 */ + uint8_t v6[16]; + + /* PDP_TYPE_N_IETF_IPv4v6 */ + struct { + uint32_t v4; + uint8_t v6[16]; + } __attribute__ ((packed)) v4v6; + } ietf; + }; +} __attribute__ ((packed)); /* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */ enum gsm48_qos_reliab_class { -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35625?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I453ced42dd36df3a6ddb5db67093df5a22cad18c Gerrit-Change-Number: 35625 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: gsup: Fail decoding if len of PDP Type IE is less than 2 bytes
by pespin 20 Jan '24

20 Jan '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35624?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: gsup: Fail decoding if len of PDP Type IE is less than 2 bytes ...................................................................... gsup: Fail decoding if len of PDP Type IE is less than 2 bytes As documented in gsup.adoc, this field is expected to be 2 bytes. This is only a intermediate step to showcase the related test scenarios submitting IE with len > 2. The logic will be changed in a follow-up patch when changing the IE to also encode/decode the missing Address part. Change-Id: I0d024a9a4fb10beeff39ac33a9d2ed02f88f4580 --- M src/gsm/gsup.c M tests/gsup/gsup_test.err 2 files changed, 19 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 4e18ddb..2beff4a 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -150,6 +150,8 @@ break; case OSMO_GSUP_PDP_TYPE_IE: + if (value_len < 2) + return -GMM_CAUSE_PROTO_ERR_UNSPEC; pdp_info->pdp_type = osmo_decode_big_endian(value, value_len) & 0x0fff; break; diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index 7b2fda9..fc3c86e 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -164,7 +164,7 @@ message 2: tested 21248 modifications, 2577 parse failures message 3: tested 2816 modifications, 510 parse failures message 4: tested 3584 modifications, 770 parse failures - message 5: tested 20736 modifications, 4025 parse failures + message 5: tested 20736 modifications, 4028 parse failures message 6: tested 3584 modifications, 771 parse failures message 7: tested 3584 modifications, 770 parse failures message 8: tested 2816 modifications, 510 parse failures -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35624?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I0d024a9a4fb10beeff39ac33a9d2ed02f88f4580 Gerrit-Change-Number: 35624 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: gsup: Deprecate field pdp_type in favour of pdp_type_nr and pdp_type_org
by pespin 20 Jan '24

20 Jan '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35626?usp=email ) Change subject: gsup: Deprecate field pdp_type in favour of pdp_type_nr and pdp_type_org ...................................................................... gsup: Deprecate field pdp_type in favour of pdp_type_nr and pdp_type_org Having both fields in an uin16_t integer makes it difficult and confusing for users for no good reason. Let's have separate fields for each of them. The new fields are defined so that they are ABI compatible with previous uin16 field. Change-Id: Ie31c6080c90e468c01186259f2c42621e39b5cc6 --- M TODO-RELEASE M include/osmocom/gsm/gsup.h M src/gsm/gsup.c 3 files changed, 41 insertions(+), 7 deletions(-) Approvals: pespin: Looks good to me, approved fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index e1d365e..3a0c80c 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -16,3 +16,4 @@ isdn ADD initial implementation of the V.110 Terminal Adapter gsm ABI change add T200 timer states to lapdm_datalink gsm ABI change add UI queue to struct lapdm_datalink +gsm ADD gsup.h: struct osmo_gsup_pdp_info fields pdp_type_nr, pdp_type_org, deprecate pdp_type. diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 6c23297..49d1264 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -40,6 +40,8 @@ #include <stdint.h> #include <osmocom/core/msgb.h> +#include <osmocom/core/defs.h> +#include <osmocom/core/endian.h> #include <osmocom/gsm/gsup_sms.h> #include <osmocom/gsm/protocol/gsm_23_003.h> #include <osmocom/gsm/protocol/gsm_03_40.h> @@ -260,8 +262,19 @@ struct osmo_gsup_pdp_info { unsigned int context_id; int have_info; - /*! Type of PDP context */ - uint16_t pdp_type; + /*! Type of PDP context, 3GPP TS 29.060, 7.7.27 */ + union { + uint16_t pdp_type OSMO_DEPRECATED("use pdp_type_org and pdp_type_nr instead"); + struct { +#if OSMO_IS_LITTLE_ENDIAN + uint8_t pdp_type_nr; /* enum gsm48_pdp_type_nr */ + uint8_t pdp_type_org; /* enum gsm48_pdp_type_org */ +#elif OSMO_IS_BIG_ENDIAN + uint8_t pdp_type_org; /* enum gsm48_pdp_type_org */ + uint8_t pdp_type_nr; /* enum gsm48_pdp_type_nr */ +#endif + }; + }; /*! APN information, still in encoded form. Can be NULL if no * APN information included */ const uint8_t *apn_enc; diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 2beff4a..00a9a60 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -152,8 +152,8 @@ case OSMO_GSUP_PDP_TYPE_IE: if (value_len < 2) return -GMM_CAUSE_PROTO_ERR_UNSPEC; - pdp_info->pdp_type = - osmo_decode_big_endian(value, value_len) & 0x0fff; + pdp_info->pdp_type_org = value[0] & 0x0f; + pdp_info->pdp_type_nr = value[1]; break; case OSMO_GSUP_ACCESS_POINT_NAME_IE: @@ -603,11 +603,15 @@ u8 = pdp_info->context_id; msgb_tlv_put(msg, OSMO_GSUP_PDP_CONTEXT_ID_IE, sizeof(u8), &u8); - if (pdp_info->pdp_type) { + if (pdp_info->pdp_type_org == PDP_TYPE_ORG_IETF) { + struct gsm48_pdp_address pdp_addr; + pdp_addr.spare = 0x0f; + pdp_addr.organization = pdp_info->pdp_type_org; + pdp_addr.type = pdp_info->pdp_type_nr; + msgb_tlv_put(msg, OSMO_GSUP_PDP_TYPE_IE, OSMO_GSUP_PDP_TYPE_SIZE, - osmo_encode_big_endian(pdp_info->pdp_type | 0xf000, - OSMO_GSUP_PDP_TYPE_SIZE)); + (const uint8_t *)&pdp_addr); } if (pdp_info->apn_enc) { -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35626?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie31c6080c90e468c01186259f2c42621e39b5cc6 Gerrit-Change-Number: 35626 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[master]: gsup: Convert PDP-Type IE to PDP-Address IE
by pespin 19 Jan '24

19 Jan '24
Attention is currently required from: neels, osmith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35627?usp=email ) Change subject: gsup: Convert PDP-Type IE to PDP-Address IE ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35627?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6 Gerrit-Change-Number: 35627 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Fri, 19 Jan 2024 23:54:48 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: gsup: Deprecate field pdp_type in favour of pdp_type_nr and pdp_type_org
by pespin 19 Jan '24

19 Jan '24
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35626?usp=email ) Change subject: gsup: Deprecate field pdp_type in favour of pdp_type_nr and pdp_type_org ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35626?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie31c6080c90e468c01186259f2c42621e39b5cc6 Gerrit-Change-Number: 35626 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 19 Jan 2024 23:54:44 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: gsm_04_08_gprs.h: Introduce packed struct gsm48_pdp_address
by pespin 19 Jan '24

19 Jan '24
Attention is currently required from: laforge, lynxis lazus. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35625?usp=email ) Change subject: gsm_04_08_gprs.h: Introduce packed struct gsm48_pdp_address ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35625?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I453ced42dd36df3a6ddb5db67093df5a22cad18c Gerrit-Change-Number: 35625 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Fri, 19 Jan 2024 23:54:38 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: doc/examples/mobile: add tch-{data,voice} sections
by pespin 19 Jan '24

19 Jan '24
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35636?usp=email ) Change subject: doc/examples/mobile: add tch-{data,voice} sections ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35636?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I9e53d4c429445ded07d77b27b6a31aa404b00e27 Gerrit-Change-Number: 35636 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 19 Jan 2024 23:52:44 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmocom-bb[master]: mobile: implement sending CSD data over UNIX socket
by pespin 19 Jan '24

19 Jan '24
Attention is currently required from: fixeria, laforge, osmith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35583?usp=email ) Change subject: mobile: implement sending CSD data over UNIX socket ...................................................................... Patch Set 6: (1 comment) File src/host/layer23/src/mobile/tch_data_sock.c: https://gerrit.osmocom.org/c/osmocom-bb/+/35583/comment/efb1c8b0_1dbdcd67 PS6, Line 111: osmo_fd_write_disable(bfd); afaiu this should only be done when llist becomes empty, aka after te "while" -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35583?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Id054af7b3d9d0a41715f7981deb420f6e09bf30c Gerrit-Change-Number: 35583 Gerrit-PatchSet: 6 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: jolly <andreas(a)eversberg.eu> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 19 Jan 2024 23:50:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • ...
  • 156
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.