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

January 2023

  • 1 participants
  • 2205 discussions
Change in libosmo-netif[master]: osmo-amr-inspect: Improve robustness reading from stdin
by pespin 04 Jan '23

04 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30837 ) Change subject: osmo-amr-inspect: Improve robustness reading from stdin ...................................................................... osmo-amr-inspect: Improve robustness reading from stdin Fixes printing hexbuf which might not have been null-terminated. Related: SYS#6161 Fixes: Coverity CID#302068 Change-Id: I460f1deb7455b3b6a85a090bdcad8e21a883db68 --- M utils/osmo-amr-inspect.c 1 file changed, 11 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/utils/osmo-amr-inspect.c b/utils/osmo-amr-inspect.c index a677b56..dbf612d 100644 --- a/utils/osmo-amr-inspect.c +++ b/utils/osmo-amr-inspect.c @@ -241,26 +241,32 @@ static int read_stdin(void) { ssize_t rc; + size_t hex_buflen; char hex_buf[4096]; uint8_t buf[2048]; - rc = read(0, hex_buf, sizeof(hex_buf)); + rc = read(0, hex_buf, sizeof(hex_buf) - 1); if (rc < 0) { fprintf(stderr, "Failed reading stdin: %s\n", strerror(errno)); return -EIO; } - if (rc == sizeof(hex_buf)) { - fprintf(stderr, "Failed parsing (input too long)\n"); + hex_buflen = rc; + hex_buf[hex_buflen] = '\0'; + + if (hex_buflen == sizeof(hex_buf) - 1) { + fprintf(stderr, "Failed parsing (input too long > %lu): %s\n", hex_buflen, hex_buf); return -ENOMEM; } - rc = osmo_hexparse(hex_buf, buf, rc); + + rc = osmo_hexparse(hex_buf, buf, sizeof(buf)); if (rc < 0) { fprintf(stderr, "Failed parsing (hexparse error): %s\n", hex_buf); return -1; } if (rc < 2) { - fprintf(stderr, "Too short to be an AMR buffer (%ld bytes): %s\n", rc, buf); + fprintf(stderr, "Too short to be an AMR buffer (%ld bytes): %s\n", rc, hex_buf); return -1; } + inspect_amr(0, buf, rc); return 0; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I460f1deb7455b3b6a85a090bdcad8e21a883db68 Gerrit-Change-Number: 30837 Gerrit-PatchSet: 1 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
Change in osmo-bsc[master]: vty: Add check against sensible default value for Ny1
by pespin 04 Jan '23

04 Jan '23
Attention is currently required from: arehbein, neels, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30602 ) Change subject: vty: Add check against sensible default value for Ny1 ...................................................................... Patch Set 19: (1 comment) File src/osmo-bsc/bts.c: https://gerrit.osmocom.org/c/osmo-bsc/+/30602/comment/c64323ac_9e48d72d PS19, Line 1734: "Is: %lu Lowest recommendation: %lu\n", "Is: %lu, Lowest recommendation: %lu\n" (see extra comma) -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30602 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: If3f96a6bd4f9ae32b6421de43c1c5a5d64482089 Gerrit-Change-Number: 30602 Gerrit-PatchSet: 19 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 Jan 2023 18:51:34 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: vty: Add check against sensible default value for Ny1
by pespin 04 Jan '23

04 Jan '23
Attention is currently required from: arehbein, neels, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30602 ) Change subject: vty: Add check against sensible default value for Ny1 ...................................................................... Patch Set 19: (1 comment) File src/osmo-bsc/bts.c: https://gerrit.osmocom.org/c/osmo-bsc/+/30602/comment/e29debd5_ebb60d1c PS18, Line 1724: bool gsm_bts_check_ny1(struct gsm_bts *bts, unsigned int log_level) btw, I didn't notice before, but bts can probably be a const pointer here? -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30602 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: If3f96a6bd4f9ae32b6421de43c1c5a5d64482089 Gerrit-Change-Number: 30602 Gerrit-PatchSet: 19 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 Jan 2023 18:49:25 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: vty: Add check against sensible default value for Ny1
by pespin 04 Jan '23

