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

May 2023

  • 1 participants
  • 2583 discussions
[S] Change in osmocom-bb[master]: trxcon/l1sched: do not align Tx burst transmission
by laforge 30 May '23

30 May '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/33006 ) Change subject: trxcon/l1sched: do not align Tx burst transmission ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ia397cbe16f719729a814b7ef0b7035c7fe8ba165 Gerrit-Change-Number: 33006 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 30 May 2023 11:03:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bts[master]: HR1 codec: validate ToC header in RFC5993 RTP input
by laforge 30 May '23

30 May '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33081 ) Change subject: HR1 codec: validate ToC header in RFC5993 RTP input ...................................................................... HR1 codec: validate ToC header in RFC5993 RTP input osmo-bts-trx always accepted (and previously required) HR1 codec RTP input in RFC 5993 format; currently we accept this RTP format as input for all BTS models, but no longer require it. However, we have never applied any checks to this format's ToC header, even when we previously required it in osmo-bts-trx. Check this header and reject invalid payloads that just happen to have the same octet length as valid ones. Change-Id: If16d38641913bb46bcd7cc11685407ed17136bfe --- M src/common/rtp_input_preen.c 1 file changed, 31 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/src/common/rtp_input_preen.c b/src/common/rtp_input_preen.c index e5cef6f..dd526fd 100644 --- a/src/common/rtp_input_preen.c +++ b/src/common/rtp_input_preen.c @@ -89,6 +89,20 @@ /* RTP input matches our internal format - we are good */ return PL_DECISION_ACCEPT; case GSM_HR_BYTES_RTP_RFC5993: + /* Validate ToC octet: for payload of this length to be valid, + * the F bit must be 0 and the FT field must be either 0 (good + * speech) or 2 (good SID). */ + switch (rtp_pl[0] & 0xF0) { + case 0x00: + break; + case 0x20: + /* TODO (next patch): signal this SID to the + * fr_hr_efr_dtxd_input() handler in l1sap. */ + break; + default: + /* invalid payload */ + return PL_DECISION_DROP; + } /* Strip ToC octet, leaving only "pure" TS 101 318 payload. */ return PL_DECISION_STRIP_HDR_OCTET; default: -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: If16d38641913bb46bcd7cc11685407ed17136bfe Gerrit-Change-Number: 33081 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> 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
[M] Change in osmo-bts[master]: HR1 codec: act on SID indication in RFC5993 RTP input
by laforge 30 May '23

