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

October 2023

  • 1 participants
  • 1843 discussions
[M] Change in osmo-mgw[master]: eliminate duality of codecs[] and ptmap[]
by neels 25 Oct '23

25 Oct '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/34899?usp=email ) Change subject: eliminate duality of codecs[] and ptmap[] ...................................................................... eliminate duality of codecs[] and ptmap[] codecs[] is an array of enum osmo_mgcp_codecs. ptmap[] is an array of { enum osmo_mgcp_codecs, unsigned int ptmap }. MGCP lists first a bunch of payload type numbers and then specifies them again for details, like the numbers 112, 96, 3 in this example: m=audio <port> RTP/AVP 112 96 3 a=rtpmap:112 AMR/8000 a=rtpmap:96 VND.3GPP.IUFP/16000 a=rtpmap:3 GSM-FR/8000 So far we keep these lists in two separate arrays, in both struct mgcp_response and struct mgcp_msg: - codecs[], codecs_len stores the 'm=audio' list - ptmap[], ptmap_len stores the 'a=rtpmap' list These are semantically identical, and keeping two instances leads to numerous checks, conversions and dear hopes of correct ordering. So let's keep only one list with both codec and payload type number in it. The 'm=audio' list establishes the order of the pt numbers, and the 'a=rtpmap' list adds codec information to the established entries. Change-Id: I798e02c6663376d3d52f4a74fc4b32411ce95bed --- M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_fsm.c M tests/mgcp_client/mgcp_client_test.c 5 files changed, 107 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/34899/1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 9a0611a..31f4ae7 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -95,8 +95,6 @@ uint16_t audio_port; char audio_ip[INET6_ADDRSTRLEN]; unsigned int ptime; - enum mgcp_codecs codecs[MGCP_MAX_CODECS]; - unsigned int codecs_len; struct ptmap ptmap[MGCP_MAX_CODECS]; unsigned int ptmap_len; }; @@ -129,8 +127,6 @@ char *audio_ip; enum mgcp_connection_mode conn_mode; unsigned int ptime; - enum mgcp_codecs codecs[MGCP_MAX_CODECS]; - unsigned int codecs_len; struct ptmap ptmap[MGCP_MAX_CODECS]; unsigned int ptmap_len; uint32_t x_osmo_ign; diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h index ade4f49..25f0732 100644 --- a/include/osmocom/mgcp_client/mgcp_client_fsm.h +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -29,12 +29,6 @@ /*! RTP packetization interval (optional) */ unsigned int ptime; - /*! RTP codec list (optional) */ - enum mgcp_codecs codecs[MGCP_MAX_CODECS]; - - /*! Number of codecs in RTP codec list (optional) */ - unsigned int codecs_len; - /*! RTP payload type map (optional, only needed when payload types are * used that differ from what IANA/3GPP defines) */ struct ptmap ptmap[MGCP_MAX_CODECS]; diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 95c7a4b..a66b499 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -302,7 +302,7 @@ char *pt_str; char *pt_end; unsigned long int pt; - unsigned int count = 0; + unsigned int ptmap_len; unsigned int i; /* Extract port information */ @@ -316,10 +316,15 @@ if (!line) goto exit; + /* Clear any previous entries before writing over r->ptmap */ + r->ptmap_len = 0; + /* Keep a local ptmap_len to show only the full list after parsing succeeded in whole. */ + ptmap_len = 0; + pt_str = strtok(line, " "); while (1) { /* Do not allow excessive payload types */ - if (count >= ARRAY_SIZE(r->ptmap)) + if (ptmap_len >= ARRAY_SIZE(r->ptmap)) goto response_parse_failure_pt; pt_str = strtok(NULL, " "); @@ -335,8 +340,8 @@ goto response_parse_failure_pt; /* Do not allow duplicate payload types */ - for (i = 0; i < count; i++) - if (r->codecs[i] == pt) + for (i = 0; i < ptmap_len; i++) + if (r->ptmap[i].pt == pt) goto response_parse_failure_pt; /* Note: The payload type we store may not necessarly match @@ -345,11 +350,13 @@ * match enum mgcp_codecs, we will go through afterwards and * remap the affected entries with the inrofmation we learn * from rtpmap */ - r->codecs[count] = pt; - count++; + r->ptmap[ptmap_len].codec = -1; + r->ptmap[ptmap_len].pt = pt; + ptmap_len++; } - r->codecs_len = count; + /* Parsing succeeded, publish all entries. */ + r->ptmap_len = ptmap_len; exit: return 0; @@ -369,6 +376,7 @@ static int mgcp_parse_audio_ptime_rtpmap(struct mgcp_response *r, const char *line) { unsigned int pt; + unsigned int i; char codec_resp[64]; int rc; @@ -397,9 +405,36 @@ "Failed to parse SDP parameter, can't parse codec in rtpmap: %s\n", osmo_quote_str(line, -1)); return -EINVAL; } - r->ptmap[r->ptmap_len].pt = pt; - r->ptmap[r->ptmap_len].codec = rc; - r->ptmap_len++; + /* Earlier, a line like "m=audio 16002 RTP/AVP 98 112 3" established the desired order of payloads, now + * enrich it with actual codec information provided by "a=rtpmap:..." entries. + * For each, find the entry with the right pt number and add the info there. */ + + + for (i = 0; i < r->ptmap_len; i++) { + if (r->ptmap[i].pt != pt) + continue; + r->ptmap[i].codec = rc; + break; + } + + if (i >= r->ptmap_len) { + /* No entry was found. This is an error in the MGCP protocol, but let's just add another entry + * anyway, to not make it look like it was never there. */ + LOGP(DLMGCP, LOGL_ERROR, + "error in MGCP message: 'a=rtpmap:%u' has no matching entry in 'm=audio ... %u'\n", + pt, pt); + if (r->ptmap_len <= ARRAY_SIZE(r->ptmap)) { + LOGP(DLMGCP, LOGL_ERROR, + "cannot parse all codecs: can only store up to %zu rtpmap entries.\n", + ARRAY_SIZE(r->ptmap)); + return -ENOSPC; + } + r->ptmap[r->ptmap_len] = (struct ptmap){ + .pt = pt, + .codec = rc, + }; + r->ptmap_len++; + } } return 0; @@ -508,7 +543,6 @@ int rc; char *data; char *data_ptr; - int i; /* Since this functions performs a destructive parsing, we create a * local copy of the body data */ @@ -553,10 +587,6 @@ } } - /* See also note in mgcp_parse_audio_port_pt() */ - for (i = 0; i < r->codecs_len; i++) - r->codecs[i] = map_pt_to_codec(r->ptmap, r->ptmap_len, r->codecs[i]); - rc = 0; exit: talloc_free(data); @@ -1233,7 +1263,6 @@ { unsigned int i; const char *codec; - unsigned int pt; #define MSGB_PRINTF_OR_RET(FMT, ARGS...) do { \ if (msgb_printf(msg, FMT, ##ARGS) != 0) { \ @@ -1247,11 +1276,10 @@ if (mgcp_msg->ptime) MSGB_PRINTF_OR_RET(" p:%u,", mgcp_msg->ptime); - if (mgcp_msg->codecs_len) { + if (mgcp_msg->ptmap_len) { MSGB_PRINTF_OR_RET(" a:"); - for (i = 0; i < mgcp_msg->codecs_len; i++) { - pt = mgcp_msg->codecs[i]; - codec = get_value_string_or_null(osmo_mgcpc_codec_names, pt); + for (i = 0; i < mgcp_msg->ptmap_len; i++) { + codec = get_value_string_or_null(osmo_mgcpc_codec_names, mgcp_msg->ptmap[i].codec); /* Note: Use codec descriptors from enum mgcp_codecs * in mgcp_client only! */ @@ -1259,7 +1287,7 @@ return -EINVAL; MSGB_PRINTF_OR_RET("%s", extract_codec_name(codec)); - if (i < mgcp_msg->codecs_len - 1) + if (i < mgcp_msg->ptmap_len - 1) MSGB_PRINTF_OR_RET(";"); } MSGB_PRINTF_OR_RET(","); @@ -1335,20 +1363,20 @@ MSGB_PRINTF_OR_RET("t=0 0\r\n"); MSGB_PRINTF_OR_RET("m=audio %u RTP/AVP", mgcp_msg->audio_port); - for (i = 0; i < mgcp_msg->codecs_len; i++) { - pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, mgcp_msg->codecs[i]); - MSGB_PRINTF_OR_RET(" %u", pt); + for (i = 0; i < mgcp_msg->ptmap_len; i++) { + MSGB_PRINTF_OR_RET(" %u", mgcp_msg->ptmap[i].pt); } MSGB_PRINTF_OR_RET("\r\n"); /* Add optional codec parameters (fmtp) */ if (mgcp_msg->param_present) { - for (i = 0; i < mgcp_msg->codecs_len; i++) { + for (i = 0; i < mgcp_msg->ptmap_len; i++) { /* The following is only applicable for AMR */ - if (mgcp_msg->codecs[i] != CODEC_AMR_8000_1 && mgcp_msg->codecs[i] != CODEC_AMRWB_16000_1) + if (mgcp_msg->ptmap[i].codec != CODEC_AMR_8000_1 + && mgcp_msg->ptmap[i].codec != CODEC_AMRWB_16000_1) continue; - pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, mgcp_msg->codecs[i]); + pt = mgcp_msg->ptmap[i].pt; if (mgcp_msg->param.amr_octet_aligned_present && mgcp_msg->param.amr_octet_aligned) MSGB_PRINTF_OR_RET("a=fmtp:%u octet-align=1\r\n", pt); else if (mgcp_msg->param.amr_octet_aligned_present && !mgcp_msg->param.amr_octet_aligned) @@ -1356,14 +1384,14 @@ } } - for (i = 0; i < mgcp_msg->codecs_len; i++) { - pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, mgcp_msg->codecs[i]); + for (i = 0; i < mgcp_msg->ptmap_len; i++) { + pt = mgcp_msg->ptmap[i].pt; /* Note: Only dynamic payload type from the range 96-127 * require to be explained further via rtpmap. All others * are implcitly definedby the number in m=audio */ if (pt >= 96 && pt <= 127) { - codec = get_value_string_or_null(osmo_mgcpc_codec_names, mgcp_msg->codecs[i]); + codec = get_value_string_or_null(osmo_mgcpc_codec_names, mgcp_msg->ptmap[i].codec); /* Note: Use codec descriptors from enum mgcp_codecs * in mgcp_client only! */ diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index 660f0ad..775a3a8 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -114,12 +114,10 @@ .call_id = info->call_id, .conn_mode = MGCP_CONN_RECV_ONLY, .ptime = info->ptime, - .codecs_len = info->codecs_len, .ptmap_len = info->ptmap_len, .param_present = info->param_present }; osmo_strlcpy(mgcp_msg->endpoint, info->endpoint, MGCP_ENDPOINT_MAXLEN); - memcpy(mgcp_msg->codecs, info->codecs, sizeof(mgcp_msg->codecs)); memcpy(mgcp_msg->ptmap, info->ptmap, sizeof(mgcp_msg->ptmap)); memcpy(&mgcp_msg->param, &info->param, sizeof(mgcp_msg->param)); @@ -163,12 +161,10 @@ .audio_ip = mgcp_ctx->conn_peer_local.addr, .audio_port = mgcp_ctx->conn_peer_local.port, .ptime = mgcp_ctx->conn_peer_local.ptime, - .codecs_len = mgcp_ctx->conn_peer_local.codecs_len, .ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len, .param_present = mgcp_ctx->conn_peer_local.param_present }; osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_remote.endpoint, MGCP_ENDPOINT_MAXLEN); - memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs)); memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap)); memcpy(&mgcp_msg.param, &mgcp_ctx->conn_peer_local.param, sizeof(mgcp_ctx->conn_peer_local.param)); diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 37c5f6c..79047b6 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -107,9 +107,6 @@ printf(" audio_port = %u\n", response->audio_port); printf(" audio_ip = %s\n", response->audio_ip); printf(" ptime = %u\n", response->ptime); - printf(" codecs_len = %u\n", response->codecs_len); - for(i=0;i<response->codecs_len;i++) - printf(" codecs[%u] = %u\n", i, response->codecs[i]); printf(" ptmap_len = %u\n", response->ptmap_len); for(i=0;i<response->ptmap_len;i++) { printf(" ptmap[%u].codec = %u\n", i, response->ptmap[i].codec); @@ -149,12 +146,11 @@ .conn_id = "11", .conn_mode = MGCP_CONN_RECV_SEND, .ptime = 20, - .codecs[0] = CODEC_GSM_8000_1, - .codecs[1] = CODEC_AMR_8000_1, - .codecs[2] = CODEC_GSMEFR_8000_1, - .codecs_len = 1, - .ptmap[0].codec = CODEC_GSMEFR_8000_1, - .ptmap[0].pt = 96, + .ptmap = { + { .codec = CODEC_GSM_8000_1, .pt = CODEC_GSM_8000_1 }, + { .codec = CODEC_AMR_8000_1, .pt = CODEC_AMR_8000_1 }, + { .codec = CODEC_GSMEFR_8000_1, .pt = 96 }, + }, .ptmap_len = 1, .x_osmo_ign = MGCP_X_OSMO_IGN_CALLID, .x_osmo_osmux_cid = -1, /* wildcard */ @@ -179,9 +175,9 @@ mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); - mgcp_msg.codecs_len = 2; + mgcp_msg.ptmap_len = 2; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.ptmap_len = 1; printf("%s\n", (char *)msg->data); printf("Generated CRCX message (three codecs, one with custom pt):\n"); @@ -189,9 +185,9 @@ mgcp_msg.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); - mgcp_msg.codecs_len = 3; + mgcp_msg.ptmap_len = 3; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.ptmap_len = 1; printf("%s\n", (char *)msg->data); printf("Generated MDCX message:\n"); @@ -209,9 +205,9 @@ (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); - mgcp_msg.codecs_len = 2; + mgcp_msg.ptmap_len = 2; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.ptmap_len = 1; printf("%s\n", (char *)msg->data); printf("Generated MDCX message (three codecs, one with custom pt):\n"); @@ -220,9 +216,9 @@ (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); - mgcp_msg.codecs_len = 3; + mgcp_msg.ptmap_len = 3; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.ptmap_len = 1; printf("%s\n", (char *)msg->data); printf("Generated DLCX message:\n"); @@ -330,8 +326,10 @@ .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE), .ptime = 20, - .codecs[0] = CODEC_AMR_8000_1, - .codecs_len = 1 + .ptmap = { + { .codec = CODEC_AMR_8000_1, .pt = CODEC_AMR_8000_1 }, + }, + .ptmap_len = 1 }; printf("\n%s():\n", __func__); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34899?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I798e02c6663376d3d52f4a74fc4b32411ce95bed Gerrit-Change-Number: 34899 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-mgw[master]: mgcp_client_fsm: allow the same codec multiple times in ptmap
by neels 25 Oct '23

25 Oct '23
Attention is currently required from: dexter, pespin. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/34349?usp=email ) Change subject: mgcp_client_fsm: allow the same codec multiple times in ptmap ...................................................................... Patch Set 5: (1 comment) Patchset: PS4: > Maybe @neels can also say something about this. thanks for the highlight, also for the patience! fortunately someone just pointed out to me that i missed this one. Taking a look now... -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34349?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ie13ce59d3165936a16e16588b4d58f0ce7e0ae67 Gerrit-Change-Number: 34349 Gerrit-PatchSet: 5 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Oct 2023 19:12:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-gsm-manuals[master]: add static SS7 routing example to cs7-config.adoc
by neels 25 Oct '23