04 Jan '23
Attention is currently required from: arehbein, neels, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30602 ) Change subject: vty: Add check against sensible default value for Ny1 ...................................................................... Patch Set 19: (1 comment) File src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c: https://gerrit.osmocom.org/c/osmo-bsc/+/30602/comment/06698cc0_42c2cd80 PS18, Line 95: gsm_bts_check_ny1(bts, LOGL_NOTICE); > This is the additional check during runtime (vs. […] We have plenty of error messages which doesn't exit the process. I think there's even "FATAL" loglevel but we seldomly use it? Just use ERROR in all places here and be fine with it. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30602 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: If3f96a6bd4f9ae32b6421de43c1c5a5d64482089 Gerrit-Change-Number: 30602 Gerrit-PatchSet: 19 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 Jan 2023 18:47:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmo-amr-inspect: Improve robustness reading from stdin
by fixeria 04 Jan '23

04 Jan '23
Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30837 ) Change subject: osmo-amr-inspect: Improve robustness reading from stdin ...................................................................... Patch Set 1: Code-Review+2 (1 comment) File utils/osmo-amr-inspect.c: https://gerrit.osmocom.org/c/libosmo-netif/+/30837/comment/d139cd1e_e27b8dbb PS1, Line 260: sizeof(buf > Yes, that was a bug before this change too, see API doc: […] I see, thanks for explaining. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I460f1deb7455b3b6a85a090bdcad8e21a883db68 Gerrit-Change-Number: 30837 Gerrit-PatchSet: 1 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-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 Jan 2023 18:27:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-sgsn[master]: Replace gprs_str_to_apn() with libosmocore API osmo_apn_from_str()
by pespin 04 Jan '23

04 Jan '23
Attention is currently required from: daniel. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30861 ) Change subject: Replace gprs_str_to_apn() with libosmocore API osmo_apn_from_str() ...................................................................... Patch Set 1: (1 comment) File tests/sgsn/sgsn_test.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/30861/comment/fe328c25_a1f7cb41 PS1, Line 40: #include <osmocom/sgsn/gprs_gmm_fsm.h> > This looks like an incomplete alphabetical sort (vty should go to the bottom, gsupclient in between […] Yes adding apn.h, but the whole block was so messed up that I moved stuff around. -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30861 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ibef55a648f2d58f4fdd24fa553efde530982af2d Gerrit-Change-Number: 30861 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 Jan 2023 18:25:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-sgsn[master]: Standarize lle and llme state enum & value_string
by pespin 04 Jan '23