30 May '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33082 ) Change subject: HR1 codec: act on SID indication in RFC5993 RTP input ...................................................................... HR1 codec: act on SID indication in RFC5993 RTP input Suppose we receive RTP from the uplink of another BTS, and the UL-handling BTS has channel-decoded an HR1 frame which it deems (per GSM 06.41 section 6.1.1) to be a valid SID, even though it is not a perfect, error-free SID. How will this SID frame be represented in RFC 5993 transport? My reading of the RFC tells me that the UL-handling BTS will need to apply an operation like our osmo_hr_sid_reset() to the payload before sending it out in RTP - but because the text of the RFC does not explicitly address this scenario, others may have interpreted it differently. If we receive an RFC 5993 RTP payload in which FT is set to 2, indicating good SID, but the actual HR payload is not a perfect SID (the SID field is not all 1s), the only reasonable interpretation of such occurrence is that the sender of this payload was another BTS whose implementors interpreted the RFC as not requiring them to rejuvenate the SID codeword prior to RTP output. Therefore, let's treat such payloads as valid SID for our DTXd logic, and rejuvenate the SID codeword ourselves. Change-Id: Ife00de6220a8ca7cc180a61734497f1acb7f5b83 --- M include/osmo-bts/msg_utils.h M include/osmo-bts/rtp_input_preen.h M src/common/l1sap.c M src/common/rtp_input_preen.c 4 files changed, 52 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 7ddbe88..fb8e11a 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -22,6 +22,9 @@ /* Access 3rd part of msgb control buffer */ #define rtpmsg_ts(x) ((x)->cb[2]) +/* Access 4th part of msgb control buffer */ +#define rtpmsg_is_rfc5993_sid(x) ((x)->cb[3]) + /** * Classification of OML message. ETSI for plain GSM 12.21 * messages and IPA/Osmo for manufacturer messages. diff --git a/include/osmo-bts/rtp_input_preen.h b/include/osmo-bts/rtp_input_preen.h index 822ee4a..744ae2a 100644 --- a/include/osmo-bts/rtp_input_preen.h +++ b/include/osmo-bts/rtp_input_preen.h @@ -17,4 +17,4 @@ enum pl_input_decision rtp_payload_input_preen(struct gsm_lchan *lchan, const uint8_t *rtp_pl, - unsigned rtp_pl_len); + unsigned rtp_pl_len, bool *rfc5993_sid_flag); diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 75177a5..9d824e3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1314,9 +1314,17 @@ * directly coupled to the GSM 05.03 channel decoder, * and cannot be reconstructed downstream from frame * payload bits. The only kind of SID we can detect - * here is the perfect, error-free kind. */ - is_sid = osmo_hr_check_sid(msgb_l2(resp_msg), - msgb_l2len(resp_msg)); + * here is the perfect, error-free kind. However, + * if we received RFC 5993 payload and the sender + * told us it is valid SID, honor that indication + * and rejuvenate the SID codeword. */ + if (rtpmsg_is_rfc5993_sid(resp_msg)) { + is_sid = true; + osmo_hr_sid_reset(msgb_l2(resp_msg)); + } else { + is_sid = osmo_hr_check_sid(msgb_l2(resp_msg), + msgb_l2len(resp_msg)); + } } break; case GSM48_CMODE_SPEECH_EFR: @@ -2152,6 +2160,7 @@ { struct gsm_lchan *lchan = rs->priv; struct msgb *msg; + bool rfc5993_sid = false; /* if we're in loopback mode, we don't accept frames from the * RTP socket anymore */ @@ -2159,7 +2168,7 @@ return; /* initial preen */ - switch (rtp_payload_input_preen(lchan, rtp_pl, rtp_pl_len)) { + switch (rtp_payload_input_preen(lchan, rtp_pl, rtp_pl_len, &rfc5993_sid)) { case PL_DECISION_DROP: return; case PL_DECISION_ACCEPT: @@ -2184,6 +2193,8 @@ rtpmsg_seq(msg) = seq_number; /* Store RTP header Timestamp in control buffer */ rtpmsg_ts(msg) = timestamp; + /* Store RFC 5993 SID flag likewise */ + rtpmsg_is_rfc5993_sid(msg) = rfc5993_sid; /* make sure the queue doesn't get too long */ lchan_dl_tch_queue_enqueue(lchan, msg, 1); diff --git a/src/common/rtp_input_preen.c b/src/common/rtp_input_preen.c index dd526fd..c418e80 100644 --- a/src/common/rtp_input_preen.c +++ b/src/common/rtp_input_preen.c @@ -82,7 +82,8 @@ } static enum pl_input_decision -input_preen_hr(const uint8_t *rtp_pl, unsigned rtp_pl_len) +input_preen_hr(const uint8_t *rtp_pl, unsigned rtp_pl_len, + bool *rfc5993_sid_flag) { switch (rtp_pl_len) { case GSM_HR_BYTES: @@ -96,8 +97,7 @@ case 0x00: break; case 0x20: - /* TODO (next patch): signal this SID to the - * fr_hr_efr_dtxd_input() handler in l1sap. */ + *rfc5993_sid_flag = true; break; default: /* invalid payload */ @@ -113,7 +113,7 @@ enum pl_input_decision rtp_payload_input_preen(struct gsm_lchan *lchan, const uint8_t *rtp_pl, - unsigned rtp_pl_len) + unsigned rtp_pl_len, bool *rfc5993_sid_flag) { /* If rtp continuous-streaming is enabled, we shall emit RTP packets * with zero-length payloads as BFI markers. In a TrFO scenario such @@ -132,7 +132,7 @@ if (lchan->type == GSM_LCHAN_TCH_F) return input_preen_fr(rtp_pl, rtp_pl_len); else - return input_preen_hr(rtp_pl, rtp_pl_len); + return input_preen_hr(rtp_pl, rtp_pl_len, rfc5993_sid_flag); case GSM48_CMODE_SPEECH_EFR: return input_preen_efr(rtp_pl, rtp_pl_len); case GSM48_CMODE_SPEECH_AMR: -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33082 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ife00de6220a8ca7cc180a61734497f1acb7f5b83 Gerrit-Change-Number: 33082 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> 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
[M] Change in osmo-bts[master]: HR1 codec: act on SID indication in RFC5993 RTP input
by laforge 30 May '23

