Attention is currently required from: neels.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39248?usp=email )
Change subject: mgw: Decouple SDP parsing step from conn obj update
......................................................................
Patch Set 3:
(3 comments)
File include/osmocom/mgcp/mgcp_protocol.h:
https://gerrit.osmocom.org/c/osmo-mgw/+/39248/comment/30f2ff15_0ee7efcd?usp… :
PS3, Line 13: #define MGCP_PARSE_SDP_MAXPTIME_UNSET (-1)
> duplicate -1
It's not duplicate, it's two different fields.
https://gerrit.osmocom.org/c/osmo-mgw/+/39248/comment/8c2af996_f6210744?usp… :
PS3, Line 14: #define MGCP_PARSE_SDP_RTP_PORT_UNSET (0)
> (i prefer enums)
It's not a closed set of values, but a specific value in an int range, it's fine as a define.
File src/libosmo-mgcp/mgcp_protocol.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39248/comment/025b22e4_0b6d85b1?usp… :
PS3, Line 1139: if (rc < 0) { /* See also RFC 3661: Protocol error */
> (comments deserve their own separate line plz)
I'm actually fine with it the current way, but changing in to avoid discussions.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39248?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I4a2aecb542886672c1f586c6607714e0356abe35
Gerrit-Change-Number: 39248
Gerrit-PatchSet: 3
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-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 15 Jan 2025 17:36:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: daniel, neels.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39239?usp=email )
Change subject: mgw: MDCX: Split mgcp header pars parsing into a previous step
......................................................................
Patch Set 4:
(1 comment)
File src/libosmo-mgcp/mgcp_protocol.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39239/comment/b3b90472_372b7ffb?usp… :
PS4, Line 1115: /* Reset conn mode in case it was tweaked through VTY: */
> erm having trouble imagining how vty can tweak an incoming MDCX message... […]
Yeah, something else which kinda sucks a bit:
$ ag "\->mode" | grep vty
src/libosmo-mgcp/mgcp_vty.c:1374: conn->mode = MGCP_CONN_LOOPBACK;
src/libosmo-mgcp/mgcp_vty.c:1376: conn->mode = conn->mode_orig;
See VTY command "loop-endpoint <0-64> NAME (0|1)".
Again, something I cannot really solve/improve in this patch, too many refactoring already.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39239?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I6ecb41fc2cc737c3a161b6bc98bd08ae01909655
Gerrit-Change-Number: 39239
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 15 Jan 2025 17:33:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: laforge, neels.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39224?usp=email )
Change subject: mgw: CRCX: Split mgcp header pars parsing into a previous step
......................................................................
Patch Set 4:
(3 comments)
File src/libosmo-mgcp/mgcp_msg.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/3dca0fc8_739ced20?usp… :
PS4, Line 257: LOGP(DLMGCP, LOGL_NOTICE, "wrong MGCP option format: '%s'\n", line);
> context-less logging is so 2009 […]
An error like this should be catched up by caller layers holding conn information, and then print context there. Otherwise maintaining all this code is a nightmare.
Who is actually calling this? who we want to log? a endp? a conn? a trunk? a bird? a spacecraft? This API is really to low level to actually have to care about that.
File src/libosmo-mgcp/mgcp_protocol.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/e8d53e7e_f7fb186d?usp… :
PS4, Line 710: if (osmux_init(trunk) < 0) {
> drops logging context: endp reduced to just trunk. […]
if this is called due to whatever endp/conn triggerer and this function fails, then it's up to the caller to log whatever context it has upon osmux initialization failure.
Again, there's too many contexts which may be of interest here depending on the code path, so let's keep it at the caller wherever it is interesting.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/7808be8e_430d817f?usp… :
PS4, Line 899: endp->x_osmo_ign |= hpars->x_osmo_ign;
> are you sure about `|=` instead of `=`??? […]
Yes |= because it's in the endp, it's shared by several conns. Otherwise a 2nd conn entering would remove prior information there.
If you look at the previous code you'll see it also does |=. Whether it is clean up on release or similar I don't know, but I'm not modifying the logic here.
This x_osmo_sign will probably need more cleanup in the future, but I cannot do it here, I simply stick to what we had.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39224?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I3ee5158c254213203830fe9c38de11c15b4b19c1
Gerrit-Change-Number: 39224
Gerrit-PatchSet: 4
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: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 15 Jan 2025 17:30:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: laforge, neels.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39224?usp=email )
Change subject: mgw: CRCX: Split mgcp header pars parsing into a previous step
......................................................................
Patch Set 4:
(16 comments)
File include/osmocom/mgcp/mgcp_protocol.h:
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/13020a02_f0734010?usp… :
PS4, Line 7: #define MGCP_PARSE_HDR_PARS_OSMUX_CID_WILDCARD (-1)
> (IMHO enums are favorable to #defines)
Yeah in general, but in this case it's not a closed-set of options, but 2 specific options within int range, so it's fine this way.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/9f84f7e9_d24bcaab?usp… :
PS4, Line 14: bool have_sdp;
> (i'd have called it 'sdp_present' -- 'have' sounds to me like requesting to generate something, not […]
I don't care tbh, feel free to submit a patch renaming when you do further work on related code.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/530bba98_68772968?usp… :
PS4, Line 27: .x_osmo_ign = 0,
> (the " = 0" values are also there implicitly, so it could be just the two .mode and . […]
I still prefer having them here explicitly since it provides a quick look (also through grep) on the default value. It shouldn't really matter performance wise anyway.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/48faf694_e9e00a49?usp… :
PS4, Line 34: char *save;
> (naming: every struct member saves values -- so save what? maybe mgcp_msg_str?)
I'm simply keeping the previously existing var name. Feel free to rename it once everything is merged, will be far easier since previous code base is a mess.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/ee645a74_08e25ecf?usp… :
PS4, Line 38: /* MGCP Body: */
> naming: the "body" in MGCP is the SDP message string starting with a blank line, so "MGCP Body: mgcp […]
Done
File src/libosmo-mgcp/mgcp_msg.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/c5b4520b_83a97789?usp… :
PS4, Line 170: ea
> messeage
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/9a20d439_96bf5855?usp… :
PS4, Line 170: ha
> haders gonna hade
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/1da64109_a64a70ab?usp… :
PS4, Line 173: int mgcp_parse_hdr_pars(struct mgcp_parse_data *pdata)
> this is not public API, right? so i don't need to ask of you an opaque allocator function or future […]
That's a internal static library of osmo-mgw, so no need for that.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/4332aa3d_77f33e55?usp… :
PS4, Line 179: /* parse CallID C: and LocalParameters L: */
> (i guess this comment can go, no useful information conveyed and not even accurate. […]
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/7841886f_c1a5e7fd?usp… :
PS4, Line 180: e(
> (i think the linter now usually asks for a space when it is a for-loop style macro and not a functio […]
There was a discussion about this recently iirc. Currently we have:
$ ag "for_each\(" | wc -l
4699
In any case, this for_each_line() macro is used 11 times, all the times this same way as it is now. Feel free to submit a follow up patch later on changing it for all the use cases. I'm simply keeping the existing syntax here.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/ff2d81d7_fc34b6bf?usp… :
PS4, Line 208: case '\0':
> (hmm i thought it was '\n\n' or '\r\n\r\n' delimiting the SDP body ... […]
No idea, simply moving old code here.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/b5afe5fb_7f9ddf7c?usp… :
PS4, Line 210: goto mgcp_header_done;
> 'return 0;'
I prefer handling it below as it is now, and as it used to be too. I don't want to change the existing logic here. Feel free to do so in a follow-up patch if you really think improves stuff, but see my comment below.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/b4d02310_e9999871?usp… :
PS4, Line 212: LOGP(DLMGCP, LOGL_NOTICE, "CRCX: unhandled option: '%c'/%d\n", *line, *line);
> (technically the caller should log instead of this function, based on the returned 539)
It is further updated in follow-up patch, I tried to do it in steps.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/c1ff4ab8_d7afb850?usp… :
PS4, Line 218: return 0;
> have i ever seen a useless label =)
To me this makes it easier to understand that you can finish properly based on whether you arrived to the end of the string, or because you arrived to the end of the header and SDP is coming. I don't plan to change this for now.
File src/libosmo-mgcp/mgcp_protocol.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/b7782d9a_7ae24da9?usp… :
PS4, Line 873: hpars->remote_osmux_cid = MGCP_PARSE_HDR_PARS_OSMUX_CID_UNSET;
> what i don't like here semantically: hpars is the pristine result of parsing some received PDU and s […]
Yeah well a lot of stuff is quite fucked up, but we cannot fix it all in one commit.
Specially all the osmux stuff.
https://gerrit.osmocom.org/c/osmo-mgw/+/39224/comment/3e355216_df04f49d?usp… :
PS4, Line 898: /* Update endp->x_osmo_ign: */
> (lol funny comment)
All this x_osmo_ign will also probably be improved at a later point.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39224?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I3ee5158c254213203830fe9c38de11c15b4b19c1
Gerrit-Change-Number: 39224
Gerrit-PatchSet: 4
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: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 15 Jan 2025 17:21:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: pespin.
neels has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39248?usp=email )
Change subject: mgw: Decouple SDP parsing step from conn obj update
......................................................................
Patch Set 3:
(4 comments)
Patchset:
PS3:
so nice to see some sanity spawning in that code
File include/osmocom/mgcp/mgcp_protocol.h:
https://gerrit.osmocom.org/c/osmo-mgw/+/39248/comment/269526f2_938d7233?usp… :
PS3, Line 13: #define MGCP_PARSE_SDP_MAXPTIME_UNSET (-1)
duplicate -1
https://gerrit.osmocom.org/c/osmo-mgw/+/39248/comment/d25e34cc_7432081c?usp… :
PS3, Line 14: #define MGCP_PARSE_SDP_RTP_PORT_UNSET (0)
(i prefer enums)
File src/libosmo-mgcp/mgcp_protocol.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39248/comment/1d62a7ff_5850cd44?usp… :
PS3, Line 1139: if (rc < 0) { /* See also RFC 3661: Protocol error */
(comments deserve their own separate line plz)
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39248?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I4a2aecb542886672c1f586c6607714e0356abe35
Gerrit-Change-Number: 39248
Gerrit-PatchSet: 3
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-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 15 Jan 2025 17:16:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: daniel, pespin.
neels has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39239?usp=email )
Change subject: mgw: MDCX: Split mgcp header pars parsing into a previous step
......................................................................
Patch Set 4: Code-Review+1
(3 comments)
File src/libosmo-mgcp/mgcp_protocol.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/39239/comment/d7c34176_d28bfd0e?usp… :
PS4, Line 1122: remote_osmux_cid = mgcp_osmux_setup(endp, line);
> It is not needed and it was actually a bug due to messy code before this. […]
Done
https://gerrit.osmocom.org/c/osmo-mgw/+/39239/comment/b8350c7f_2775d13d?usp… :
PS4, Line 1088: return create_err_response(rq->trunk, NULL, -rc, "MDCX", pdata->trans);
(future todo: add counter. (repeating comment from earlier patch))
https://gerrit.osmocom.org/c/osmo-mgw/+/39239/comment/d2be2b65_8bdfa262?usp… :
PS4, Line 1115: /* Reset conn mode in case it was tweaked through VTY: */
erm having trouble imagining how vty can tweak an incoming MDCX message... what am i missing
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39239?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I6ecb41fc2cc737c3a161b6bc98bd08ae01909655
Gerrit-Change-Number: 39239
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 15 Jan 2025 17:08:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>