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

March 2023

  • 1 participants
  • 3642 discussions
[S] Change in libosmo-sccp[master]: fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask
by laforge 24 Mar '23

24 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/32035 ) Change subject: fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask ...................................................................... fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask In sccp_scoc_states, allow the state transitions present in S_WAIT_CONN_CONF's event handler function scoc_fsm_wait_conn_conf(), and thus fix handling of N-DISCONNECT while waiting for SCCP Conn Confirm. Fixes this error: DLSCCP ERROR SCCP-SCOC(1016){WAIT_CONN_CONF}: transition to state IDLE not permitted! (sccp_scoc.c:1213) S_WAIT_CONN_CONF happens when the caller sends an N-DISCONNECT during S_CONN_PEND_OUT -- that means, while we are waiting for a CC from the peer, the caller ends the conn. SCCP-SCOC still waits for the CC first. When S_WAIT_CONN_CONF expires, the intended path is state change to S_IDLE, which then deallocates the connection. Allow this state transition from S_WAIT_CONN_CONF to S_IDLE. When S_WAIT_CONN_CONF receives a CC, the intended path is to send a RELRE and state change to S_DISCONN_PEND. Allow this state transition from S_WAIT_CONN_CONF to S_DISCONN_PEND. Change-Id: I8145e53124cabd76bd2cee159ab01306a1afaa27 --- M src/sccp_scoc.c 1 file changed, 31 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index db1db23..c929ed6 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1468,6 +1468,8 @@ S(SCOC_E_CONN_TMR_EXP) | S(SCOC_E_RCOC_CREF_IND) | S(SCOC_E_RCOC_ROUT_FAIL_IND), + .out_state_mask = S(S_IDLE) | + S(S_DISCONN_PEND), }, }; -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/32035 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I8145e53124cabd76bd2cee159ab01306a1afaa27 Gerrit-Change-Number: 32035 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-sccp[master]: fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask
by laforge 24 Mar '23

24 Mar '23
Attention is currently required from: neels. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/32035 ) Change subject: fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/32035 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I8145e53124cabd76bd2cee159ab01306a1afaa27 Gerrit-Change-Number: 32035 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Mar 2023 09:15:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-hnbgw[master]: map_sccp: on timeout during WAIT_CC, send N-DISCONNECT to SCCP-SCOC
by fixeria 24 Mar '23

24 Mar '23
Attention is currently required from: neels. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32036 ) Change subject: map_sccp: on timeout during WAIT_CC, send N-DISCONNECT to SCCP-SCOC ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32036 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ie94fcee4e2507a55449050aab96307199aed99a2 Gerrit-Change-Number: 32036 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Mar 2023 07:31:47 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-sccp[master]: fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask
by fixeria 24 Mar '23

24 Mar '23
Attention is currently required from: neels. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/32035 ) Change subject: fix sccp_scoc state S_WAIT_CONN_CONF out_state_mask ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/32035 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I8145e53124cabd76bd2cee159ab01306a1afaa27 Gerrit-Change-Number: 32035 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Mar 2023 07:29:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: logging: test timestamp formats
by neels 24 Mar '23