25 Oct '23
Attention is currently required from: laforge, msuraev, pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email to look at the new patch set (#6). Change subject: add static SS7 routing example to cs7-config.adoc ...................................................................... add static SS7 routing example to cs7-config.adoc I put the cfg files I used for testing this here: https://people.osmocom.org/neels/zoch4ahX/g32273.tgz To test, just start up and verify successful BSSAP RESET ACK. Related: SYS#6422 Change-Id: I44afddf7004f5bf37eec706ca3da12c04f83f8fa --- M common/chapters/cs7-config.adoc 1 file changed, 164 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/73/32273/6 -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Change-Id: I44afddf7004f5bf37eec706ca3da12c04f83f8fa Gerrit-Change-Number: 32273 Gerrit-PatchSet: 6 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in osmo-gsm-manuals[master]: add static SS7 routing example to cs7-config.adoc
by neels 25 Oct '23

25 Oct '23
Attention is currently required from: laforge, msuraev, pespin. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email ) Change subject: add static SS7 routing example to cs7-config.adoc ...................................................................... Patch Set 5: (2 comments) File common/chapters/cs7-config.adoc: https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273/comment/be233d1c_7130… PS1, Line 365: Every component has a distinct M3UA port. For > the main obstacle for me is that i'm so uncertain about what it needs to say in order to be accurate […] Done File common/chapters/cs7-config.adoc: https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273/comment/fbf5b420_b1bf… PS5, Line 375: For static routing, the M3UA port numbers must be fixed, i.e. there must be no `0` for a client's local port as in : `asp foo 2905 0 m3ua`. Instead, you may use `asp foo 2905 2905 m3ua`. This is another fact I'm not so sure about. I just tried it, and whenever i set any local port to 0, the connections fail. So I guess it is accurate, or did i miss something. -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Change-Id: I44afddf7004f5bf37eec706ca3da12c04f83f8fa Gerrit-Change-Number: 32273 Gerrit-PatchSet: 5 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Oct 2023 19:04:06 +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-gsm-manuals[master]: add static SS7 routing example to cs7-config.adoc
by neels 25 Oct '23