04 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30856 ) Change subject: Standarize lle and llme state enum & value_string ...................................................................... Standarize lle and llme state enum & value_string Change-Id: Iaf102ce5ca60854fe7eb1af17c73a80e7c76181b --- M include/osmocom/sgsn/gprs_llc.h M src/sgsn/gprs_llc.c M src/sgsn/gprs_llc_vty.c 3 files changed, 13 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h index 7ba5510..32b16b0 100644 --- a/include/osmocom/sgsn/gprs_llc.h +++ b/include/osmocom/sgsn/gprs_llc.h @@ -90,6 +90,7 @@ GPRS_LLES_LOCAL_REL = 6, /* Local Release */ GPRS_LLES_TIMER_REC = 7, /* Timer Recovery */ }; +extern const struct value_string gprs_llc_lle_state_names[]; enum gprs_llc_llme_state { GPRS_LLMS_UNASSIGNED = 1, /* No TLLI yet */ diff --git a/src/sgsn/gprs_llc.c b/src/sgsn/gprs_llc.c index fda0319..612dbca 100644 --- a/src/sgsn/gprs_llc.c +++ b/src/sgsn/gprs_llc.c @@ -50,6 +50,17 @@ { 0, NULL } }; +const struct value_string gprs_llc_lle_state_names[] = { + { GPRS_LLES_UNASSIGNED, "TLLI Unassigned" }, + { GPRS_LLES_ASSIGNED_ADM, "TLLI Assigned" }, + { GPRS_LLES_LOCAL_EST, "Local Establishment" }, + { GPRS_LLES_REMOTE_EST, "Remote Establishment" }, + { GPRS_LLES_ABM, "Asynchronous Balanced Mode" }, + { GPRS_LLES_LOCAL_REL, "Local Release" }, + { GPRS_LLES_TIMER_REC, "Timer Recovery" }, + { 0, NULL } +}; + static struct gprs_llc_llme *llme_alloc(uint32_t tlli); static int gprs_llc_tx_xid(const struct gprs_llc_lle *lle, struct msgb *msg, int command); diff --git a/src/sgsn/gprs_llc_vty.c b/src/sgsn/gprs_llc_vty.c index 124daa3..4572f95 100644 --- a/src/sgsn/gprs_llc_vty.c +++ b/src/sgsn/gprs_llc_vty.c @@ -39,22 +39,11 @@ #include <osmocom/vty/vty.h> #include <osmocom/vty/command.h> -struct value_string gprs_llc_state_strs[] = { - { GPRS_LLES_UNASSIGNED, "TLLI Unassigned" }, - { GPRS_LLES_ASSIGNED_ADM, "TLLI Assigned" }, - { GPRS_LLES_LOCAL_EST, "Local Establishment" }, - { GPRS_LLES_REMOTE_EST, "Remote Establishment" }, - { GPRS_LLES_ABM, "Asynchronous Balanced Mode" }, - { GPRS_LLES_LOCAL_REL, "Local Release" }, - { GPRS_LLES_TIMER_REC, "Timer Recovery" }, - { 0, NULL } -}; - static void vty_dump_lle(struct vty *vty, struct gprs_llc_lle *lle) { struct gprs_llc_params *par = &lle->params; vty_out(vty, " SAPI %2u State %s VUsend=%u, VUrecv=%u", lle->sapi, - get_value_string(gprs_llc_state_strs, lle->state), + get_value_string(gprs_llc_lle_state_names, lle->state), lle->vu_send, lle->vu_recv); vty_out(vty, " Vsent=%u Vack=%u Vrecv=%u, RetransCtr=%u%s", lle->v_sent, lle->v_ack, lle->v_recv, -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30856 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iaf102ce5ca60854fe7eb1af17c73a80e7c76181b Gerrit-Change-Number: 30856 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
Change in osmo-sgsn[master]: Remove unused function gprs_parse_mi_tmsi()
by pespin 04 Jan '23