24 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32044 ) Change subject: logging: test timestamp formats ...................................................................... logging: test timestamp formats Show what timestamp formats we currently feature. Upcoming patch Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 adds a new timestamp format. Change-Id: If3dbf3006a454d4e8a5c758e5c884e12c8bb1fc1 --- M tests/logging/logging_vty_test.c M tests/logging/logging_vty_test.vty 2 files changed, 49 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/32044/1 diff --git a/tests/logging/logging_vty_test.c b/tests/logging/logging_vty_test.c index 15f7fc2..034ed40 100644 --- a/tests/logging/logging_vty_test.c +++ b/tests/logging/logging_vty_test.c @@ -25,6 +25,7 @@ #include <osmocom/core/logging.h> #include <osmocom/core/utils.h> #include <osmocom/core/application.h> +#include <osmocom/core/timer.h> #include <osmocom/vty/command.h> #include <osmocom/vty/logging.h> @@ -78,9 +79,18 @@ return CMD_SUCCESS; } +DEFUN(log_test, log_test_cmd, + "log-test", + "Log one DEBUG on category 'aa'\n") +{ + LOGP(DAA, LOGL_DEBUG, ":)\n"); + return CMD_SUCCESS; +} + static void vty_commands_init(void) { install_element_ve(&log_sweep_cmd); + install_element_ve(&log_test_cmd); } static const struct log_info_cat default_categories[] = { @@ -280,6 +290,9 @@ } } + osmo_gettimeofday_override = true; + osmo_gettimeofday_override_time = (struct timeval){ 306968100, 423423423 }; + while (!quit) { log_reset_context(); osmo_select_main(0); diff --git a/tests/logging/logging_vty_test.vty b/tests/logging/logging_vty_test.vty index b9afc04..da950f2 100644 --- a/tests/logging/logging_vty_test.vty +++ b/tests/logging/logging_vty_test.vty @@ -208,6 +208,29 @@ logging_vty_test(config)# no log stderr logging_vty_test(config)# exit +logging_vty_test# logging timezone utc + +logging_vty_test# logging timestamp 1 +logging_vty_test# log-test +Sun Sep 23 20:55:00 1979 DAA DEBUG :) + +logging_vty_test# logging print extended-timestamp 1 +logging_vty_test# log-test +19790923205500423423 DAA DEBUG :) + +logging_vty_test# logging timestamp 0 +logging_vty_test# log-test +19790923205500423423 DAA DEBUG :) + +logging_vty_test# logging timestamp 1 +logging_vty_test# logging print extended-timestamp 0 +logging_vty_test# log-test +Sun Sep 23 20:55:00 1979 DAA DEBUG :) + +logging_vty_test# logging timestamp 0 +logging_vty_test# log-test +DAA DEBUG :) + logging_vty_test# log-sweep DAA DEBUG Log message for DAA on level LOGL_DEBUG DAA INFO Log message for DAA on level LOGL_INFO -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32044 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: If3dbf3006a454d4e8a5c758e5c884e12c8bb1fc1 Gerrit-Change-Number: 32044 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: logging vty: probe 'print' and 'logging timestamp' cmds
by neels 24 Mar '23

