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 -----
  • November
  • 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

July 2023

  • 1 participants
  • 3051 discussions
[M] Change in osmo-ttcn3-hacks[master]: msc: TC_lu_and_mo_csd: test multiple bearer services
by laforge 18 Jul '23

18 Jul '23
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33665 ) Change subject: msc: TC_lu_and_mo_csd: test multiple bearer services ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33665 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I74f983e1f5c0fef61018a9a5b92ed3b3cdbdfb5f Gerrit-Change-Number: 33665 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 18 Jul 2023 06:33:09 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: msc: f_call_hangup: add missing rx MNCC_REL_cnf
by laforge 18 Jul '23

18 Jul '23
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33664 ) Change subject: msc: f_call_hangup: add missing rx MNCC_REL_cnf ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33664 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia2ed7ce092e73e17c4243e83bfd239ead8266b49 Gerrit-Change-Number: 33664 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 18 Jul 2023 06:32:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-msc[master]: csd_bs_list_to_gsm0808_channel_type: add T 300
by laforge 18 Jul '23

18 Jul '23
Attention is currently required from: osmith, pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/33591 ) Change subject: csd_bs_list_to_gsm0808_channel_type: add T 300 ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/33591 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I7297cc481fbe36355b5231ca800cf566a1ee93c0 Gerrit-Change-Number: 33591 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(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-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 18 Jul 2023 06:32:28 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: osmo_io: Add function to change the maximum length of the tx_queue
by laforge 18 Jul '23

18 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33686 ) Change subject: osmo_io: Add function to change the maximum length of the tx_queue ...................................................................... osmo_io: Add function to change the maximum length of the tx_queue Change-Id: If3d1de8bffe1123002515878655ea9e02b482888 --- M include/osmocom/core/osmo_io.h M src/core/libosmocore.map M src/core/osmo_io.c 3 files changed, 20 insertions(+), 0 deletions(-) Approvals: daniel: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h index 3715f93..8f3c060 100644 --- a/include/osmocom/core/osmo_io.h +++ b/include/osmocom/core/osmo_io.h @@ -86,6 +86,7 @@ const struct osmo_sockaddr *dest); void osmo_iofd_set_alloc_info(struct osmo_io_fd *iofd, unsigned int size, unsigned int headroom); +void osmo_iofd_set_txqueue_max_length(struct osmo_io_fd *iofd, unsigned int size); void *osmo_iofd_get_data(const struct osmo_io_fd *iofd); void osmo_iofd_set_data(struct osmo_io_fd *iofd, void *data); diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map index 50be67c..99be86c 100644 --- a/src/core/libosmocore.map +++ b/src/core/libosmocore.map @@ -268,6 +268,7 @@ osmo_iofd_set_data; osmo_iofd_set_ioops; osmo_iofd_set_priv_nr; +osmo_iofd_set_txqueue_max_length; osmo_iofd_setup; osmo_iofd_txqueue_clear; osmo_iofd_txqueue_len; diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 8217316..90ea674 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -542,6 +542,15 @@ iofd->msgb_alloc.size = size; } +/*! Set the maximum number of messages enqueued for sending. + * \param[in] iofd the file descriptor + * \param[in] size the maximum size of the transmit queue + */ +void osmo_iofd_set_txqueue_max_length(struct osmo_io_fd *iofd, unsigned int max_length) +{ + iofd->tx_queue.max_length = max_length; +} + /*! Get the associated user-data from an iofd * \param[in] iofd the file descriptor * \returns the data that was previously set with \ref osmo_iofd_setup() -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33686 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: If3d1de8bffe1123002515878655ea9e02b482888 Gerrit-Change-Number: 33686 Gerrit-PatchSet: 4 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: osmo_io: Document expectation that segmentation_cb() can modify msgb
by laforge 18 Jul '23

18 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33685 ) Change subject: osmo_io: Document expectation that segmentation_cb() can modify msgb ...................................................................... osmo_io: Document expectation that segmentation_cb() can modify msgb This is used for parsing e.g. the ipa header and setting msg->cb. Guard against segmentation_cb changing msg->data in iofd_handle_segmentation(). Change-Id: Idd2115baae98a7818aabb26232d4423d2d48fb5c --- M include/osmocom/core/osmo_io.h M src/core/osmo_io.c 2 files changed, 26 insertions(+), 4 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h index 932b909..3715f93 100644 --- a/include/osmocom/core/osmo_io.h +++ b/include/osmocom/core/osmo_io.h @@ -46,7 +46,11 @@ * Needs to return the size of the next message. If it returns * -EAGAIN or a value larger than msgb_length() (message is incomplete) * osmo_io will wait for more data to be read. Other negative values - * cause the msg to be discarded. */ + * cause the msg to be discarded. + * If a full message was received (segmentation_cb() returns a value <= msgb_length()) + * the msgb will be trimmed to size by osmo_io and forwarded to the read call-back. Any + * parsing done to the msgb by segmentation_cb() will be preserved for the read_cb() + * (e.g. setting lxh or msgb->cb). */ int (*segmentation_cb)(struct msgb *msg); }; diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index fdb9e32..8217316 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -226,6 +226,9 @@ int extra_len, received_len; struct msgb *msg_pending; + /* Save the start of message before segmentation_cb (which could change it) */ + uint8_t *data = msg->data; + received_len = msgb_length(msg); if (!iofd->io_ops.segmentation_cb) { @@ -258,12 +261,14 @@ /* msgb contains more than one segment */ /* Copy the trailing data over */ msg_pending = iofd_msgb_alloc(iofd); - memcpy(msgb_data(msg_pending), msgb_data(msg) + expected_len, extra_len); + memcpy(msgb_data(msg_pending), data + expected_len, extra_len); msgb_put(msg_pending, extra_len); *pending_out = msg_pending; - /* Trim the original msgb to size */ - msgb_trim(msg, expected_len); + /* Trim the original msgb to size. Don't use msgb_trim because we need to reference + * msg->data from before it might have been modified by the segmentation_cb(). */ + msg->len = expected_len; + msg->tail = data + expected_len; return IOFD_SEG_ACT_HANDLE_MORE; defer: -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Idd2115baae98a7818aabb26232d4423d2d48fb5c Gerrit-Change-Number: 33685 Gerrit-PatchSet: 3 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: cosmetic: Fix doc comment
by laforge 18 Jul '23

18 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33687 ) Change subject: cosmetic: Fix doc comment ...................................................................... cosmetic: Fix doc comment Change-Id: Iec614004a0382534f4bfcc375f4d89192d7f27aa --- M src/core/osmo_io.c 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve daniel: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 90ea674..8cc6d37 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -533,6 +533,7 @@ } /*! Set the size and headroom of the msgb allocated when receiving messages + * \param[in] iofd the file descriptor * \param[in] size the size of the msgb when receiving data * \param[in] headroom the headroom of the msgb when receiving data */ -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iec614004a0382534f4bfcc375f4d89192d7f27aa Gerrit-Change-Number: 33687 Gerrit-PatchSet: 4 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[master]: osmo_io(cosmetic): End in a dot for doxygen AUTO_BRIEF
by laforge 18 Jul '23