04 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30860 ) Change subject: Remove unused function gprs_parse_mi_tmsi() ...................................................................... Remove unused function gprs_parse_mi_tmsi() Change-Id: I6fb7688bf54c7ae3ca3e06bf3a1b729fa62d82f9 --- M include/osmocom/sgsn/gprs_utils.h M src/gprs/gprs_utils.c 2 files changed, 0 insertions(+), 14 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_utils.h b/include/osmocom/sgsn/gprs_utils.h index c05aca6..8a6731f 100644 --- a/include/osmocom/sgsn/gprs_utils.h +++ b/include/osmocom/sgsn/gprs_utils.h @@ -36,7 +36,6 @@ int gprs_is_mi_tmsi(const uint8_t *value, size_t value_len); int gprs_is_mi_imsi(const uint8_t *value, size_t value_len); -int gprs_parse_mi_tmsi(const uint8_t *value, size_t value_len, uint32_t *tmsi); void gprs_parse_tmsi(const uint8_t *value, uint32_t *tmsi); int gprs_ra_id_equals(const struct gprs_ra_id *id1, const struct gprs_ra_id *id2); diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c index 3eac330..9fddc73 100644 --- a/src/gprs/gprs_utils.c +++ b/src/gprs/gprs_utils.c @@ -116,19 +116,6 @@ return 1; } -int gprs_parse_mi_tmsi(const uint8_t *value, size_t value_len, uint32_t *tmsi) -{ - uint32_t tmsi_be; - - if (!gprs_is_mi_tmsi(value, value_len)) - return 0; - - memcpy(&tmsi_be, value + 1, sizeof(tmsi_be)); - - *tmsi = ntohl(tmsi_be); - return 1; -} - void gprs_parse_tmsi(const uint8_t *value, uint32_t *tmsi) { uint32_t tmsi_be; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I6fb7688bf54c7ae3ca3e06bf3a1b729fa62d82f9 Gerrit-Change-Number: 30860 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-sgsn[master]: cosmetic: gprs_llc_vty.c: Fix trailing whitespace
by pespin 04 Jan '23

04 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30854 ) Change subject: cosmetic: gprs_llc_vty.c: Fix trailing whitespace ...................................................................... cosmetic: gprs_llc_vty.c: Fix trailing whitespace Change-Id: I543fd784f7e1a0f7c82bd7c79e073104becc88da --- M src/sgsn/gprs_llc_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/src/sgsn/gprs_llc_vty.c b/src/sgsn/gprs_llc_vty.c index 418be83..24e404b 100644 --- a/src/sgsn/gprs_llc_vty.c +++ b/src/sgsn/gprs_llc_vty.c @@ -53,7 +53,7 @@ static void vty_dump_lle(struct vty *vty, struct gprs_llc_lle *lle) { struct gprs_llc_params *par = &lle->params; - vty_out(vty, " SAPI %2u State %s VUsend=%u, VUrecv=%u", lle->sapi, + vty_out(vty, " SAPI %2u State %s VUsend=%u, VUrecv=%u", lle->sapi, get_value_string(gprs_llc_state_strs, lle->state), lle->vu_send, lle->vu_recv); vty_out(vty, " Vsent=%u Vack=%u Vrecv=%u, RetransCtr=%u%s", -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30854 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I543fd784f7e1a0f7c82bd7c79e073104becc88da Gerrit-Change-Number: 30854 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-sgsn[master]: Move gprs_tmr_to_secs() to tests/gprs/gprs_test.c
by pespin 04 Jan '23

04 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30814 ) Change subject: Move gprs_tmr_to_secs() to tests/gprs/gprs_test.c ...................................................................... Move gprs_tmr_to_secs() to tests/gprs/gprs_test.c That function is only used in the test. Let's hence move the function to the same test file in order to simplify osmo-sgsn code. Change-Id: I69d80810362d75eb93974af34f61639514f99f8a --- M include/osmocom/sgsn/gprs_utils.h M src/gprs/gprs_utils.c M tests/gprs/gprs_test.c 3 files changed, 16 insertions(+), 17 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_utils.h b/include/osmocom/sgsn/gprs_utils.h index eacaec7..c05aca6 100644 --- a/include/osmocom/sgsn/gprs_utils.h +++ b/include/osmocom/sgsn/gprs_utils.h @@ -32,7 +32,6 @@ int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str); /* GSM 04.08, 10.5.7.3 GPRS Timer */ -int gprs_tmr_to_secs(uint8_t tmr); uint8_t gprs_secs_to_tmr_floor(int secs); int gprs_is_mi_tmsi(const uint8_t *value, size_t value_len); diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c index 632718a..3eac330 100644 --- a/src/gprs/gprs_utils.c +++ b/src/gprs/gprs_utils.c @@ -64,22 +64,6 @@ return len; } -/* GSM 04.08, 10.5.7.3 GPRS Timer */ -int gprs_tmr_to_secs(uint8_t tmr) -{ - switch (tmr & GPRS_TMR_UNIT_MASK) { - case GPRS_TMR_2SECONDS: - return 2 * (tmr & GPRS_TMR_FACT_MASK); - default: - case GPRS_TMR_MINUTE: - return 60 * (tmr & GPRS_TMR_FACT_MASK); - case GPRS_TMR_6MINUTE: - return 360 * (tmr & GPRS_TMR_FACT_MASK); - case GPRS_TMR_DEACTIVATED: - return -1; - } -} - /* This functions returns a tmr value such that * - f is monotonic * - f(s) <= s diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index 99e3ea5..89dac07 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -48,6 +48,22 @@ ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped } +/* GSM 04.08, 10.5.7.3 GPRS Timer */ +static int gprs_tmr_to_secs(uint8_t tmr) +{ + switch (tmr & GPRS_TMR_UNIT_MASK) { + case GPRS_TMR_2SECONDS: + return 2 * (tmr & GPRS_TMR_FACT_MASK); + default: + case GPRS_TMR_MINUTE: + return 60 * (tmr & GPRS_TMR_FACT_MASK); + case GPRS_TMR_6MINUTE: + return 360 * (tmr & GPRS_TMR_FACT_MASK); + case GPRS_TMR_DEACTIVATED: + return -1; + } +} + static void test_gprs_timer_enc_dec(void) { int i, u, secs, tmr; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30814 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I69d80810362d75eb93974af34f61639514f99f8a Gerrit-Change-Number: 30814 Gerrit-PatchSet: 1 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
  • ← Newer
  • 1
  • ...
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • ...
  • 221
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.