30 May '23
Attention is currently required from: falconia. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33082 ) Change subject: HR1 codec: act on SID indication in RFC5993 RTP input ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33082 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ife00de6220a8ca7cc180a61734497f1acb7f5b83 Gerrit-Change-Number: 33082 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Comment-Date: Tue, 30 May 2023 11:00:32 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bts[master]: HR1 codec: validate ToC header in RFC5993 RTP input
by laforge 30 May '23

30 May '23
Attention is currently required from: falconia. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33081 ) Change subject: HR1 codec: validate ToC header in RFC5993 RTP input ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: If16d38641913bb46bcd7cc11685407ed17136bfe Gerrit-Change-Number: 33081 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Comment-Date: Tue, 30 May 2023 11:00:06 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: osmo_io: Fix sending msgb structures
by laforge 30 May '23

30 May '23
Attention is currently required from: arehbein, daniel. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33084 ) Change subject: osmo_io: Fix sending msgb structures ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33084 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie2a9c93f820fa372a1d527c805fd0fe2cff0eb49 Gerrit-Change-Number: 33084 Gerrit-PatchSet: 2 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Tue, 30 May 2023 10:58:19 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmo-netif[arehbein/osmo_io_ipa]: stream: Add IPA send function/IPA-mode read to srv
by Jenkins Builder 30 May '23

30 May '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/32907 ) Change subject: stream: Add IPA send function/IPA-mode read to srv ...................................................................... Patch Set 3: (2 comments) File include/osmocom/netif/stream.h: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-7605): https://gerrit.osmocom.org/c/libosmo-netif/+/32907/comment/dabb1e4f_0b198775 PS3, Line 75: enum ipaccess_proto_ext pe, struct msgb *msg); code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-7605): https://gerrit.osmocom.org/c/libosmo-netif/+/32907/comment/92640130_f8d9df08 PS3, Line 75: enum ipaccess_proto_ext pe, struct msgb *msg); please, no spaces at the start of a line -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/32907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: arehbein/osmo_io_ipa Gerrit-Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529 Gerrit-Change-Number: 32907 Gerrit-PatchSet: 3 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Tue, 30 May 2023 10:56:52 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-netif[arehbein/osmo_io_ipa]: examples: Add extension header octet to example
by arehbein 30 May '23