24 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32042 ) Change subject: logging vty: probe 'print' and 'logging timestamp' cmds ...................................................................... logging vty: probe 'print' and 'logging timestamp' cmds Upcoming patch I58c792dda3cbcf8618648ba4429c27fa398a9e15 aims to change the timestamp configuration. Show current state before these changes. Change-Id: I8e0a373496130004e453a2044c1091665fe02a05 --- M tests/logging/logging_vty_test.vty 1 file changed, 108 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/32042/1 diff --git a/tests/logging/logging_vty_test.vty b/tests/logging/logging_vty_test.vty index 2cff62c..f9b4e01 100644 --- a/tests/logging/logging_vty_test.vty +++ b/tests/logging/logging_vty_test.vty @@ -70,6 +70,10 @@ set-log-mask Set the logmask of this logging target level Set the log level for a specified category +logging_vty_test# logging timestamp ? + 0 Don't prefix each log message + 1 Prefix each log message with current timestamp + logging_vty_test# logging level ? ... ! all aa Antropomorphic Armadillos (AA) @@ -109,6 +113,98 @@ error Log error messages and higher levels fatal Log only fatal messages +logging_vty_test# logging print ? + extended-timestamp Configure log message timestamping + thread-id Configure log message logging Thread ID + category Configure log message + category-hex Configure log message + level Configure log message + file Configure log message + +logging_vty_test# logging print extended-timestamp ? + 0 Don't prefix each log message + 1 Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn + +logging_vty_test# logging print thread-id ? + 0 Don't prefix each log message + 1 Prefix each log message with current Thread ID + +logging_vty_test# logging print category ? + 0 Don't prefix each log message + 1 Prefix each log message with category/subsystem name + +logging_vty_test# logging print category-hex ? + 0 Don't prefix each log message + 1 Prefix each log message with category/subsystem nr in hex ('<000b>') + +logging_vty_test# logging print level ? + 0 Don't prefix each log message + 1 Prefix each log message with the log level name + +logging_vty_test# logging print file ? + 0 Don't prefix each log message + 1 Prefix each log message with the source file and line + basename Prefix each log message with the source file's basename (strip leading paths) and line + +logging_vty_test# logging print file basename ? + [last] Log source file info at the end of a log line. If omitted, log source file info just before the log text. + +logging_vty_test# configure terminal +logging_vty_test(config)# log stderr +logging_vty_test(config-log)# show running-config +... +log stderr +... !timestamp + logging timestamp 0 +... !timestamp + +logging_vty_test(config-log)# logging timestamp 1 +logging_vty_test(config-log)# show running-config +... +log stderr +... !timestamp + logging timestamp 1 +... !timestamp + +logging_vty_test(config-log)# ### with 'extended-timestamp 1', 'logging timestamp' is not shown +logging_vty_test(config-log)# logging print extended-timestamp 1 +logging_vty_test(config-log)# show running-config +... +log stderr +... !timestamp + logging print extended-timestamp 1 +... !timestamp + +logging_vty_test(config-log)# ### 'logging timestamp 0' effect not shown while 'extended-timestamp' == 1 +logging_vty_test(config-log)# logging timestamp 0 +logging_vty_test(config-log)# show running-config +... +log stderr +... !timestamp + logging print extended-timestamp 1 +... !timestamp + +logging_vty_test(config-log)# ### 'logging timestamp 1' remains set upon 'extended-timestamp 0' +logging_vty_test(config-log)# logging timestamp 1 +logging_vty_test(config-log)# logging print extended-timestamp 0 +logging_vty_test(config-log)# show running-config +... +log stderr +... !timestamp + logging timestamp 1 +... !timestamp + +logging_vty_test(config-log)# logging timestamp 0 +logging_vty_test(config-log)# show running-config +... +log stderr +... !timestamp + logging timestamp 0 +... !timestamp + +logging_vty_test(config-log)# exit +logging_vty_test(config)# no log stderr +logging_vty_test(config)# exit logging_vty_test# log-sweep DAA DEBUG Log message for DAA on level LOGL_DEBUG -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32042 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I8e0a373496130004e453a2044c1091665fe02a05 Gerrit-Change-Number: 32042 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: logging_vty.c: rename static function
by neels 24 Mar '23

