pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38925?usp=email )
Change subject: stream_cli: Move osmo_stream_cli_close() before osmo_stream_cli_reconnect()
......................................................................
stream_cli: Move osmo_stream_cli_close() before osmo_stream_cli_reconnect()
The reconnect function is also calling the disconnect_cb() callback
through making use of osmo_stream_cli_close().
Hence, put the close() function further up in the file following the
dependency chaing, allowing removal of an extra declaration.
It also helps in seeing the whole related code together.
Furthermore, those functions will be split in a follow-up commit into
private helper functions so the order will become more relevant due to
being static and not appearing in a header file.
Change-Id: Ib7a7655f6a8aa45793ad8a43961f161c74d22e33
---
M src/stream_cli.c
1 file changed, 39 insertions(+), 41 deletions(-)
Approvals:
Jenkins Builder: Verified
daniel: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/src/stream_cli.c b/src/stream_cli.c
index b7ca9fd..9fc8101 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -116,51 +116,10 @@
struct osmo_sock_init2_multiaddr_pars ma_pars;
};
-void osmo_stream_cli_close(struct osmo_stream_cli *cli);
-
/*! \addtogroup stream_cli
* @{
*/
-/*! Re-connect an Osmocom Stream Client.
- * If re-connection is enabled for this client
- * (which is the case unless negative timeout was explicitly set via osmo_stream_cli_set_reconnect_timeout() call),
- * we close any existing connection (if any) and schedule a re-connect timer */
-void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli)
-{
- osmo_stream_cli_close(cli);
-
- if (cli->reconnect_timeout < 0) {
- LOGSCLI(cli, LOGL_INFO, "not reconnecting, disabled\n");
- return;
- }
-
- cli->state = STREAM_CLI_STATE_WAIT_RECONNECT;
- LOGSCLI(cli, LOGL_INFO, "retrying reconnect in %d seconds...\n",
- cli->reconnect_timeout);
- osmo_timer_schedule(&cli->timer, cli->reconnect_timeout, 0);
-}
-
-/*! Check if Osmocom Stream Client is in connected state.
- * \param[in] cli Osmocom Stream Client
- * \return true if connected, false otherwise
- */
-bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli)
-{
- return cli->state == STREAM_CLI_STATE_CONNECTED;
-}
-
-/*! Check if Osmocom Stream Client is opened (has an FD available) according to
- * its current state.
- * \param[in] cli Osmocom Stream Client
- * \return true if fd is available (osmo_stream_cli_get_fd()), false otherwise
- */
-static bool stream_cli_is_opened(const struct osmo_stream_cli *cli)
-{
- return cli->state == STREAM_CLI_STATE_CONNECTING ||
- cli->state == STREAM_CLI_STATE_CONNECTED;
-}
-
static void stream_cli_close_iofd(struct osmo_stream_cli *cli)
{
if (!cli->iofd)
@@ -219,6 +178,45 @@
}
}
+/*! Re-connect an Osmocom Stream Client.
+ * If re-connection is enabled for this client
+ * (which is the case unless negative timeout was explicitly set via osmo_stream_cli_set_reconnect_timeout() call),
+ * we close any existing connection (if any) and schedule a re-connect timer */
+void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli)
+{
+ osmo_stream_cli_close(cli);
+
+ if (cli->reconnect_timeout < 0) {
+ LOGSCLI(cli, LOGL_INFO, "not reconnecting, disabled\n");
+ return;
+ }
+
+ cli->state = STREAM_CLI_STATE_WAIT_RECONNECT;
+ LOGSCLI(cli, LOGL_INFO, "retrying reconnect in %d seconds...\n",
+ cli->reconnect_timeout);
+ osmo_timer_schedule(&cli->timer, cli->reconnect_timeout, 0);
+}
+
+/*! Check if Osmocom Stream Client is in connected state.
+ * \param[in] cli Osmocom Stream Client
+ * \return true if connected, false otherwise
+ */
+bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli)
+{
+ return cli->state == STREAM_CLI_STATE_CONNECTED;
+}
+
+/*! Check if Osmocom Stream Client is opened (has an FD available) according to
+ * its current state.
+ * \param[in] cli Osmocom Stream Client
+ * \return true if fd is available (osmo_stream_cli_get_fd()), false otherwise
+ */
+static bool stream_cli_is_opened(const struct osmo_stream_cli *cli)
+{
+ return cli->state == STREAM_CLI_STATE_CONNECTING ||
+ cli->state == STREAM_CLI_STATE_CONNECTED;
+}
+
/*! Retrieve file descriptor of the stream client socket.
* \param[in] cli Stream Client of which we want to obtain the file descriptor
* \returns File descriptor or negative in case of error */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38925?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ib7a7655f6a8aa45793ad8a43961f161c74d22e33
Gerrit-Change-Number: 38925
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(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>
Attention is currently required from: pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38925?usp=email )
Change subject: stream_cli: Move osmo_stream_cli_close() before osmo_stream_cli_reconnect()
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38925?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ib7a7655f6a8aa45793ad8a43961f161c74d22e33
Gerrit-Change-Number: 38925
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Nov 2024 16:35:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: fixeria.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38882?usp=email )
Change subject: Osmocom_CTRL_Functions.ttcn: Use Misc_Helpers.f_shutdown() everywhere
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
File library/Osmocom_CTRL_Functions.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38882/comment/0fb3ea42_909e… :
PS2, Line 47: log2str
> I don't like using `f_shutdown()` for setting the testcase verdict, so no CR+1 from me, sorry.
What's the reason there? Because it gets in the way of searching for setverdict() in the code?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38882?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3b11a4dee35da89b2fec0cc66021dd57db04beb4
Gerrit-Change-Number: 38882
Gerrit-PatchSet: 2
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-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Nov 2024 16:34:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
lynxis lazus has abandoned this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/38940?usp=email )
Change subject: gmm: Fix reject small size RAU request
......................................................................
Abandoned
another great dup created by git-commit hook in combination gerrit not rejecting 2 change-ids.
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38940?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: abandon
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I7fbe0ecbc6bb0797188af0d73fff0052bcc32e39
Gerrit-Change-Number: 38940
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, laforge, pespin.
lynxis lazus has uploaded a new patch set (#2) to the change originally created by pespin. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/38834?usp=email )
The following approvals got outdated and were removed:
Code-Review+1 by fixeria, Code-Review+1 by laforge, Verified+1 by Jenkins Builder
Change subject: gmm: Fix reject small size RAU request
......................................................................
gmm: Fix reject small size RAU request
A RAU Request can actually be 14 bytes long:
"""
GSM A-I/F DTAP - Routing Area Update Request
Protocol Discriminator: GPRS mobility management messages (8)
.... 1000 = Protocol discriminator: GPRS mobility management messages (0x8)
0000 .... = Skip Indicator: No indication of selected PLMN (0)
DTAP GPRS Mobility Management Message Type: Routing Area Update Request (0x08)
Update Type
.... 0... = Follow-on request pending: False
.... .000 = Update type: RA updating (0)
Ciphering Key Sequence Number
0... .... = Spare bit(s): 0
.111 .... = key sequence: No key is available (MS to network) (7)
Routing Area Identification - Old routing area identification - RAI: 262-42-13135-0
Routing area identification: 262-42-13135-0
Mobile Country Code (MCC): Germany (262)
Mobile Network Code (MNC): Vodafone GmbH (42)
Location Area Code (LAC): 0x334f (13135)
Routing Area Code (RAC): 0x00 (0)
MS Radio Access Capability
Length: 4
MS RA capability 1
0001 .... = Access Technology Type: GSM E --note that GSM E covers GSM P (1)
.... 0001 111. .... = Length in bits: 0x0f (15)
...0 01.. RF Power Capability, GMSK Power Class: Not specified (1)
A5 Bits: Same values apply for parameters as in the immediately preceding Access capabilities field within this IE (0)
.... ...1 = Controlled early Classmark Sending: Implemented
0... .... = Pseudo Synchronisation: Not Present
.0.. .... = Voice Group Call Service: no VGCS capability or no notifications wanted
..0. .... = Voice Broadcast Service: no VBS capability or no notifications wanted
...1 .... = Multislot capability struct: Present
HSCSD multislot class: Bits are not available (0)
GPRS multislot class: Bits are not available (0)
SMS_VALUE (Switch-Measure-Switch): Bits are not available (0)
ECSD multislot class: Bits are not available (0)
EGPRS multislot class: Bits are not available (0)
DTM GPRS Multi Slot Class: Bits are not available (0)
"""
Change-Id: I49210a04b16e6e2fc9d799b99c2fa415f28ddbba
---
M src/sgsn/gprs_gmm_util.c
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/34/38834/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38834?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I49210a04b16e6e2fc9d799b99c2fa415f28ddbba
Gerrit-Change-Number: 38834
Gerrit-PatchSet: 2
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-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>