25 Oct '23
Attention is currently required from: laforge, msuraev, pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email to look at the new patch set (#5). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: add static SS7 routing example to cs7-config.adoc ...................................................................... add static SS7 routing example to cs7-config.adoc Related: SYS#6422 Change-Id: I44afddf7004f5bf37eec706ca3da12c04f83f8fa --- M common/chapters/cs7-config.adoc 1 file changed, 160 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/73/32273/5 -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Change-Id: I44afddf7004f5bf37eec706ca3da12c04f83f8fa Gerrit-Change-Number: 32273 Gerrit-PatchSet: 5 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in osmo-gsm-manuals[master]: add static SS7 routing example to cs7-config.adoc
by neels 25 Oct '23

25 Oct '23
Attention is currently required from: laforge, msuraev, pespin. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email ) Change subject: add static SS7 routing example to cs7-config.adoc ...................................................................... Patch Set 4: (2 comments) File common/chapters/cs7-config.adoc: https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273/comment/3ad2828c_2cdc… PS1, Line 349: Osmocom SS7 supports dynamic routing, allowing minimal SS7 configuration. If all of your components support dynamic > My point was also to have "Routing Key Management (RKM)" the first time it appears here so that the […] Done https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273/comment/f7e7cacf_7056… PS1, Line 365: Every component has a distinct M3UA port. For > I also think this sentence is too generic or not accurate. […] the main obstacle for me is that i'm so uncertain about what it needs to say in order to be accurate. I think I see what you mean now, all the components could use 2905, i guess? Possibly the 12905 came in because I started out testing with an example from the ttcn3 test suite, and it may have led to an inaccurate conclusion. I just fired up the tests again, and verified it. it also works if i put 2905 everywhere, because of course each is on a different IP address. will try to reword things to remove that aspect. -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/32273?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Change-Id: I44afddf7004f5bf37eec706ca3da12c04f83f8fa Gerrit-Change-Number: 32273 Gerrit-PatchSet: 4 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Wed, 25 Oct 2023 18:51:35 +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
[S] Change in pysim[master]: runtime: fix tracking of selected_adf
by dexter 25 Oct '23