24 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32045 ) Change subject: logging_vty.c: rename static function ...................................................................... logging_vty.c: rename static function Rename 'logging_prnt_timestamp_cmd' to logging_timestamp_cmd to better match its VTY name: 'logging timestamp (0|1)' (An actual 'logging print timestamp' command will be added in subsequent patch I58c792dda3cbcf8618648ba4429c27fa398a9e15, so clarify.) Change-Id: I5a651e393bd438ea236659ed2c86188a8f9885d1 --- M src/vty/logging_vty.c 1 file changed, 21 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/32045/1 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 26b8844..8d046a0 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -206,8 +206,8 @@ RET_WITH_UNLOCK(CMD_SUCCESS); } -DEFUN(logging_prnt_timestamp, - logging_prnt_timestamp_cmd, +DEFUN(logging_timestamp, + logging_timestamp_cmd, "logging timestamp (0|1)", LOGGING_STR "Configure log message timestamping\n" "Don't prefix each log message\n" @@ -1218,7 +1218,7 @@ install_lib_element_ve(&disable_logging_cmd); install_lib_element_ve(&logging_fltr_all_cmd); install_lib_element_ve(&logging_use_clr_cmd); - install_lib_element_ve(&logging_prnt_timestamp_cmd); + install_lib_element_ve(&logging_timestamp_cmd); install_lib_element_ve(&logging_prnt_ext_timestamp_cmd); install_lib_element_ve(&logging_timezone_cmd); install_lib_element_ve(&logging_prnt_tid_cmd); @@ -1254,7 +1254,7 @@ install_node(&cfg_log_node, config_write_log); install_lib_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_lib_element(CFG_LOG_NODE, &logging_use_clr_cmd); - install_lib_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); + install_lib_element(CFG_LOG_NODE, &logging_timestamp_cmd); install_lib_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_lib_element(CFG_LOG_NODE, &logging_timezone_cmd); install_lib_element(CFG_LOG_NODE, &logging_prnt_tid_cmd); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32045 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I5a651e393bd438ea236659ed2c86188a8f9885d1 Gerrit-Change-Number: 32045 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: logging: add 'logging timezone (localtime|utc)'
by neels 24 Mar '23

24 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32043 ) Change subject: logging: add 'logging timezone (localtime|utc)' ...................................................................... logging: add 'logging timezone (localtime|utc)' Add ability to print logging timestamps in UTC. I want to test logging timestamps in vty transcript tests. To get deterministic epoch timestamps, I can use osmo_gettimeofday_override(). However, so far we log in the server's local time zone: the dates printed after osmo_gettimeofday_override() still change according to the locally configured timezone -- not good for regression testing. For UTC, it is always the same. The intended use is for regression testing of timestamps, but maybe logging in UTC may be useful to some user out there, too. Change-Id: I7f868b47bf8f8dfcf85e735f490ae69b18111af4 --- M configure.ac M include/osmocom/core/logging.h M src/core/libosmocore.map M src/core/logging.c M src/vty/logging_vty.c M tests/logging/logging_vty_test.vty 6 files changed, 88 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/32043/1 diff --git a/configure.ac b/configure.ac index 5e17c7a..861b7b0 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,7 @@ AC_SUBST(SYMBOL_VISIBILITY) AC_CHECK_FUNCS(localtime_r) +AC_CHECK_FUNCS(gmtime_r) AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ AC_CACHE_CHECK( diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 755564d..c12aaeb 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -295,6 +295,11 @@ LOG_FILENAME_POS_LINE_END, }; +enum log_timezone { + LOG_TIMEZONE_LOCALTIME, + LOG_TIMEZONE_UTC, +}; + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ @@ -391,6 +396,10 @@ enum log_filename_type print_filename2; /* Where on a log line to put the source file info. */ enum log_filename_pos print_filename_pos; + + /* Set timezone for logging of timestamps: 0 for local time, 1 for UTC. Other values are reserved for future + * use. */ + enum log_timezone timezone; }; /* use the above macros */ @@ -412,6 +421,7 @@ void log_set_use_color(struct log_target *target, int); void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); +void log_set_timezone(struct log_target *target, enum log_timezone timezone); void log_set_print_tid(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int) OSMO_DEPRECATED("Use log_set_print_filename2() instead"); void log_set_print_filename2(struct log_target *target, enum log_filename_type lft); diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map index bd1b3d9..642077f 100644 --- a/src/core/libosmocore.map +++ b/src/core/libosmocore.map @@ -83,6 +83,7 @@ log_set_print_tid; log_set_print_timestamp; log_set_use_color; +log_set_timezone; log_target_create; log_target_create_file; log_target_create_file_stream; diff --git a/src/core/logging.c b/src/core/logging.c index 3095f0d..757333d 100644 --- a/src/core/logging.c +++ b/src/core/logging.c @@ -464,6 +464,27 @@ return bn + 1; } +static int get_timestamp(struct timeval *tv, struct tm *tm, const struct log_target *target) +{ + osmo_gettimeofday(tv, NULL); + switch (target->timezone) { + case LOG_TIMEZONE_LOCALTIME: +#ifdef HAVE_LOCALTIME_R + localtime_r(&tv->tv_sec, tm); + return 0; +#endif + /* If there is no localtime_r() function, then maybe gmtime_r() is available instead? */ + case LOG_TIMEZONE_UTC: +#ifdef HAVE_GMTIME_R + gmtime_r(&tv->tv_sec, tm); + return 0; +#endif + /* If there is no gmtime_r() function, then print no timestamp. */ + default: + return -1; + } +} + /*! main output formatting function for log lines. * \param[out] buf caller-allocated output buffer for the generated string * \param[in] buf_len number of bytes available in buf @@ -494,12 +515,9 @@ } } if (!cont) { - if (target->print_ext_timestamp) { -#ifdef HAVE_LOCALTIME_R - struct tm tm; - struct timeval tv; - osmo_gettimeofday(&tv, NULL); - localtime_r(&tv.tv_sec, &tm); + struct timeval tv; + struct tm tm; + if (target->print_ext_timestamp && get_timestamp(&tv, &tm, target) == 0) { ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d%03d ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, @@ -507,14 +525,10 @@ if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -#endif - } else if (target->print_timestamp) { - time_t tm; - if ((tm = time(NULL)) == (time_t) -1) - goto err; + } else if (target->print_timestamp && get_timestamp(&tv, &tm, target) == 0) { /* Get human-readable representation of time. man ctime: we need at least 26 bytes in buf */ - if (rem < 26 || !ctime_r(&tm, buf + offset)) + if (rem < 26 || !asctime_r(&tm, buf + offset)) goto err; ret = strlen(buf + offset); if (ret <= 0) @@ -851,6 +865,15 @@ target->print_timestamp = print_timestamp; } +/*! Switch logging timezone between UTC or local time. + * \param[in] target Log target to be affected. + * \param[in] timezone Timezone to set. + */ +void log_set_timezone(struct log_target *target, enum log_timezone timezone) +{ + target->timezone = timezone; +} + /*! Enable or disable printing of extended timestamps while logging * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 2a07422..26b8844 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -190,6 +190,22 @@ RET_WITH_UNLOCK(CMD_SUCCESS); } +DEFUN(logging_prnt_timezone, + logging_timezone_cmd, + "logging timezone (localtime|utc)", + LOGGING_STR "Configure time zone for log message timestamping\n" + "Log timestamps in the system's local time\n" + "Log timestamps in Coordinated Universal Time (UTC)\n") +{ + struct log_target *tgt; + ACQUIRE_VTY_LOG_TGT_WITH_LOCK(vty, tgt); + if (strcmp(argv[0], "utc") == 0) + log_set_timezone(tgt, LOG_TIMEZONE_UTC); + else + log_set_timezone(tgt, LOG_TIMEZONE_LOCALTIME); + RET_WITH_UNLOCK(CMD_SUCCESS); +} + DEFUN(logging_prnt_timestamp, logging_prnt_timestamp_cmd, "logging timestamp (0|1)", @@ -1204,6 +1220,7 @@ install_lib_element_ve(&logging_use_clr_cmd); install_lib_element_ve(&logging_prnt_timestamp_cmd); install_lib_element_ve(&logging_prnt_ext_timestamp_cmd); + install_lib_element_ve(&logging_timezone_cmd); install_lib_element_ve(&logging_prnt_tid_cmd); install_lib_element_ve(&logging_prnt_cat_cmd); install_lib_element_ve(&logging_prnt_cat_hex_cmd); @@ -1239,6 +1256,7 @@ install_lib_element(CFG_LOG_NODE, &logging_use_clr_cmd); install_lib_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_lib_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); + install_lib_element(CFG_LOG_NODE, &logging_timezone_cmd); install_lib_element(CFG_LOG_NODE, &logging_prnt_tid_cmd); install_lib_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); install_lib_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); diff --git a/tests/logging/logging_vty_test.vty b/tests/logging/logging_vty_test.vty index f9b4e01..b9afc04 100644 --- a/tests/logging/logging_vty_test.vty +++ b/tests/logging/logging_vty_test.vty @@ -48,6 +48,7 @@ logging color (0|1) logging timestamp (0|1) logging print extended-timestamp (0|1) + logging timezone (localtime|utc) logging print thread-id (0|1) logging print category (0|1) logging print category-hex (0|1) @@ -67,6 +68,7 @@ color Configure color-printing for log messages timestamp Configure log message timestamping print Log output settings + timezone Configure time zone for log message timestamping set-log-mask Set the logmask of this logging target level Set the log level for a specified category -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32043 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I7f868b47bf8f8dfcf85e735f490ae69b18111af4 Gerrit-Change-Number: 32043 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: hnbgw: add f_rua_expect()
by neels 24 Mar '23