18 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33716 ) Change subject: osmo_io(cosmetic): End in a dot for doxygen AUTO_BRIEF ...................................................................... osmo_io(cosmetic): End in a dot for doxygen AUTO_BRIEF Change-Id: I397304eed524db12e60a6534d21ea268f304cfdc --- M src/core/osmo_io.c 1 file changed, 33 insertions(+), 24 deletions(-) Approvals: laforge: Looks good to me, approved dexter: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 8cc6d37..b4c8eb6 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -86,7 +86,7 @@ osmo_iofd_init(); } -/*! Allocate the msghdr +/*! Allocate the msghdr. * \param[in] iofd the osmo_io file structure * \param[in] action the action this msg(hdr) is for (read, write, ..) * \param[in] msg the msg buffer to use. Will allocate a new one if NULL @@ -111,7 +111,7 @@ return hdr; } -/*! Free the msghdr +/*! Free the msghdr. * \param[in] msghdr the msghdr to free */ void iofd_msghdr_free(struct iofd_msghdr *msghdr) @@ -155,7 +155,7 @@ return msg; } -/*! Enqueue a message to be sent +/*! Enqueue a message to be sent. * * Enqueues the message at the back of the queue provided there is enough space. * \param[in] iofd the file descriptor @@ -177,7 +177,7 @@ return 0; } -/*! Enqueue a message at the front +/*! Enqueue a message at the front. * * Used to enqueue a msgb from a partial send again. This function will always * enqueue the message, even if the maximum number of messages is reached. @@ -193,7 +193,7 @@ osmo_iofd_ops.write_enable(iofd); } -/*! Dequeue a message from the front +/*! Dequeue a message from the front. * * \param[in] iofd the file descriptor * \returns the msghdr from the front of the queue or NULL if the queue is empty @@ -302,7 +302,7 @@ /* Public functions */ -/*! Send a message through a connected socket +/*! Send a message through a connected socket. * * Appends the message to the internal transmit queue. * If the function returns success (0) it will take ownership of the msgb and @@ -335,7 +335,7 @@ return 0; } -/*! Send a message through an unconnected socket +/*! Send a message through an unconnected socket. * * Appends the message to the internal transmit queue. * If the function returns success (0), it will take ownership of the msgb and @@ -378,7 +378,7 @@ return 0; } -/*! Allocate and setup a new iofd +/*! Allocate and setup a new iofd. * \param[in] ctx the parent context from which to allocate * \param[in] fd the underlying system file descriptor * \param[in] name the name of the iofd @@ -418,7 +418,7 @@ return iofd; } -/*! Register the fd with the underlying backend +/*! Register the fd with the underlying backend. * * \param[in] iofd the iofd file descriptor * \param[in] fd the system fd number that will be registeres. If negative will use the one already set. @@ -445,7 +445,7 @@ return rc; } -/*! Unregister the fd from the underlying backend +/*! Unregister the fd from the underlying backend. * * \param[in] iofd the file descriptor * \returns zero on success, a negative value on error @@ -459,7 +459,7 @@ return 0; } -/*! Get the number of messages in the tx queue +/*! Get the number of messages in the tx queue. * * \param[in] iofd the file descriptor */ @@ -468,7 +468,7 @@ return iofd->tx_queue.current_length; } -/*! Clear the transmit queue of the the iofd +/*! Clear the transmit queue of the the iofd. * * This function frees all messages currently pending in the transmit queue * \param[in] iofd the file descriptor @@ -482,7 +482,7 @@ } } -/*! Free the iofd +/*! Free the iofd. * * This function is safe to use in the read/write callbacks and will defer freeing it until safe to do so. * The iofd will be closed before. @@ -504,7 +504,7 @@ } } -/*! Close the iofd +/*! Close the iofd. * * This function closes the underlying fd and clears any messages in the tx queue * The iofd is not freed and can be assigned a new file descriptor with osmo_iofd_register() @@ -532,7 +532,7 @@ return rc; } -/*! Set the size and headroom of the msgb allocated when receiving messages +/*! Set the size and headroom of the msgb allocated when receiving messages. * \param[in] iofd the file descriptor * \param[in] size the size of the msgb when receiving data * \param[in] headroom the headroom of the msgb when receiving data @@ -552,7 +552,7 @@ iofd->tx_queue.max_length = max_length; } -/*! Get the associated user-data from an iofd +/*! Get the associated user-data from an iofd. * \param[in] iofd the file descriptor * \returns the data that was previously set with \ref osmo_iofd_setup() */ @@ -561,7 +561,7 @@ return iofd->data; } -/*! Set the associated user-data from an iofd +/*! Set the associated user-data from an iofd. * \param[in] iofd the file descriptor * \param[in] data the data to set */ @@ -570,7 +570,7 @@ iofd->data = data; } -/*! Get the private number from an iofd +/*! Get the private number from an iofd. * \param[in] iofd the file descriptor * \returns the private number that was previously set with \ref osmo_iofd_set_priv_nr() */ @@ -579,7 +579,7 @@ return iofd->priv_nr; } -/*! Set the private number from an iofd +/*! Set the private number from an iofd. * \param[in] iofd the file descriptor * \param[in] priv_nr the private number to set */ @@ -588,7 +588,7 @@ iofd->priv_nr = priv_nr; } -/*! Get the underlying file descriptor from an iofd +/*! Get the underlying file descriptor from an iofd. * \param[in] iofd the file descriptor * \returns the underlying file descriptor number */ int osmo_iofd_get_fd(const struct osmo_io_fd *iofd) @@ -596,7 +596,7 @@ return iofd->fd; } -/*! Get the name of the file descriptor +/*! Get the name of the file descriptor. * \param[in] iofd the file descriptor * \returns the name of the iofd as given in \ref osmo_iofd_setup() */ const char *osmo_iofd_get_name(const struct osmo_io_fd *iofd) @@ -604,7 +604,7 @@ return iofd->name; } -/*! Set the name of the file descriptor +/*! Set the name of the file descriptor. * \param[in] iofd the file descriptor * \param[in] name the name to set on the file descriptor */ void osmo_iofd_set_name(struct osmo_io_fd *iofd, const char *name) @@ -612,7 +612,7 @@ osmo_talloc_replace_string(iofd, &iofd->name, name); } -/*! Set the osmo_io_ops for an iofd +/*! Set the osmo_io_ops for an iofd. * \param[in] iofd Target iofd file descriptor * \param[in] ioops osmo_io_ops structure to be set */ void osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops) @@ -620,7 +620,7 @@ iofd->io_ops = *ioops; } -/*! Notify the user if/when the socket is connected +/*! Notify the user if/when the socket is connected. * When the socket is connected the write_cb will be called. * \param[in] iofd the file descriptor */ void osmo_iofd_notify_connected(struct osmo_io_fd *iofd) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I397304eed524db12e60a6534d21ea268f304cfdc Gerrit-Change-Number: 33716 Gerrit-PatchSet: 2 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[master]: osmo_io(cosmetic): End in a dot for doxygen AUTO_BRIEF
by laforge 18 Jul '23