25 Oct '23
Attention is currently required from: laforge. Hello laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/34897?usp=email to look at the new patch set (#2). Change subject: runtime: fix tracking of selected_adf ...................................................................... runtime: fix tracking of selected_adf The class property selected_adf is not updated in all locations where an ADF is selected, this means that we may loose track of the currently selected ADF in some locations Change-Id: I4cc0c58ff887422b4f3954d35c8380ddc00baa1d Related: OS#5418 --- M pySim/runtime.py 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/97/34897/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34897?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4cc0c58ff887422b4f3954d35c8380ddc00baa1d Gerrit-Change-Number: 34897 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: runtime: fix tracking of selected_adf
by dexter 25 Oct '23

25 Oct '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34897?usp=email ) Change subject: runtime: fix tracking of selected_adf ...................................................................... runtime: fix tracking of selected_adf The class property selected_adf is not updated in all locations where an ADF is selected, this means that we may loose track of the currently selected ADF in some locations Change-Id: I4cc0c58ff887422b4f3954d35c8380ddc00baa1d Related: OS#5418 --- M pySim/runtime.py 1 file changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/97/34897/1 diff --git a/pySim/runtime.py b/pySim/runtime.py index a54a1b6..1c58f17 100644 --- a/pySim/runtime.py +++ b/pySim/runtime.py @@ -111,6 +111,7 @@ for f in sorted(set(apps_profile) - set(apps_taken), key=str): try: data, sw = self.card.select_adf_by_aid(f.aid) + self.selected_adf = f if sw == "9000": print(" %s: %s" % (f.name, f.aid)) apps_taken.append(f) @@ -295,7 +296,6 @@ raise RuntimeError('Cannot determine path from %s to %s' % (self.selected_file, file)) self._select_pre(cmd_app) - for p in inter_path: try: if isinstance(p, CardADF): @@ -344,6 +344,7 @@ try: if isinstance(f, CardADF): (data, sw) = self.rs.card.select_adf_by_aid(f.aid, scc=self.scc) + self.selected_adf = f else: (data, sw) = self.scc.select_file(f.fid) self.selected_file = f -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34897?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4cc0c58ff887422b4f3954d35c8380ddc00baa1d Gerrit-Change-Number: 34897 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in ...osmo-epdg[master]: s2b: Implement GTPv2C DeleteBearerReq
by pespin 25 Oct '23

25 Oct '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34896?usp=email ) Change subject: s2b: Implement GTPv2C DeleteBearerReq ...................................................................... s2b: Implement GTPv2C DeleteBearerReq Sessions are now stored/kept upon CreateSession time until deleted through DeleteBearerReq. Related: OS#6046 Change-Id: I1e5af1ead17385d2e494f4c90ffe6455aee850da --- M src/epdg_gtpc_s2b.erl 1 file changed, 137 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/96/34896/1 diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl index 82985a5..a5658f1 100644 --- a/src/epdg_gtpc_s2b.erl +++ b/src/epdg_gtpc_s2b.erl @@ -70,7 +70,9 @@ rport :: non_neg_integer(), restart_counter :: 0..255, seq_no :: 0..16#ffffffff, - sess_list %% TODO: fill it, list of gtp_session + next_local_control_tei = 1 :: 0..16#ffffffff, + next_local_data_tei = 1 :: 0..16#ffffffff, + sessions = sets:new() }). -record(gtp_bearer, { @@ -134,36 +136,45 @@ gen_server:call(?SERVER, {gtpc_create_session_req, {Imsi}}). -handle_call({gtpc_create_session_req, {Imsi}}, _From, State) -> - Sess = new_gtp_session(Imsi, State), - Req = gen_create_session_request(Sess, State), +handle_call({gtpc_create_session_req, {Imsi}}, _From, State0) -> + {Sess0, State1} = find_or_new_gtp_session(Imsi, State0), + Req = gen_create_session_request(Sess0, State1), %TODO: increment State.seq_no. - tx_gtp(Req, State), + tx_gtp(Req, State1), lager:debug("Waiting for CreateSessionResponse~n", []), receive {udp, _Socket, IP, InPortNo, RxMsg} -> try Resp = gtp_packet:decode(RxMsg), - logger:info("s2b: Rx from IP ~p port ~n ~p~n", [IP, InPortNo, Resp]), - %% TODO: store Sess in State. - {reply, {ok, Resp}, State} + lager:info("s2b: Rx from IP ~p port ~p ~p~n", [IP, InPortNo, Resp]), + Sess1 = update_gtp_session_from_create_session_response(Resp, Sess0), + lager:info("s2b: Updated Session after create_session_response: ~p~n", [Sess1]), + State2 = update_gtp_session(Sess0, Sess1, State1), + {reply, {ok, Resp}, State2} catch Any -> - logger:error("Error sending message to receiver, ERROR: ~p~n", [Any]), - {reply, {error, decode_failure}, State} + lager:error("Error sending message to receiver, ERROR: ~p~n", [Any]), + {reply, {error, decode_failure}, State1} end after 5000 -> - logger:error("Timeout waiting for CreateSessionResponse for ~p~n", [Req]), - {reply, timeout, State} + lager:error("Timeout waiting for CreateSessionResponse for ~p~n", [Req]), + {reply, timeout, State1} end. %% @callback gen_server handle_cast(stop, State) -> {stop, normal, State}; -handle_cast(_Req, State) -> +handle_cast(Req, State) -> + lager:info("S2b handle_cast: ~p ~n", [Req]), {noreply, State}. %% @callback gen_server -handle_info(_Info, State) -> +handle_info({udp, _Socket, IP, InPortNo, RxMsg}, State) -> + lager:info("S2b: Rx from IP ~p port ~p: ~p~n", [IP, InPortNo, RxMsg]), + Req = gtp_packet:decode(RxMsg), + lager:info("S2b: Rx from IP ~p port ~p: ~p~n", [IP, InPortNo, Req]), + rx_gtp(Req, State); +handle_info(Info, State) -> + lager:info("S2b handle_info: ~p ~n", [Info]), {noreply, State}. %% @callback gen_server @@ -185,6 +196,76 @@ %% Internal Function Definitions %% ------------------------------------------------------------------ +new_gtp_session(Imsi, State) -> + % TODO: find non-used local TEI inside State + Bearer = #gtp_bearer{ + ebi = 5, + local_data_tei = State#gtp_state.next_local_data_tei + }, + Sess = #gtp_session{imsi = Imsi, + apn = ?APN, + local_control_tei = State#gtp_state.next_local_control_tei, + bearer = Bearer + }, + NewSt = State#gtp_state{next_local_control_tei = State#gtp_state.next_local_control_tei + 1, + next_local_data_tei = State#gtp_state.next_local_data_tei + 1, + sessions = sets:add_element(Sess, State#gtp_state.sessions)}, + {Sess, NewSt}. + +% returns Sess if found, undefined it not +find_gtp_session_by_imsi(Imsi, State) -> + sets:fold( + fun(SessIt = #gtp_session{imsi = Imsi}, _AccIn) -> SessIt; + (_, AccIn) -> AccIn + end, + undefined, + State#gtp_state.sessions). + +find_or_new_gtp_session(Imsi, State) -> + Sess = find_gtp_session_by_imsi(Imsi, State), + case Sess of + #gtp_session{imsi = Imsi} -> + {Sess, State}; + undefined -> + new_gtp_session(Imsi, State) + end. + +update_gtp_session(OldSess, NewSess, State) -> + SetRemoved = sets:del_element(OldSess, State#gtp_state.sessions), + SetUpdated = sets:add_element(NewSess, SetRemoved), + State#gtp_state{sessions = SetUpdated}. + +delete_gtp_session(Sess, State) -> + SetRemoved = sets:del_element(Sess, State#gtp_state.sessions), + State#gtp_state{sessions = SetRemoved}. + +update_gtp_session_from_create_session_response_ie(none, Sess) -> + Sess; +update_gtp_session_from_create_session_response_ie({_, + #v2_fully_qualified_tunnel_endpoint_identifier{ + interface_type = _Interface, + key = TEI, ipv4 = _IP4, ipv6 = _IP6}, + Next}, Sess) -> + update_gtp_session_from_create_session_response_ie(maps:next(Next), Sess#gtp_session{remote_control_tei = TEI}); +update_gtp_session_from_create_session_response_ie({_, _, Next}, + Sess) -> + update_gtp_session_from_create_session_response_ie(maps:next(Next), Sess). + +update_gtp_session_from_create_session_response_ies(#gtp{ie = IEs}, Sess) -> + update_gtp_session_from_create_session_response_ie(maps:next(maps:iterator(IEs)), Sess). + +update_gtp_session_from_create_session_response(Resp = #gtp{version = v2, type = create_session_response}, Sess) -> + update_gtp_session_from_create_session_response_ies(#gtp{ie = Resp#gtp.ie}, Sess). + +% returns Sess if found, undefined it not +find_gtp_session_by_local_teic(LocalControlTei, State) -> + sets:fold( + fun(SessIt = #gtp_session{local_control_tei = LocalControlTei}, _AccIn) -> SessIt; + (_, AccIn) -> AccIn + end, + undefined, + State#gtp_state.sessions). + %% connect/2 connect(Name, {Socket, RemoteAddr, RemotePort}) -> lager:info("~s connecting to IP ~s port ~p~n", [Name, RemoteAddr, RemotePort]), @@ -193,23 +274,27 @@ connect(Address) -> connect(?SVC_NAME, Address). +rx_gtp(Req = #gtp{version = v2, type = delete_bearer_request}, State) -> + Sess = find_gtp_session_by_local_teic(Req#gtp.tei, State), + case Sess of + undefined -> + lager:error("Rx unknown TEI ~p: ~p~n", [Req#gtp.tei, Req]), + {noreply, State}; + Sess -> + Resp = gen_delete_bearer_response(Req, Sess, request_accepted, State), + tx_gtp(Resp, State), + State1 = delete_gtp_session(Sess, State), + {noreply, State1} + end; +rx_gtp(Req, State) -> + lager:error("S2b: UNIMPLEMENTED Rx: ~p~n", [Req]), + {noreply, State}. + tx_gtp(Req, State) -> lager:info("s2b: Tx ~p~n", [Req]), Msg = gtp_packet:encode(Req), gen_udp:send(State#gtp_state.socket, State#gtp_state.raddr, State#gtp_state.rport, Msg). -new_gtp_session(Imsi, _State) -> - % TODO: find non-used local TEI inside State - Bearer = #gtp_bearer{ - ebi = 5, - local_data_tei = 1 - }, - #gtp_session{imsi = Imsi, - apn = ?APN, - local_control_tei = 0, - bearer = Bearer - }. - %% 7.2.1 Create Session Request gen_create_session_request(#gtp_session{imsi = Imsi, apn = Apn, @@ -249,4 +334,17 @@ ], #gtp{version = v2, type = create_session_request, tei = 0, seq_no = SeqNo, ie = IEs}. +gen_delete_bearer_response(Req = #gtp{version = v2, type = delete_bearer_request}, + Sess = #gtp_session{remote_control_tei = RemoteCtlTEI}, + GtpCause, + #gtp_state{restart_counter = RCnt}) -> + IEs = [#v2_recovery{restart_counter = RCnt}, + #v2_cause{v2_cause = GtpCause} + ], + #gtp{version = v2, + type = delete_bearer_response, + tei = RemoteCtlTEI, + seq_no = Req#gtp.seq_no, + ie = IEs}. + -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34896?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I1e5af1ead17385d2e494f4c90ffe6455aee850da Gerrit-Change-Number: 34896 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: epdg: Test Handover from Wifi back to LTE
by pespin 25 Oct '23

25 Oct '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34895?usp=email ) Change subject: epdg: Test Handover from Wifi back to LTE ...................................................................... epdg: Test Handover from Wifi back to LTE The Handover is informed to the EPDG by the PGW, who sends a DeleteBearerRequest when receiving an attach from the 3GPP network once the phone has jumped there. Related: OS#6046 Change-Id: I299faf28fa51dbc5d2de6c72a39a01eca67a5775 --- M epdg/EPDG_Tests.ttcn M library/GTPv2_Templates.ttcn 2 files changed, 83 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/95/34895/1 diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn index e7c8633..83b42fa 100644 --- a/epdg/EPDG_Tests.ttcn +++ b/epdg/EPDG_Tests.ttcn @@ -112,20 +112,27 @@ }; +type record BearerConfig { + /* EPS Bearer ID */ + uint4_t ebi optional, + /* TEI (Data) local side */ + OCT4 teid_local optional, + /* TEI (Data) remote side */ + OCT4 teid_remote optional +}; + type record EPDG_ConnHdlrPars { hexstring imsi, charstring apn, charstring ue_ip, - /* TEI (Data) local side */ - OCT4 teid, /* TEI (Control) local side */ - OCT4 teic, - /* TEI (Data) remote side */ - OCT4 teid_remote optional, + OCT4 teic_local, /* TEI (Control) remote side */ OCT4 teic_remote optional, + BearerConfig bearer optional, + AuthVector vec optional }; @@ -146,10 +153,13 @@ imsi := f_gen_imsi(imsi_suffix), apn := "internet", ue_ip := "192.168.123.50", - teid := '00000000'O, - teic := '00000000'O, - teid_remote := omit, + teic_local := '00000000'O, teic_remote := omit, + bearer := { + ebi := omit, + teid_local := omit, + teid_remote := omit + }, vec := f_gen_auth_vec_3g() }; return pars; @@ -391,31 +401,34 @@ /* Diameter SWx SAR + SAA. */ private altstep as_GTP2C_CreateSession_success() runs on EPDG_ConnHdlr { var PDU_GTPCv2 rx_msg; + var BearerContextIEs rx_bctx_ies; var template (value) FullyQualifiedTEID fteid_c_ie, fteid_u_ie; var template (value) PDN_AddressAllocation paa; - var uint4_t bid; var template (value) BearerContextIEs bctx_ies; [] GTP2.receive(tr_GTP2C_CreateSessionReq(g_pars.imsi)) -> value rx_msg { - /* TODO: parse TEIC and TEID and store it in g_pars.remote_tei{c,d} */ - bid := rx_msg.gtpcv2_pdu.createSessionRequest.bearerContextGrouped[0].bearerContextIEs.ePS_Bearer_ID.ePS_Bearer_ID_Value; + /* Parse TEIC and Bearer EBI and TEID and store it in g_pars */ + g_pars.teic_remote := rx_msg.gtpcv2_pdu.createSessionRequest.fullyQualifiedTEID[0].tEID_GRE_Key; + rx_bctx_ies := rx_msg.gtpcv2_pdu.createSessionRequest.bearerContextGrouped[0].bearerContextIEs; + g_pars.bearer.ebi := rx_bctx_ies.ePS_Bearer_ID.ePS_Bearer_ID_Value; + g_pars.bearer.teid_remote := rx_bctx_ies.fullyQualifiedTEID[0].tEID_GRE_Key; /* allocate + register TEID-C on local side */ - g_pars.teic := f_gtp2_allocate_teid(); - g_pars.teid := g_pars.teic; + g_pars.teic_local := f_gtp2_allocate_teid(); + g_pars.bearer.teid_local := g_pars.teic_local; /* Upon rx of CreateSession, emulate PGW asking the AAA server. */ f_S6b_AA_success(); - fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S2b_ePDG_GTPC, g_pars.teic, 0, + fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S2b_ePDG_GTPC, g_pars.teic_local, 0, f_inet_addr(mp_s2b_local_ip), omit); - fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_ePDG_GTPU, g_pars.teid, 2, + fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_ePDG_GTPU, g_pars.bearer.teid_local, 2, f_inet_addr(mp_s2b_local_ip), omit); paa := ts_GTP2C_PdnAddrAlloc_v4(f_inet_addr(g_pars.ue_ip)); - bctx_ies := ts_GTP2C_BcContextIE(bid := bid, + bctx_ies := ts_GTP2C_BcContextIE(ebi := g_pars.bearer.ebi, teid_list := { fteid_u_ie }, qos := ts_GTP2C_BearerQos('09'O, 0,0,0,0), - charging_id := ts_GTP2C_ChargingID(g_pars.teic)); + charging_id := ts_GTP2C_ChargingID(g_pars.teic_local)); GTP2.send(ts_GTP2C_CreateSessionResp({ fteid_c_ie }, paa, { ts_GTP2C_BcGrouped(bctx_ies) } )); setverdict(pass); } @@ -428,6 +441,26 @@ as_GTP2C_CreateSession_success(); } +/* Expect DeleteBearerResponse */ +private altstep as_GTP2C_DeleteBearer_success() runs on EPDG_ConnHdlr { + var PDU_GTPCv2 rx_msg; + var template (value) FullyQualifiedTEID fteid_c_ie, fteid_u_ie; + var template (value) PDN_AddressAllocation paa; + + [] GTP2.receive(tr_GTP2C_DeleteBearerResp(g_pars.teic_local)) -> value rx_msg { + setverdict(pass); + } + [] GTP2.receive(PDU_GTPCv2:?) -> value rx_msg { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected GTP2C msg rx: ", rx_msg)); + } +} +private function f_GTP2C_DeleteBearer_success() runs on EPDG_ConnHdlr { + var integer proc_trans_id := 3; + /* f_gtp2_register_udmsg('63'O); TODO: is this needed? */ + GTP2.send(ts_GTP2C_DeleteBearerReq(g_pars.teic_remote, proc_trans_id, g_pars.bearer.ebi, Access_changed_from_Non_3GPP_to_3GPP)); + as_GTP2C_DeleteBearer_success(); +} + /* GSUP AuthInfo Req + Resp, triggers SWx MAR + MAA. */ private function f_GSUP_AI_success() runs on EPDG_ConnHdlr { var GSUP_PDU rx_gsup; @@ -495,8 +528,25 @@ setverdict(pass); } +private function f_TC_ho_wifi_to_lte(charstring id) runs on EPDG_ConnHdlr { + f_TC_authinfo_normal(id); + /* Whenever UE goes back to 3GPP, PGW will notify us with a Delete Brearer Request + * cause="Access changed from non-3gpp to 3gpp" */ + f_GTP2C_DeleteBearer_success(); +} + +testcase TC_ho_wifi_to_lte() runs on MTC_CT { + var EPDG_ConnHdlrPars pars := f_init_pars(); + var EPDG_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_ho_wifi_to_lte), pars); + vc_conn.done; + setverdict(pass); +} + control { execute ( TC_authinfo_normal() ); + execute ( TC_ho_wifi_to_lte() ); } } diff --git a/library/GTPv2_Templates.ttcn b/library/GTPv2_Templates.ttcn index e1e71f0..6ea06a2 100644 --- a/library/GTPv2_Templates.ttcn +++ b/library/GTPv2_Templates.ttcn @@ -506,11 +506,11 @@ /* 8.28 */ template (value) BearerContextIEs -ts_GTP2C_BcContextIE(template (value) uint4_t bid, +ts_GTP2C_BcContextIE(template (value) uint4_t ebi, template (omit) FullyQualifiedTEID_List teid_list := omit, template (omit) Bearer_QoS qos := ts_GTP2C_BearerQos('09'O, 0,0,0,0), template (omit) ChargingID charging_id := omit) := { - ePS_Bearer_ID := ts_GTP2C_EpsBearerId(bid), + ePS_Bearer_ID := ts_GTP2C_EpsBearerId(ebi), cause := ts_GTP2C_Cause(Request_accepted, '0'B), ePS_Bearer_TFT := omit, fullyQualifiedTEID := teid_list, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34895?usp=email 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: I299faf28fa51dbc5d2de6c72a39a01eca67a5775 Gerrit-Change-Number: 34895 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • ...
  • 185
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.