Attention is currently required from: pespin.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email )
Change subject: iu_client: refactor LAC/RAC handling
......................................................................
Patch Set 3:
(1 comment)
File src/iu_client.c:
https://gerrit.osmocom.org/c/osmo-iuh/+/38945/comment/6849e471_5cb69848?usp… :
PS3, Line 819: iu_rnc_lac_rac_find_legacy(&rnc, NULL, lac, rac);
> No, it is not present at all.
take a look on iu_page_cs which calls this function.
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ie38fa3751cfce1c981d8d0bed1b8ff891593a638
Gerrit-Change-Number: 38945
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 07 Jan 2025 15:11:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: lynxis lazus <lynxis(a)fe80.eu>
Attention is currently required from: pespin.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email )
Change subject: iu_client: refactor LAC/RAC handling
......................................................................
Patch Set 3:
(2 comments)
File src/iu_client.c:
https://gerrit.osmocom.org/c/osmo-iuh/+/38945/comment/c1f5419d_41f5f0b1?usp… :
PS3, Line 254: static bool iu_rnc_lac_rac_find_legacy(struct ranap_iu_rnc **rnc, struct iu_lac_rac_entry **lre,
> I wonder why do we still need this...
because we want to keep the old broken codepath of paging.
https://gerrit.osmocom.org/c/osmo-iuh/+/38945/comment/c1655181_ab254553?usp… :
PS3, Line 819: iu_rnc_lac_rac_find_legacy(&rnc, NULL, lac, rac);
> Can't we get the plmn when calling iu_page?
No, it is not present at all.
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ie38fa3751cfce1c981d8d0bed1b8ff891593a638
Gerrit-Change-Number: 38945
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 07 Jan 2025 15:10:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, laforge, pespin.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/38933?usp=email )
Change subject: gtp: Rework gtp_resp() into gtp_resp_pdp()
......................................................................
Patch Set 6:
(1 comment)
File gtp/gtp.c:
https://gerrit.osmocom.org/c/osmo-ggsn/+/38933/comment/0256c280_5a1d729f?us… :
PS6, Line 458: static int gtp_resp(struct gsn_t *gsn, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd,
> it would probably be simplier to have a "uint32_t flow_teid" field which gets filled by the caller d […]
But you would loose the type check/length, which I like to have here.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/38933?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Id9ff95e0e2a10a22e65ecf42b2a2b06a0f2d1a45
Gerrit-Change-Number: 38933
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 07 Jan 2025 14:06:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39240?usp=email )
Change subject: mgw: DLCX: Split mgcp header pars parsing into a previous step
......................................................................
mgw: DLCX: Split mgcp header pars parsing into a previous step
Do most of the initial parsing and verification in a prior step, filling
in a "parsed" struct which simplifies logic coming after for different
message types.
Change-Id: I557a3a257ddefedc479a4aff974a74c4e4e2c85d
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 38 insertions(+), 49 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/40/39240/1
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index c82911c..d066f29 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -1222,13 +1222,12 @@
struct mgcp_parse_data *pdata = rq->pdata;
struct mgcp_trunk *trunk = rq->trunk;
struct mgcp_endpoint *endp = rq->endp;
+ struct mgcp_parse_hdr_pars *hpars = &pdata->hpars;
struct rate_ctr_group *rate_ctrs;
- int error_code = 400;
- char *line;
char stats[1048];
- const char *conn_id = NULL;
struct mgcp_conn *conn = NULL;
unsigned int i;
+ int rc;
/* NOTE: In this handler we can not take it for granted that the endp
* pointer will be populated, however a trunk is always guaranteed (except for 'null' endp).
@@ -1270,49 +1269,42 @@
return create_ok_response(trunk, NULL, 200, "DLCX", pdata->trans);
}
- for_each_line(line, pdata->save) {
- if (!mgcp_check_param(line))
- continue;
+ rc = mgcp_parse_hdr_pars(pdata);
+ switch (rc) {
+ case 0:
+ break; /* all good, continue below */
+ case 539:
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
+ return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans);
+ default:
+ return create_err_response(rq->trunk, NULL, rc, "DLCX", pdata->trans);
+ }
- switch (toupper(line[0])) {
- case 'C':
- /* If we have no endpoint, but a call id in the request,
- then this request cannot be handled */
- if (!endp) {
- LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE,
- "cannot handle requests with call-id (C) without endpoint -- abort!");
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
- return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans);
- }
-
- if (mgcp_verify_call_id(endp, line + 3) != 0) {
- error_code = 516;
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CALLID));
- goto error3;
- }
- break;
- case 'I':
- /* If we have no endpoint, but a connection id in the request,
- then this request cannot be handled */
- if (!endp) {
- LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE,
- "cannot handle requests with conn-id (I) without endpoint -- abort!");
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
- return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans);
- }
-
- conn_id = (const char *)line + 3;
- if ((error_code = mgcp_verify_ci(endp, conn_id))) {
- rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CONNID));
- goto error3;
- }
- break;
- default:
- LOGPEPTR(endp, trunk, DLMGCP, LOGL_NOTICE, "DLCX: Unhandled MGCP option: '%c'/%d\n",
- line[0], line[0]);
+ if (hpars->callid) {
+ /* If we have no endpoint, but a call id in the request, then this request cannot be handled */
+ if (!endp) {
+ LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE,
+ "cannot handle requests with call-id (C) without endpoint -- abort!");
rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans);
- break;
+ }
+ if (mgcp_verify_call_id(endp, hpars->callid) != 0) {
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CALLID));
+ return create_err_response(endp, endp, 516, "DLCX", pdata->trans);
+ }
+ }
+
+ if (hpars->connid) {
+ /* If we have no endpoint, but a connection id in the request, then this request cannot be handled */
+ if (!endp) {
+ LOGPTRUNK(trunk, DLMGCP, LOGL_NOTICE,
+ "cannot handle requests with conn-id (I) without endpoint -- abort!");
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_UNHANDLED_PARAM));
+ return create_err_response(rq->trunk, NULL, 539, "DLCX", pdata->trans);
+ }
+ if ((rc = mgcp_verify_ci(endp, hpars->connid)) != 0) {
+ rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CONNID));
+ return create_err_response(endp, endp, rc, "DLCX", pdata->trans);
}
}
@@ -1324,7 +1316,7 @@
* wildcarded DLCX that refers to the selected endpoint. This means
* that we drop all connections on that specific endpoint at once.
* (See also RFC3435 Section F.7) */
- if (!conn_id) {
+ if (!hpars->connid) {
int num_conns = mgcp_endp_num_conns(endp);
LOGPENDP(endp, DLMGCP, LOGL_NOTICE,
"DLCX: missing ci (connectionIdentifier), will remove all connections (%d total) at once\n",
@@ -1342,10 +1334,10 @@
}
/* Find the connection */
- conn = mgcp_endp_get_conn(endp, conn_id);
+ conn = mgcp_endp_get_conn(endp, hpars->connid);
if (!conn) {
rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_FAIL_INVALID_CONNID));
- goto error3;
+ return create_err_response(endp, endp, 400, "DLCX", pdata->trans);
}
/* save the statistics of the current connection */
mgcp_format_stats(stats, sizeof(stats), conn);
@@ -1366,9 +1358,6 @@
rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_DLCX_SUCCESS));
return create_ok_resp_with_param(endp, endp, 250, "DLCX", pdata->trans, stats);
-
-error3:
- return create_err_response(endp, endp, error_code, "DLCX", pdata->trans);
}
/* RSIP command handler, processes the received command */
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39240?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I557a3a257ddefedc479a4aff974a74c4e4e2c85d
Gerrit-Change-Number: 39240
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: lynxis lazus.
pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38947?usp=email )
Change subject: iu_client: add a new event NEW_LAC_RAC
......................................................................
Patch Set 3:
(1 comment)
File include/osmocom/ranap/iu_client.h:
https://gerrit.osmocom.org/c/osmo-iuh/+/38947/comment/1fb1b3d1_ef7c6e82?usp… :
PS3, Line 50: RANAP_IU_EVENT_NEW_LAC_RAC, /* Either a new LAC/RAC has been detected */
add to the comment:
param: struct ranap_iu_event_new_lac_rac*
Also: how to know whether a LAC or RAC was detected?
You may want to look at some other existing osmocom structs which allow setting the type of cell id?
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/38947?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I8b1b8c58bf72b00e2705ca87a89a91481bac3470
Gerrit-Change-Number: 38947
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Tue, 07 Jan 2025 13:48:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: lynxis lazus.
pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38946?usp=email )
Change subject: iu_client: add ranap_iu_page_cs2/ranap_iu_page_ps2
......................................................................
Patch Set 3:
(1 comment)
File src/iu_client.c:
https://gerrit.osmocom.org/c/osmo-iuh/+/38946/comment/84a6f140_701298b4?usp… :
PS3, Line 901: };
afaiu when paging over LAC in here you'll only be matching entries which have RA=0.
You should instead afaiu lookup using a sepcial value like -1 or having a different function only comparing the LAI.
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/38946?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I1f07e96642737160d387de3e4c3f71d288d356dd
Gerrit-Change-Number: 38946
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Tue, 07 Jan 2025 13:46:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: lynxis lazus.
pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email )
Change subject: iu_client: refactor LAC/RAC handling
......................................................................
Patch Set 3:
(2 comments)
File src/iu_client.c:
https://gerrit.osmocom.org/c/osmo-iuh/+/38945/comment/4be33bba_47b3fbab?usp… :
PS3, Line 254: static bool iu_rnc_lac_rac_find_legacy(struct ranap_iu_rnc **rnc, struct iu_lac_rac_entry **lre,
I wonder why do we still need this...
https://gerrit.osmocom.org/c/osmo-iuh/+/38945/comment/9d58d777_d1a0497a?usp… :
PS3, Line 819: iu_rnc_lac_rac_find_legacy(&rnc, NULL, lac, rac);
Can't we get the plmn when calling iu_page?
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ie38fa3751cfce1c981d8d0bed1b8ff891593a638
Gerrit-Change-Number: 38945
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Tue, 07 Jan 2025 13:43:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: lynxis lazus.
pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email )
Change subject: iu_client: refactor LAC/RAC handling
......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-iuh/+/38945/comment/c5a52365_16a77c09?usp… :
PS2, Line 13: The old gprs_ra_id is still used to contain api stability.
> The old gprs_ra_id is used in struct ranap_ue_conn_ctx (iu_client. […]
Yeah we should not touch that.
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/38945?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ie38fa3751cfce1c981d8d0bed1b8ff891593a638
Gerrit-Change-Number: 38945
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Tue, 07 Jan 2025 13:40:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: lynxis lazus <lynxis(a)fe80.eu>
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38946?usp=email )
Change subject: iu_client: add ranap_iu_page_cs2/ranap_iu_page_ps2
......................................................................
Set Ready For Review
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/38946?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I1f07e96642737160d387de3e4c3f71d288d356dd
Gerrit-Change-Number: 38946
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Tue, 07 Jan 2025 13:24:51 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No