18 Jul '23
Attention is currently required from: neels, daniel, dexter. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33716 ) Change subject: osmo_io(cosmetic): End in a dot for doxygen AUTO_BRIEF ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I397304eed524db12e60a6534d21ea268f304cfdc Gerrit-Change-Number: 33716 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 18 Jul 2023 06:30:22 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pySim-shell: Iterate over CardApplication sub-classes
by laforge 18 Jul '23

18 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33700 ) Change subject: pySim-shell: Iterate over CardApplication sub-classes ...................................................................... pySim-shell: Iterate over CardApplication sub-classes Rather than having to know and explicitly list every CardApplication, let's iterate over the __subclasses__ of the CardApplication base class. Change-Id: Ia6918e49d73d80acfaf09506e604d4929d37f1b6 --- M pySim-shell.py 1 file changed, 32 insertions(+), 16 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim-shell.py b/pySim-shell.py index b48abc7..5281eab 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -41,6 +41,7 @@ import os import sys +import inspect from pathlib import Path from io import StringIO @@ -54,16 +55,11 @@ from pySim.utils import sanitize_pin_adm, tabulate_str_list, boxed_heading_str, Hexstr from pySim.card_handler import CardHandler, CardHandlerAuto -from pySim.filesystem import RuntimeState, CardDF, CardADF, CardModel +from pySim.filesystem import RuntimeState, CardDF, CardADF, CardModel, CardApplication from pySim.profile import CardProfile from pySim.cdma_ruim import CardProfileRUIM from pySim.ts_102_221 import CardProfileUICC from pySim.ts_102_222 import Ts102222Commands -from pySim.ts_31_102 import CardApplicationUSIM -from pySim.ts_31_103 import CardApplicationISIM -from pySim.ts_31_104 import CardApplicationHPSIM -from pySim.ara_m import CardApplicationARAM -from pySim.global_platform import CardApplicationISD from pySim.gsm_r import DF_EIRENE from pySim.cat import ProactiveCommand @@ -72,6 +68,15 @@ # calling of SysmocomSJA2.add_files. See CardModel.apply_matching_models import pySim.sysmocom_sja2 +# we need to import these modules so that the various sub-classes of +# CardProfile are created, which will be used in init_card() to iterate +# over all known CardProfile sub-classes. +import pySim.ts_31_102 +import pySim.ts_31_103 +import pySim.ts_31_104 +import pySim.ara_m +import pySim.global_platform + from pySim.card_key_provider import CardKeyProviderCsv, card_key_provider_register, card_key_provider_get_field @@ -116,17 +121,16 @@ print("Info: Card is of type: %s" % str(profile)) - # FIXME: This shouln't be here, the profile should add the applications, - # however, we cannot simply put his into ts_102_221.py since we would - # have to e.g. import CardApplicationUSIM from ts_31_102.py, which already - # imports from ts_102_221.py. This means we will end up with a circular - # import, which needs to be resolved first. + # FIXME: this shouldn't really be here but somewhere else/more generic. + # We cannot do it within pySim/profile.py as that would create circular + # dependencies between the individual profiles and profile.py. if isinstance(profile, CardProfileUICC): - profile.add_application(CardApplicationUSIM()) - profile.add_application(CardApplicationISIM()) - profile.add_application(CardApplicationHPSIM()) - profile.add_application(CardApplicationARAM()) - profile.add_application(CardApplicationISD()) + for app_cls in CardApplication.__subclasses__(): + constr_sig = inspect.signature(app_cls.__init__) + # skip any intermediary sub-classes such as CardApplicationSD + if len(constr_sig.parameters) != 1: + continue + profile.add_application(app_cls()) # We have chosen SimCard() above, but we now know it actually is an UICC # so it's safe to assume it supports USIM application (which we're adding above). # IF we don't do this, we will have a SimCard but try USIM specific commands like -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33700 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ia6918e49d73d80acfaf09506e604d4929d37f1b6 Gerrit-Change-Number: 33700 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: ts_102_221: Remove CardProfileUICCSIM
by laforge 18 Jul '23