24 Mar '23
Attention is currently required from: laforge, pespin. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765 ) Change subject: hnbgw: add f_rua_expect() ...................................................................... Patch Set 2: (1 comment) Patchset: PS1: > > An altstep cannot have a return value […] The deeper point is that i don't really want to have an altstep that can be integrated into other altsteps, I want these functions to specifically expect a given message within a limited time, so that i get nicer test failure logging without the need to search far and wide which message may have gone missing. For this, a function is better suited than an altstep. If we ever need altsteps too, then we can find a nifty way to reduce code dup, but so far i only want those parts for which functions are suited well. (altstep inout parameters have nontrivial limitations on the scoping.) (i don't want to have to start a timer externally whenever calling f_rua_expect(), i want a convenient implicit timer) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31765 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: I29e6b7659ba53efee9f676197b502f79780ead7e Gerrit-Change-Number: 31765 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Mar 2023 03:57:27 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-msc[master]: [codecs filter] use filter result in MT DTAP CC Setup
by neels 24 Mar '23

24 Mar '23
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/31697 ) ( 6 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: [codecs filter] use filter result in MT DTAP CC Setup ...................................................................... [codecs filter] use filter result in MT DTAP CC Setup So far, we just forwarded the Bearer Capabilities received in MNCC from the remote MO call leg, and omitted Bearer Cap if the remote call leg did not provide any. Instead, always include Bearer Cap, and compose it from the codecs filter result. Hence the Bearer Cap is now an intersection of MS, BSS and remote call leg, instead of just the remote call leg. Related: SYS#5066 Change-Id: I9586221ef56352b7ce4b2604ae0dc04554145a78 --- M src/libmsc/gsm_04_08_cc.c M tests/msc_vlr/msc_vlr_test_call.c M tests/msc_vlr/msc_vlr_test_call.err 3 files changed, 58 insertions(+), 12 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 269fd57..f0aca9c 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -695,6 +695,7 @@ struct gsm48_hdr *gh; struct gsm_mncc *setup = arg; int rc, trans_id; + struct gsm_mncc_bearer_cap bearer_cap; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); @@ -759,15 +760,42 @@ codec_filter_run(&trans->cc.codecs); LOG_TRANS(trans, LOGL_DEBUG, "codecs: %s\n", codec_filter_to_str(&trans->cc.codecs)); - /* NEAR FUTURE: upcoming patch will use the codecs filter to determine the Bearer Cap to send to the MS. - * So far just gathering information in the new codecs filter. */ - /* bearer capability */ - if (setup->fields & MNCC_F_BEARER_CAP) { - /* Create a copy of the bearer capability in the transaction struct, so we - * can use this information later */ - memcpy(&trans->bearer_cap, &setup->bearer_cap, sizeof(trans->bearer_cap)); - gsm48_encode_bearer_cap(msg, 0, &setup->bearer_cap); + /* Compose Bearer Capability information that reflects only the codecs (Speech Versions) remaining after + * intersecting MS, BSS and remote call leg restrictions. To store in trans for later use, and to include in + * the outgoing CC Setup message. */ + bearer_cap = (struct gsm_mncc_bearer_cap){ + .speech_ver = { -1 }, + }; + sdp_audio_codecs_to_bearer_cap(&bearer_cap, &trans->cc.codecs.result.audio_codecs); + rc = bearer_cap_set_radio(&bearer_cap); + if (rc) { + LOG_TRANS(trans, LOGL_ERROR, "Error composing Bearer Capability for CC Setup\n"); + trans_free(trans); + msgb_free(msg); + return rc; } + /* Create a copy of the bearer capability in the transaction struct, so we can use this information later */ + /* TODO: we should be able to drop trans->bearer_cap, replaced by the codecs filter. Verify this. + * So far let's just store it there like previous code did. */ + trans->bearer_cap = bearer_cap; + /* If no resulting codecs remain, error out. We cannot find a codec that matches both call legs. If the MGW were + * able to transcode, we could use non-identical codecs on each conn of the MGW endpoint, but we are aiming for + * finding a matching codec. */ + if (bearer_cap.speech_ver[0] == -1) { + LOG_TRANS(trans, LOGL_ERROR, "%s: no codec match possible: %s\n", + get_mncc_name(setup->msg_type), codec_filter_to_str(&trans->cc.codecs)); + + /* incompatible codecs */ + rc = mncc_release_ind(trans->net, trans, trans->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_INCOMPAT_DEST /* TODO: correct cause code? */); + trans->callref = 0; + trans_free(trans); + msgb_free(msg); + return rc; + } + gsm48_encode_bearer_cap(msg, 0, &bearer_cap); + /* facility */ if (setup->fields & MNCC_F_FACILITY) gsm48_encode_facility(msg, 0, &setup->facility); diff --git a/tests/msc_vlr/msc_vlr_test_call.c b/tests/msc_vlr/msc_vlr_test_call.c index 06602f7..6c7a8ad 100644 --- a/tests/msc_vlr/msc_vlr_test_call.c +++ b/tests/msc_vlr/msc_vlr_test_call.c @@ -316,7 +316,7 @@ VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); btw("MS sends SecurityModeControl acceptance, VLR accepts, sends CC Setup"); - dtap_expect_tx("0305" /* CC: Setup */); + dtap_expect_tx("0305" /* CC: Setup */ "04 07 60 04 05 0b 06 08 87" /* Bearer Cap */); ms_sends_security_mode_complete(1); btw("MS confirms call, we create a RAN-side RTP and forward MNCC_CALL_CONF_IND"); @@ -419,7 +419,7 @@ VERBOSE_ASSERT(security_mode_ctrl_sent, == true, "%d"); btw("MS sends SecurityModeControl acceptance, VLR accepts, sends CC Setup"); - dtap_expect_tx("0305" /* CC: Setup */); + dtap_expect_tx("0305" /* CC: Setup */ "04 07 60 04 05 0b 06 08 87" /* Bearer Cap */); ms_sends_security_mode_complete(1); btw("MS confirms call, we create a RAN-side RTP and forward MNCC_CALL_CONF_IND"); diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index d97806d..e1d2f4d 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -761,7 +761,7 @@ DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT DIUCS msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: Sending DTAP: CC GSM48_MT_CC_SETUP DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: RAN encode: DTAP on UTRAN-Iu -- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 0305 +- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 030504076004050b060887 - DTAP matches expected message DMSC dummy_msc_i(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){0}: Received Event MSC_I_EV_FROM_A_FORWARD_ACCESS_SIGNALLING_REQUEST DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - Paging: now used by 3 (attached,CC,active-conn) @@ -1230,7 +1230,7 @@ DCC trans(CC:NULL IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT DIUCS msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: Sending DTAP: CC GSM48_MT_CC_SETUP DMSC msc_a(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){MSC_A_ST_COMMUNICATING}: RAN encode: DTAP on UTRAN-Iu -- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 0305 +- DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 030504076004050b060887 - DTAP matches expected message DMSC dummy_msc_i(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu:PAGING_RESP){0}: Received Event MSC_I_EV_FROM_A_FORWARD_ACCESS_SIGNALLING_REQUEST DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - Paging: now used by 3 (attached,CC,active-conn) -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/31697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I9586221ef56352b7ce4b2604ae0dc04554145a78 Gerrit-Change-Number: 31697 Gerrit-PatchSet: 8 Gerrit-Owner: neels <nhofmeyr(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
  • ← Newer
  • 1
  • ...
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • ...
  • 365
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.