30 May '23
arehbein has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/32908 ) Change subject: examples: Add extension header octet to example ...................................................................... examples: Add extension header octet to example Mainly to make data/packets look (pseudo-)correct in Wireshark Change-Id: I962b9edcba65cdc98da00d2f8753dc5acd481502 --- M examples/ipa-stream-client.c M src/stream.c 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/examples/ipa-stream-client.c b/examples/ipa-stream-client.c index 48421b7..c3bb2a3 100644 --- a/examples/ipa-stream-client.c +++ b/examples/ipa-stream-client.c @@ -74,7 +74,7 @@ char *ptr; int x; - msg = osmo_ipa_msg_alloc(0); + msg = osmo_ipa_msg_alloc(sizeof(struct ipa_head_ext)); if (msg == NULL) { LOGP(DLINP, LOGL_ERROR, "cannot alloc msg\n"); return -1; @@ -93,6 +93,7 @@ msg_sent->num = i; llist_add(&msg_sent->head, &msg_sent_list); + ipa_prepend_header_ext(msg, IPAC_PROTO_EXT_MGCP); osmo_ipa_msg_push_header(msg, IPAC_PROTO_OSMO); osmo_stream_cli_send(conn, msg); @@ -115,7 +116,7 @@ int num; struct msg_sent *cur, *tmp, *found = NULL; - num = ntohl(*((int *)(msg->data + sizeof(struct ipa_head)))); + num = ntohl(*((int *)(msg->data + sizeof(struct ipa_head) + sizeof(struct ipa_head_ext)))); LOGP(DLINP, LOGL_DEBUG, "received msg number %d\n", num); llist_for_each_entry_safe(cur, tmp, &msg_sent_list, head) { diff --git a/src/stream.c b/src/stream.c index 4e57e03..150b85f 100644 --- a/src/stream.c +++ b/src/stream.c @@ -688,8 +688,11 @@ case STREAM_CLI_STATE_CONNECTED: if (res == 0) osmo_stream_cli_reconnect(cli); - else if (cli->iofd_read_cb) + else if (cli->iofd_read_cb) { + // if (cli->stream_proto == OSMO_STREAM_IPAC) + // ipa_check_pull_headers( cli->iofd_read_cb(cli, msg); + } break; default: osmo_panic("osmo_stream_cli_write_cb() called with unexpected state %d\n", cli->state); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/32908 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: arehbein/osmo_io_ipa Gerrit-Change-Id: I962b9edcba65cdc98da00d2f8753dc5acd481502 Gerrit-Change-Number: 32908 Gerrit-PatchSet: 3 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmo-netif[arehbein/osmo_io_ipa]: stream: Move helper functions
by arehbein 30 May '23

30 May '23
arehbein has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/32974 ) Change subject: stream: Move helper functions ...................................................................... stream: Move helper functions Prepare for next commits Change-Id: I318965538e5329c44d0910694621b5e1f1db0626 --- M src/stream.c 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/stream.c b/src/stream.c index 150b85f..d1682c2 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1184,6 +1184,27 @@ osmo_stream_cli_open(cli); } +/* msgb_l1(msg) is expected to be set */ +static inline enum ipaccess_proto msg_get_ipa_proto(struct msgb *msg) +{ + struct ipa_head *ih = msgb_l1(msg); + OSMO_ASSERT(ih); + return ih->proto; +} + +/* msgb->l1h is expected to be set, msgb->l2h is expected to be set if + * we have IPAC_PROTO_OSMO specified in the header. + * Returns the protocol extension (enum ipaccess_proto) or -ENOPROTOOPT if + * we don't have IPAC_PROTO_OSMO specified in the IPA header */ +static inline int msg_get_ipa_proto_ext(struct msgb *msg) +{ + if (msg_get_ipa_proto(msg) != IPAC_PROTO_OSMO) + return -ENOPROTOOPT; + struct ipa_head_ext *ihe = msgb_l2(msg); + OSMO_ASSERT(ihe); + return ihe->proto; +} + /*! \brief Enqueue data to be sent via an Osmocom stream client * \param[in] cli Stream Client through which we want to send * \param[in] msg Message buffer to enqueue in transmit queue */ @@ -1937,27 +1958,6 @@ talloc_free(conn); } -/* msgb_l1(msg) is expected to be set */ -static inline enum ipaccess_proto msg_get_ipa_proto(struct msgb *msg) -{ - struct ipa_head *ih = msgb_l1(msg); - OSMO_ASSERT(ih); - return ih->proto; -} - -/* msgb->l1h is expected to be set, msgb->l2h is expected to be set if - * we have IPAC_PROTO_OSMO specified in the header. - * Returns the protocol extension (enum ipaccess_proto) or -ENOPROTOOPT if - * we don't have IPAC_PROTO_OSMO specified in the IPA header */ -static inline int msg_get_ipa_proto_ext(struct msgb *msg) -{ - if (msg_get_ipa_proto(msg) != IPAC_PROTO_OSMO) - return -ENOPROTOOPT; - struct ipa_head_ext *ihe = msgb_l2(msg); - OSMO_ASSERT(ihe); - return ihe->proto; -} - /*! \brief Enqueue IPA data to be sent via an Osmocom stream server * \param[in] conn Stream Server through which we want to send * \param[in] p Protocol transported by IPA. When set to IPAC_PROTO_UNSPECIFIED, the protocol will be -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/32974 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: arehbein/osmo_io_ipa Gerrit-Change-Id: I318965538e5329c44d0910694621b5e1f1db0626 Gerrit-Change-Number: 32974 Gerrit-PatchSet: 2 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[arehbein/osmo_io_ipa]: stream: Add IPA send function/IPA-mode read to cli
by arehbein 30 May '23

30 May '23
arehbein has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/32975 ) Change subject: stream: Add IPA send function/IPA-mode read to cli ...................................................................... stream: Add IPA send function/IPA-mode read to cli - Also: Adapt ipa-stream-client example to work alongside new change Related: OS#5753 Change-Id: I042700af6614dd1879514dca0482e05b5ff22cb7 --- M examples/ipa-stream-client.c M include/osmocom/netif/stream.h M src/stream.c 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/examples/ipa-stream-client.c b/examples/ipa-stream-client.c index c3bb2a3..6aa7d5f 100644 --- a/examples/ipa-stream-client.c +++ b/examples/ipa-stream-client.c @@ -93,10 +93,8 @@ msg_sent->num = i; llist_add(&msg_sent->head, &msg_sent_list); - ipa_prepend_header_ext(msg, IPAC_PROTO_EXT_MGCP); - osmo_ipa_msg_push_header(msg, IPAC_PROTO_OSMO); - - osmo_stream_cli_send(conn, msg); + osmo_stream_cli_send_ipa(conn, IPAC_PROTO_OSMO, + IPAC_PROTO_EXT_MGCP, msg); LOGP(DIPATEST, LOGL_DEBUG, "enqueueing msg %d of " "%d bytes to be sent\n", i, msg->len); @@ -106,7 +104,7 @@ static int read_cb(struct osmo_stream_cli *conn, struct msgb *msg) { - LOGP(DIPATEST, LOGL_DEBUG, "received message from stream (len=%d)\n", msgb_length(msg)); + LOGP(DIPATEST, LOGL_DEBUG, "received message from stream (payload len=%d)\n", msgb_length(msg)); if (osmo_ipa_process_msg(msg) < 0) { LOGP(DIPATEST, LOGL_ERROR, "bad IPA message\n"); @@ -116,7 +114,7 @@ int num; struct msg_sent *cur, *tmp, *found = NULL; - num = ntohl(*((int *)(msg->data + sizeof(struct ipa_head) + sizeof(struct ipa_head_ext)))); + num = ntohl(*((int *)(msg->data))); LOGP(DLINP, LOGL_DEBUG, "received msg number %d\n", num); llist_for_each_entry_safe(cur, tmp, &msg_sent_list, head) { diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index 16940dc..5c8cea3 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -113,6 +113,8 @@ void osmo_stream_cli_close(struct osmo_stream_cli *cli); void osmo_stream_cli_send(struct osmo_stream_cli *cli, struct msgb *msg); +void osmo_stream_cli_send_ipa(struct osmo_stream_cli *cli, int ipaccess_proto, + enum ipaccess_proto_ext pe, struct msgb *msg); int osmo_stream_cli_recv(struct osmo_stream_cli *cli, struct msgb *msg); void osmo_stream_cli_clear_tx_queue(struct osmo_stream_cli *cli); diff --git a/src/stream.c b/src/stream.c index d1682c2..00ea33d 100644 --- a/src/stream.c +++ b/src/stream.c @@ -689,8 +689,8 @@ if (res == 0) osmo_stream_cli_reconnect(cli); else if (cli->iofd_read_cb) { - // if (cli->stream_proto == OSMO_STREAM_IPAC) - // ipa_check_pull_headers( + if (cli->stream_proto == OSMO_STREAM_IPAC) + ipa_check_pull_headers(msg, cli); cli->iofd_read_cb(cli, msg); } break; @@ -868,7 +868,6 @@ client_ops.segmentation_cb = segmentation_cbs[osp]; osmo_iofd_set_ioops(cli->iofd, &client_ops); cli->flags |= OSMO_STREAM_CLI_F_RECONF; - osmo_iofd_set_ioops(cli->iofd, &osmo_stream_cli_ioops); } /*! \brief Set the socket type for the stream server link @@ -1207,6 +1206,25 @@ /*! \brief Enqueue data to be sent via an Osmocom stream client * \param[in] cli Stream Client through which we want to send + * \param[in] p Protocol transported by IPA. When set to IPAC_PROTO_UNSPECIFIED, the protocol will be + * read from the msgb structure's l1 and possibly l2 headers. + * \param[in] pe Ignored, unless p == IPAC_PROTO_OSMO, in which case this specifies the + * Osmocom protocol extension + * \param[in] msg Message buffer to enqueue in transmit queue */ +void osmo_stream_cli_send_ipa(struct osmo_stream_cli *cli, int ipaccess_proto, + enum ipaccess_proto_ext pe, struct msgb *msg) +{ + OSMO_ASSERT(msg); + if (ipaccess_proto == IPAC_PROTO_UNSPECIFIED) { + ipaccess_proto = msg_get_ipa_proto(msg); + pe = msg_get_ipa_proto_ext(msg); + } + ipa_push_headers(ipaccess_proto, pe, msg); + osmo_stream_cli_send(cli, msg); +} + +/*! \brief Enqueue data to be sent via an Osmocom stream client + * \param[in] cli Stream Client through which we want to send * \param[in] msg Message buffer to enqueue in transmit queue */ void osmo_stream_cli_send(struct osmo_stream_cli *cli, struct msgb *msg) { -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/32975 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: arehbein/osmo_io_ipa Gerrit-Change-Id: I042700af6614dd1879514dca0482e05b5ff22cb7 Gerrit-Change-Number: 32975 Gerrit-PatchSet: 2 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.