18 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33724 ) Change subject: ts_102_221: Remove CardProfileUICCSIM ...................................................................... ts_102_221: Remove CardProfileUICCSIM This profile has always been a hack/work-around for the situation that a classic GSM SIM is not a UICC, and we didn't yet have the concept of CardProfileAddons yet, so there was no way to probe and add something to an UICC which was not an application with its own AID/ADF. Since now we have CardProfileAddons (including one for GSM SIM), and pySim-trace (the other user of CardProfileUICCSIM) has also switched over to using CardProfileUICC + addons, we can remove this work-around. Change-Id: I45cec68d72f2003123da4c3f86ed6a5a90988bd8 --- M pySim/ts_102_221.py 1 file changed, 18 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py index df8b842..ac0dc84 100644 --- a/pySim/ts_102_221.py +++ b/pySim/ts_102_221.py @@ -886,21 +886,3 @@ of the card is required between SUSPEND and RESUME, and only very few non-RESUME commands are permitted between SUSPEND and RESUME. See TS 102 221 Section 11.1.22.""" self._cmd.card._scc.resume_uicc(opts.token) - - -class CardProfileUICCSIM(CardProfileUICC): - """Same as above, but including 2G SIM support""" - - ORDER = 0 - - def __init__(self): - super().__init__('UICC-SIM') - - # Add GSM specific files - self.files_in_mf.append(DF_TELECOM()) - self.files_in_mf.append(DF_GSM()) - - @staticmethod - def match_with_card(scc: SimCardCommands) -> bool: - # don't ever select this profile, we only use this from pySim-trace - return False -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33724 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I45cec68d72f2003123da4c3f86ed6a5a90988bd8 Gerrit-Change-Number: 33724 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • ...
  • 306
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.