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 -----
  • December
  • 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

August 2023

  • 1 participants
  • 1514 discussions
[S] Change in osmo-sgsn[master]: sgsn_rim: get rid of MME check in sgsn_rim_rx_from_gtp:
by dexter 09 Aug '23

09 Aug '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/34120 ) Change subject: sgsn_rim: get rid of MME check in sgsn_rim_rx_from_gtp: ...................................................................... sgsn_rim: get rid of MME check in sgsn_rim_rx_from_gtp: There is no point in checking the MME any further. When the message has reached this code path it is about to be forwarded to BSSGP, so the MME does not play a role in the following code pathes. Change-Id: I97c89aeb11537ae54d1fbea48c75619d8a92af61 Related: OS#6095 --- M include/osmocom/sgsn/sgsn_rim.h M src/sgsn/sgsn_libgtp.c M src/sgsn/sgsn_rim.c 3 files changed, 25 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/20/34120/1 diff --git a/include/osmocom/sgsn/sgsn_rim.h b/include/osmocom/sgsn/sgsn_rim.h index aa5a726..f43b09a 100644 --- a/include/osmocom/sgsn/sgsn_rim.h +++ b/include/osmocom/sgsn/sgsn_rim.h @@ -3,4 +3,4 @@ struct sgsn_mme_ctx; int sgsn_rim_rx_from_gb(struct osmo_bssgp_prim *bp, struct msgb *msg); -int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu, struct sgsn_mme_ctx *mme); +int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu); diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index 7c08e6f..156f730 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -712,7 +712,7 @@ } msgb_free(msg); - return sgsn_rim_rx_from_gtp(&pdu, mme); + return sgsn_rim_rx_from_gtp(&pdu); ret_error: msgb_free(msg); diff --git a/src/sgsn/sgsn_rim.c b/src/sgsn/sgsn_rim.c index 4ba672e..c4a4a78 100644 --- a/src/sgsn/sgsn_rim.c +++ b/src/sgsn/sgsn_rim.c @@ -91,35 +91,24 @@ } /* Receive a RIM PDU from GTPv1C (EUTRAN) */ -int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu, struct sgsn_mme_ctx *mme) +int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu) { - struct sgsn_mme_ctx *mme_tmp; if (pdu->routing_info_src.discr != BSSGP_RIM_ROUTING_INFO_EUTRAN) { - LOGMME(mme, DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected src %s, got %s\n", - bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_EUTRAN), - bssgp_rim_routing_info_discr_str(pdu->routing_info_src.discr)); + LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected src %s, got %s\n", + bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_EUTRAN), + bssgp_rim_routing_info_discr_str(pdu->routing_info_src.discr)); return -EINVAL; } if (pdu->routing_info_dest.discr != BSSGP_RIM_ROUTING_INFO_GERAN) { - LOGMME(mme, DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected dst %s, got %s\n", - bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN), - bssgp_rim_routing_info_discr_str(pdu->routing_info_dest.discr)); + LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected dst %s, got %s\n", + bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN), + bssgp_rim_routing_info_discr_str(pdu->routing_info_dest.discr)); return -EINVAL; } - mme_tmp = sgsn_mme_ctx_by_route(sgsn, &pdu->routing_info_src.eutran.tai); - if (!mme_tmp)/* See if we have a default route configured */ - mme_tmp = sgsn_mme_ctx_by_default_route(sgsn); - if (mme != mme_tmp) { - LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: " - "Source MME doesn't have RIM routing configured for TAI: %s\n", - bssgp_rim_ri_name(&pdu->routing_info_src)); - return -EINVAL; - } - - LOGMME(mme, DRIM, LOGL_INFO, "Rx GTP RAN Information Relay for dest cell %s\n", - bssgp_rim_ri_name(&pdu->routing_info_dest)); + LOGP(DRIM, LOGL_INFO, "Rx GTP RAN Information Relay for dest cell %s\n", + bssgp_rim_ri_name(&pdu->routing_info_dest)); return sgsn_bssgp_fwd_rim_to_geran(pdu); } -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/34120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I97c89aeb11537ae54d1fbea48c75619d8a92af61 Gerrit-Change-Number: 34120 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-sgsn[master]: sgsn_rim: improve comment
by dexter 09 Aug '23

09 Aug '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/34119 ) Change subject: sgsn_rim: improve comment ...................................................................... sgsn_rim: improve comment Let's describe more clear what we do in sgsn_bssgp_fwd_rim_to_geran Related: OS#6095 Change-Id: I54aa82845515bcaa6badc9e0e87fa6248333430e --- M src/sgsn/sgsn_rim.c 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/19/34119/1 diff --git a/src/sgsn/sgsn_rim.c b/src/sgsn/sgsn_rim.c index 07eff6b..4ba672e 100644 --- a/src/sgsn/sgsn_rim.c +++ b/src/sgsn/sgsn_rim.c @@ -21,6 +21,7 @@ struct bssgp_bvc_ctx *bvc_ctx; OSMO_ASSERT(pdu->routing_info_dest.discr == BSSGP_RIM_ROUTING_INFO_GERAN); + /* Resolve RIM ROUTING ADDRESS to a BVC context */ bvc_ctx = btsctx_by_raid_cid(&pdu->routing_info_dest.geran.raid, pdu->routing_info_dest.geran.cid); if (!bvc_ctx) { LOGP(DRIM, LOGL_ERROR, "Unable to find NSEI for destination cell %s\n", @@ -28,7 +29,7 @@ return -EINVAL; } - /* Forward PDU as it is to the correct interface */ + /* Forward PDU to the NSEI of the resolved BVC context */ return bssgp_tx_rim(pdu, bvc_ctx->nsei); } -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/34119 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I54aa82845515bcaa6badc9e0e87fa6248333430e Gerrit-Change-Number: 34119 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-sgsn[master]: sgsn_rim: do not check the origin of a RIM message
by dexter 09 Aug '23

09 Aug '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/34121 ) Change subject: sgsn_rim: do not check the origin of a RIM message ...................................................................... sgsn_rim: do not check the origin of a RIM message When we forward RIM messages from GTP to BSSGP, we do not have to check the origin of the message since it does not matter from which origin the message came when we are forwarding it. Related: OS#6095 Change-Id: Iea8176dcfe64c25d207bafc0ef61ca9d9ad415be --- M src/sgsn/sgsn_rim.c 1 file changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/21/34121/1 diff --git a/src/sgsn/sgsn_rim.c b/src/sgsn/sgsn_rim.c index c4a4a78..c6f8dcd 100644 --- a/src/sgsn/sgsn_rim.c +++ b/src/sgsn/sgsn_rim.c @@ -93,13 +93,6 @@ /* Receive a RIM PDU from GTPv1C (EUTRAN) */ int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu) { - if (pdu->routing_info_src.discr != BSSGP_RIM_ROUTING_INFO_EUTRAN) { - LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected src %s, got %s\n", - bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_EUTRAN), - bssgp_rim_routing_info_discr_str(pdu->routing_info_src.discr)); - return -EINVAL; - } - if (pdu->routing_info_dest.discr != BSSGP_RIM_ROUTING_INFO_GERAN) { LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected dst %s, got %s\n", bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN), -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/34121 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iea8176dcfe64c25d207bafc0ef61ca9d9ad415be Gerrit-Change-Number: 34121 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-sgsn[master]: sgsn_rim: forward message based on RIM ROUTING ADDRESS
by dexter 09 Aug '23

09 Aug '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/34122 ) Change subject: sgsn_rim: forward message based on RIM ROUTING ADDRESS ...................................................................... sgsn_rim: forward message based on RIM ROUTING ADDRESS At the moment we parse the RAN TRANSPARENT CONTAINER to look at the destination RIM ROUTING INFORMATION. This is not corredt. The SGSN should not decode the RAN TRANSPARENT CONTAINER and use the RIM ROUTING ADDRESS / RIM ROUTING ADDRESS DISCRIMINATOR IE to make the routing decision. Related: OS#6095 Change-Id: Ifd2b915ed2f05130cff8ee77714b82005c17de3d --- M include/osmocom/sgsn/sgsn_rim.h M src/sgsn/sgsn_libgtp.c M src/sgsn/sgsn_rim.c 3 files changed, 79 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/22/34122/1 diff --git a/include/osmocom/sgsn/sgsn_rim.h b/include/osmocom/sgsn/sgsn_rim.h index f43b09a..fc87b46 100644 --- a/include/osmocom/sgsn/sgsn_rim.h +++ b/include/osmocom/sgsn/sgsn_rim.h @@ -3,4 +3,4 @@ struct sgsn_mme_ctx; int sgsn_rim_rx_from_gb(struct osmo_bssgp_prim *bp, struct msgb *msg); -int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu); +int sgsn_rim_rx_from_gtp(struct msgb *msg, struct bssgp_rim_routing_info *rim_routing_address); diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index 156f730..cd8ef4f 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -695,9 +695,43 @@ LOGMME(mme, DGTP, LOGL_INFO, "Rx GTP RAN Information Relay\n"); + int rc; unsigned int len = 0; - struct msgb *msg = msgb_alloc(4096, "gtpcv1_ran_info"); - struct bssgp_ran_information_pdu pdu; + struct msgb *msg = bssgp_msgb_alloc(); + + uint8_t rim_ra_encoded[1024]; + unsigned int rim_ra_encoded_len = 0; + struct bssgp_rim_routing_info rim_ra; + + /* Read RIM Routing Address Discriminator (optional) */ + if (gtpie_gettlv(ie, GTPIE_RIM_RA_DISCR, 0, &rim_ra_encoded_len, rim_ra_encoded, + sizeof(rim_ra_encoded)) || rim_ra_encoded_len <= 0) { + LOGMME(mme, DGTP, LOGL_NOTICE, "Rx GTP RAN Information Relay: No RIM Routing Address Discriminator IE found!\n"); + + /* It is not an error when the RIM ROUTING ADDRESS DISCRIMINATOR IE is missing. The RIM ROUTING ADDRESS + * DISCRIMINATOR IE is an optional IE. When it is missing, the RIM Routing Address shall be processed + * as an RNC address ("0001") See also: 3GPP TS 29.060 */ + rim_ra_encoded[0] = BSSGP_RIM_ROUTING_INFO_UTRAN; + } + + /* Read RIM Routing Address (optional) */ + if (gtpie_gettlv(ie, GTPIE_RIM_ROUT_ADDR, 0, &rim_ra_encoded_len, rim_ra_encoded + 1, + sizeof(rim_ra_encoded) - 1) || rim_ra_encoded_len <= 0) { + LOGMME(mme, DGTP, LOGL_ERROR, "Rx GTP RAN Information Relay: No RIM Routing Address IE found!\n"); + + /* TODO: The (usually included) RIM ROUTING ADDRESS field is an optional field. However, we cannot + * proceed without a destination address. A possible way to fix this would be a default route that + * can be configured via the VTY. */ + goto ret_error; + } else { + rim_ra_encoded_len += 1; + rc = bssgp_parse_rim_ri(&rim_ra, rim_ra_encoded, rim_ra_encoded_len); + if (rc < 0) { + LOGMME(mme, DGTP, LOGL_ERROR, + "Rx GTP RAN Information Relay: Failed parsing RIM Routing Address/RIM Routing Address Discriminator IE!\n"); + goto ret_error; + } + } if (gtpie_gettlv(ie, GTPIE_RAN_T_CONTAIN, 0, &len, msgb_data(msg), 4096) || len <= 0) { LOGMME(mme, DGTP, LOGL_ERROR, "Rx GTP RAN Information Relay: No Transparent Container IE found!\n"); @@ -706,13 +740,8 @@ msgb_put(msg, len); msgb_bssgph(msg) = msg->data; msgb_nsei(msg) = 0; - if (bssgp_parse_rim_pdu(&pdu, msg) < 0) { - LOGMME(mme, DGTP, LOGL_ERROR, "Rx GTP RAN Information Relay: Failed parsing Transparent Container IE!\n"); - goto ret_error; - } - msgb_free(msg); - return sgsn_rim_rx_from_gtp(&pdu); + return sgsn_rim_rx_from_gtp(msg, &rim_ra); ret_error: msgb_free(msg); diff --git a/src/sgsn/sgsn_rim.c b/src/sgsn/sgsn_rim.c index c6f8dcd..40e1f90 100644 --- a/src/sgsn/sgsn_rim.c +++ b/src/sgsn/sgsn_rim.c @@ -33,6 +33,23 @@ return bssgp_tx_rim(pdu, bvc_ctx->nsei); } +static int sgsn_bssgp_fwd_rim_to_geran_encoded(struct msgb *msg, struct bssgp_rim_routing_info *rim_routing_address) +{ + struct bssgp_bvc_ctx *bvc_ctx; + OSMO_ASSERT(rim_routing_address->discr == BSSGP_RIM_ROUTING_INFO_GERAN); + + /* Resolve RIM ROUTING ADDRESS to a BVC context */ + bvc_ctx = btsctx_by_raid_cid(&rim_routing_address->geran.raid, rim_routing_address->geran.cid); + if (!bvc_ctx) { + LOGP(DRIM, LOGL_ERROR, "Unable to find NSEI for destination cell %s\n", + bssgp_rim_ri_name(rim_routing_address)); + return -EINVAL; + } + + /* Forward PDU to the NSEI of the resolved BVC context */ + return bssgp_tx_rim_encoded(msg, bvc_ctx->nsei); +} + static int sgsn_bssgp_fwd_rim_to_eutran(const struct bssgp_ran_information_pdu *pdu) { struct sgsn_mme_ctx *mme; @@ -91,17 +108,20 @@ } /* Receive a RIM PDU from GTPv1C (EUTRAN) */ -int sgsn_rim_rx_from_gtp(struct bssgp_ran_information_pdu *pdu) +int sgsn_rim_rx_from_gtp(struct msgb *msg, struct bssgp_rim_routing_info *rim_routing_address) { - if (pdu->routing_info_dest.discr != BSSGP_RIM_ROUTING_INFO_GERAN) { + /* TODO: In this code path, we currently only support RIM message forwarding to GERAN (BSSGP). However, it + * technically also be possible to route a message back to GTP (BSSGP_RIM_ROUTING_INFO_EUTRAN) or to + * IuPS (BSSGP_RIM_ROUTING_INFO_UTRAN) */ + if (rim_routing_address->discr != BSSGP_RIM_ROUTING_INFO_GERAN) { LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected dst %s, got %s\n", bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN), - bssgp_rim_routing_info_discr_str(pdu->routing_info_dest.discr)); + bssgp_rim_routing_info_discr_str(rim_routing_address->discr)); return -EINVAL; } LOGP(DRIM, LOGL_INFO, "Rx GTP RAN Information Relay for dest cell %s\n", - bssgp_rim_ri_name(&pdu->routing_info_dest)); + bssgp_rim_ri_name(rim_routing_address)); - return sgsn_bssgp_fwd_rim_to_geran(pdu); + return sgsn_bssgp_fwd_rim_to_geran_encoded(msg, rim_routing_address); } -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/34122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ifd2b915ed2f05130cff8ee77714b82005c17de3d Gerrit-Change-Number: 34122 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: gprs_bssgp_rim: also print NSEI when sending RIM messages
by laforge 09 Aug '23

09 Aug '23
Attention is currently required from: dexter. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34116 ) Change subject: gprs_bssgp_rim: also print NSEI when sending RIM messages ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2595abff28fc1d89c1409a2ca0194fedc6f15313 Gerrit-Change-Number: 34116 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Wed, 09 Aug 2023 14:47:47 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: l1ctl: Fill ph_data_param fn field
by laforge 09 Aug '23

09 Aug '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34115 ) Change subject: l1ctl: Fill ph_data_param fn field ...................................................................... l1ctl: Fill ph_data_param fn field Related: OS#3626 Change-Id: I3317296b2bda1088a2af81ba9b135714f8393afd --- M src/host/layer23/src/common/l1ctl.c 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c index 7f15c39..08fb646 100644 --- a/src/host/layer23/src/common/l1ctl.c +++ b/src/host/layer23/src/common/l1ctl.c @@ -317,6 +317,7 @@ PRIM_OP_INDICATION, msg); pp.u.data.chan_nr = dl->chan_nr; pp.u.data.link_id = dl->link_id; + pp.u.data.fn = dl->frame_nr; /* send it up into LAPDm */ return lapdm_phsap_up(&pp.oph, le); -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34115 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I3317296b2bda1088a2af81ba9b135714f8393afd Gerrit-Change-Number: 34115 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmocom-bb[master]: l1ctl: Fill ph_data_param fn field
by laforge 09 Aug '23

09 Aug '23
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34115 ) Change subject: l1ctl: Fill ph_data_param fn field ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34115 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I3317296b2bda1088a2af81ba9b135714f8393afd Gerrit-Change-Number: 34115 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 09 Aug 2023 14:46:38 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTP_Templates: Add templates for RIM ROUTING ADDRESS
by laforge 09 Aug '23

09 Aug '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34075 ) Change subject: GTP_Templates: Add templates for RIM ROUTING ADDRESS ...................................................................... GTP_Templates: Add templates for RIM ROUTING ADDRESS The IE types RIM_RoutingAddress and RIM_RoutingAddress_Discriminator have not coresponding templates yet. Related: OS#6095 Change-Id: If79f94ac3b7ec9a76763141ee2d8cac50c69d60b --- M library/GTP_Templates.ttcn 1 file changed, 39 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 5ead042..267e2a7 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -1442,4 +1442,30 @@ peer := peer, gtpu := ts_GTP1U_PDU('FF'O, seq, teid, { g_PDU_IEs := { data := data }}) } + + /* 3GPP TS 29.060, section 7.7.57 */ + template (value) RIM_RoutingAddress ts_RIM_RoutingAddress(octetstring addr_value) := { + type_gtpc := '9F'O, + lengthf := 0, /* we assume encoder overwrites this */ + rIM_RoutingAddressValue := addr_value + } + template (present) RIM_RoutingAddress tr_RIM_RoutingAddress(template (present) octetstring addr_value := ?) := { + type_gtpc := '9F'O, + lengthf := ?, + rIM_RoutingAddressValue := addr_value + } + + /* 3GPP TS 29.060, section 7.7.77 */ + template (value) RIM_RoutingAddress_Discriminator ts_RIM_RoutingAddress_Discriminator(bitstring addr_discr) := { + type_gtpc := 'B2'O, + lengthf := 0, /* we assume encoder overwrites this */ + rra_discriminator := addr_discr, + spare := '0000'B + } + template (present) RIM_RoutingAddress_Discriminator tr_RIM_RoutingAddress_Discriminator(template (present) bitstring addr_discr := ?) := { + type_gtpc := 'B2'O, + lengthf := ?, + rra_discriminator := addr_discr, + spare := '0000'B + } } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34075 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: If79f94ac3b7ec9a76763141ee2d8cac50c69d60b Gerrit-Change-Number: 34075 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> 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
[L] Change in osmo-ttcn3-hacks[master]: MME_Tests: add testcase TC_RIM_RAN_INF
by laforge 09 Aug '23

09 Aug '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937 ) ( 7 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: MME_Tests: add testcase TC_RIM_RAN_INF ...................................................................... MME_Tests: add testcase TC_RIM_RAN_INF The proposed testcase models a full RIM RAN INFORMATION REQUEST that originates at the eNB (S1AP), is forwarded by the MME towards GERAN (GTP) and goes back towards the MME (GTP) and is eventually forwarded by the MME back to the eNB (S1AP). Related: OS#5760 Related: OS#5759 Change-Id: I22d5aaab64df2824099977fb574afb86a4b7e91f --- M mme/MME_Tests.ttcn 1 file changed, 293 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn index cf6bcfc..ebfb673 100644 --- a/mme/MME_Tests.ttcn +++ b/mme/MME_Tests.ttcn @@ -18,6 +18,8 @@ import from S1AP_Emulation all; import from S1AP_PDU_Descriptions all; import from S1AP_IEs all; +import from S1AP_PDU_Contents all; +import from S1AP_Constants all; import from NAS_EPS_Types all; import from NAS_Templates all; @@ -40,6 +42,7 @@ import from L3_Templates all; import from DNS_Helpers all; import from Osmocom_Types all; +import from Osmocom_Gb_Types all; friend module MME_Tests_SGsAP; @@ -84,6 +87,35 @@ var UeParams g_ue_pars[NUM_UE]; } +/* Encode an S1AP Global-ENB-ID into an octetstring */ +private function enc_S1AP_Global_ENB_ID(Global_ENB_ID global_enb_id) return octetstring { + + /* Due to the limitations of libfftranscode, we can not define encoders (or decoders) for individual + * information elements (in S1AP_Types.cc). Unfortuantely Global-ENB-ID also appears in BSSGP in its + * encoded form. (see also: GTP-C 3GPP TS 48.018, section 11.3.70). To encode a given Global-ENB-ID + * we craft a full S1AP PDU and encode it. Then we can cut out the encoded Global-ENB-ID from the + * generated octetstring. */ + + var SupportedTAs supported_tas_dummy := {{ + tAC := '0000'O, + broadcastPLMNs := { '00f000'O }, + iE_Extensions := omit + }}; + var octetstring encoded; + var integer global_enb_id_len; + + if (ispresent(global_enb_id.eNB_ID.macroENB_ID)) { + global_enb_id_len := 8; + } else { + /* All other ENB ID types fit into 8 byte (homeENB_ID, short_macroENB_ID, long_macroENB_ID) */ + global_enb_id_len := 9; + } + + encoded := enc_S1AP_PDU(valueof(ts_S1AP_SetupReq(global_enb_id, supported_tas_dummy, v32))); + + return substr(encoded, 11, global_enb_id_len); +} + type component ConnHdlr extends S1AP_ConnHdlr, SGsAP_ConnHdlr, DIAMETER_ConnHdlr, GTP_ConnHdlr { var ConnHdlrPars g_pars; timer g_Tguard := 30.0; @@ -629,13 +661,257 @@ vc_conn.done; } +external function enc_PDU_GTPC_RAN_INF_REQ(in PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC gtpc_pdu) return octetstring +with { extension "prototype(convert)" + extension "encode(RAW)" + } + +external function enc_PDU_GTPC_RAN_INF(in PDU_BSSGP_RAN_INFORMATION_GTPC gtpc_pdu) return octetstring +with { extension "prototype(convert)" + extension "encode(RAW)" + } + +function f_convert_plmn(OCT3 pLMNidentity) return hexstring { + var hexstring pLMNidentity_hex := oct2hex(pLMNidentity); + var hexstring pLMNidentity_hex_swapped; + pLMNidentity_hex_swapped[0] := pLMNidentity_hex[1]; + pLMNidentity_hex_swapped[1] := pLMNidentity_hex[0]; + pLMNidentity_hex_swapped[2] := pLMNidentity_hex[3]; + pLMNidentity_hex_swapped[3] := pLMNidentity_hex[2]; + pLMNidentity_hex_swapped[4] := pLMNidentity_hex[5]; + pLMNidentity_hex_swapped[5] := pLMNidentity_hex[4]; + return pLMNidentity_hex_swapped; +} + +/* Make a template for a GTPC BSSGP container that contains a RAN INFORMATION REQUEST. The template can be used to + * craft the request for the S1AP/S1-MME interface and also to verfify the contents of the coresponding request on + * the GTPC/Gn interface */ +private function f_make_ts_GTPC_RAN_Information_Request(GTP_CellId geran_gtp_ci) + runs on ConnHdlr return template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC { + var template (value) RIM_Routing_Address_GTPC gtpc_dst_addr, gtpc_src_addr; + var template (value) RAN_Information_Request_RIM_Container_GTPC gtpc_rim_req_cont; + var template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC gtpc_bssgp_cont; + var octetstring gnbid; + var GTP_CellId eutran_gtp_ci; + eutran_gtp_ci.ra_id.lai.mcc_mnc := f_convert_plmn(g_pars.enb_pars[g_pars.mme_idx].global_enb_id.pLMNidentity); + + gnbid := enc_S1AP_Global_ENB_ID(g_pars.enb_pars[g_pars.mme_idx].global_enb_id); + gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(geran_gtp_ci); + gtpc_src_addr := t_GTPC_RIM_Routing_Address_enbid(eutran_gtp_ci, + oct2int(g_pars.enb_pars[g_pars.mme_idx].supported_tas[0].tAC), + gnbid); + + gtpc_rim_req_cont := ts_GTPC_RAN_Information_Request_RIM_Container( + ts_GTPC_RIM_Application_Identity(RIM_APP_ID_NACC), + ts_GTPC_RIM_Sequence_Number(1), + ts_GTPC_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), + ts_GTPC_RIM_Protocol_Version_Number(1), + tsu_GTPC_RAN_Information_Request_Application_Container_NACC(geran_gtp_ci), + omit); + gtpc_bssgp_cont := ts_GTPC_RAN_Information_Request( + ts_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr), + ts_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr), + gtpc_rim_req_cont); + + return gtpc_bssgp_cont; +} + +private function f_make_tr_GTPC_RAN_Information_Request(GTP_CellId geran_gtp_ci) + runs on ConnHdlr return template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC { + var template (present) RIM_Routing_Address_GTPC gtpc_dst_addr, gtpc_src_addr; + var template (present) RAN_Information_Request_RIM_Container_GTPC gtpc_rim_req_cont; + var template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC gtpc_bssgp_cont; + var octetstring gnbid; + var GTP_CellId eutran_gtp_ci; + eutran_gtp_ci.ra_id.lai.mcc_mnc := f_convert_plmn(g_pars.enb_pars[g_pars.mme_idx].global_enb_id.pLMNidentity); + + gnbid := enc_S1AP_Global_ENB_ID(g_pars.enb_pars[g_pars.mme_idx].global_enb_id); + gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(geran_gtp_ci); + gtpc_src_addr := t_GTPC_RIM_Routing_Address_enbid(eutran_gtp_ci, + oct2int(g_pars.enb_pars[g_pars.mme_idx].supported_tas[0].tAC), + gnbid); + + gtpc_rim_req_cont := tr_GTPC_RAN_Information_Request_RIM_Container( + ts_GTPC_RIM_Application_Identity(RIM_APP_ID_NACC), + ts_GTPC_RIM_Sequence_Number(1), + ts_GTPC_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), + ts_GTPC_RIM_Protocol_Version_Number(1), + tru_GTPC_RAN_Information_Request_Application_Container_NACC(geran_gtp_ci)); + gtpc_bssgp_cont := tr_GTPC_RAN_Information_Request( + tr_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr), + tr_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr), + gtpc_rim_req_cont); + + return gtpc_bssgp_cont; +} + +/* Make initial RAN INFORMATION REQUEST message that is sent on the S1AP/S1-MME interface */ +private function f_make_ts_S1AP_eNBDirectInfTrans(GTP_CellId geran_gtp_ci) + runs on ConnHdlr return template (value) S1AP_PDU { + var template (value) Inter_SystemInformationTransferType inf; + + inf.rIMTransfer.rIMInformation := enc_PDU_GTPC_RAN_INF_REQ(valueof(f_make_ts_GTPC_RAN_Information_Request(geran_gtp_ci))); + inf.rIMTransfer.rIMRoutingAddress.gERAN_Cell_ID.lAI.pLMNidentity := hex2oct(f_convert_plmn(hex2oct(geran_gtp_ci.ra_id.lai.mcc_mnc))); + inf.rIMTransfer.rIMRoutingAddress.gERAN_Cell_ID.lAI.lAC := int2oct(geran_gtp_ci.ra_id.lai.lac, 2); + inf.rIMTransfer.rIMRoutingAddress.gERAN_Cell_ID.lAI.iE_Extensions := omit; + inf.rIMTransfer.rIMRoutingAddress.gERAN_Cell_ID.rAC := int2oct(geran_gtp_ci.ra_id.rac, 1); + inf.rIMTransfer.rIMRoutingAddress.gERAN_Cell_ID.cI := int2oct(geran_gtp_ci.cell_id, 2); + inf.rIMTransfer.rIMRoutingAddress.gERAN_Cell_ID.iE_Extensions := omit; + inf.rIMTransfer.iE_Extensions := omit; + + return ts_S1AP_eNBDirectInfTrans(inf); +} + +/* Make RAN INFORMATION (response) message that is sent on the GTPC/Gn interface */ +private function f_make_ts_GTPC_RANInfoRelay(template Gtp1cUnitdata req_gtpc_pdu, + GTP_CellId geran_gtp_ci, octetstring geran_si) + runs on ConnHdlr return template (value) Gtp1cUnitdata { + var template Gtp1cUnitdata res_gtpc_pdu; + var template RAN_Information_RIM_Container_GTPC gtpc_rim_res_cont; + var template PDU_BSSGP_RAN_INFORMATION_GTPC gtpc_bssgp_rim_res_pdu; + var template RIM_Routing_Information_GTPC gtpc_rim_dst_cell_id, gtpc_rim_src_cell_id; + var template RIM_RoutingAddress gtpc_rim_ra; + var template RIM_RoutingAddress_Discriminator gtpc_rim_ra_discr; + + /* Assemble GTPC RAN Information */ + gtpc_rim_res_cont := ts_GTPC_RAN_Information_RIM_Container(ts_GTPC_RIM_Application_Identity(RIM_APP_ID_NACC), + ts_GTPC_RIM_Sequence_Number(2), + ts_GTPC_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), + ts_GTPC_RIM_Protocol_Version_Number(1), + tsu_GTPC_ApplContainer_or_ApplErrContainer_NACC(tsu_GTPC_ApplContainer_NACC(geran_gtp_ci, false, 3, geran_si)), + omit); + + /* The source becomes the destination and vice versa */ + gtpc_rim_dst_cell_id := req_gtpc_pdu.gtpc.gtpc_pdu.ranInformationRelay.transparentContainer. + rANTransparentContainerField.pDU_BSSGP_RAN_INFORMATION_REQUEST.source_Cell_Identifier + gtpc_rim_src_cell_id := req_gtpc_pdu.gtpc.gtpc_pdu.ranInformationRelay.transparentContainer. + rANTransparentContainerField.pDU_BSSGP_RAN_INFORMATION_REQUEST.destination_Cell_Identifier + gtpc_bssgp_rim_res_pdu := ts_GTPC_RAN_Information(gtpc_rim_dst_cell_id, + gtpc_rim_src_cell_id, + gtpc_rim_res_cont); + + /* Assemble RIM Routing Address (essentially a copy of the destination cell identifier)*/ + gtpc_rim_ra := ts_RIM_RoutingAddress(enc_RIM_Routing_Address_GTPC(valueof(gtpc_rim_dst_cell_id.rIM_Routing_Address))); + gtpc_rim_ra_discr := ts_RIM_RoutingAddress_Discriminator(hex2bit(valueof(gtpc_rim_dst_cell_id.rIMRoutingAddressDiscriminator))); + + res_gtpc_pdu := ts_GTPC_RANInfoRelay(g_gn_iface_peer, + ts_RANTransparentContainer_RAN_INFO(gtpc_bssgp_rim_res_pdu), + gtpc_rim_ra, gtpc_rim_ra_discr); + + return res_gtpc_pdu; +} + +/* Make template to verify the RAN INFORMATION REQUEST as it appears on the GTPC/Gn interface */ +private function f_make_tr_GTPC_MsgType(GTP_CellId geran_gtp_ci) + runs on ConnHdlr return template (present) Gtp1cUnitdata { + var template Gtp1cUnitdata msg; + var template GTPC_PDUs pdus; + var template RANTransparentContainer ran_transp_cont; + + ran_transp_cont := tr_RANTransparentContainer_RAN_INFO_REQ( + f_make_tr_GTPC_RAN_Information_Request(geran_gtp_ci)); + pdus := tr_RANInfoRelay(ran_transp_cont); + msg := tr_GTPC_MsgType(g_gn_iface_peer, rANInformationRelay, '00000000'O, pdus); + + return msg; +} + +/* Make template to verify the RAN INFORMATION (response) as it appears on the S1AP/S1-MME interface */ +private function f_make_tr_S1AP_MMEDirectInfTrans(Gtp1cUnitdata ran_information_gtpc_pdu) + runs on ConnHdlr return template (present) S1AP_PDU { + var template S1AP_PDU msg; + var template Inter_SystemInformationTransferType inf; + + inf.rIMTransfer.rIMInformation := enc_PDU_GTPC_RAN_INF( + ran_information_gtpc_pdu.gtpc.gtpc_pdu.ranInformationRelay. + transparentContainer.rANTransparentContainerField. + pDU_BSSGP_RAN_INFORMATION); + inf.rIMTransfer.rIMRoutingAddress := omit; + inf.rIMTransfer.iE_Extensions := omit; + msg := tr_S1AP_MMEDirectInfTrans(inf); + + return msg; +} + +private function f_TC_RIM_RAN_INF(ConnHdlrPars pars) runs on ConnHdlr { + timer T := 5.0; + f_init_handler(pars); + f_gtp_register_teid('00000000'O); + var Gtp1cUnitdata req_gtpc_pdu; + var Gtp1cUnitdata resp_gtpc_pdu; + var GTP_CellId geran_gtp_ci; + + /* Assemble data of a fictitiously GERAN cell */ + geran_gtp_ci.ra_id.rac := oct2int('BB'O); + geran_gtp_ci.ra_id.lai.mcc_mnc := '262f42'H + geran_gtp_ci.ra_id.lai.lac := oct2int('AAAA'O); + geran_gtp_ci.cell_id := oct2int('04C7'O); + const octetstring geran_si1 := '198fb100000000000000000000000000007900002b'O; + const octetstring geran_si3 := '1b753000f110236ec9033c2747407900003c0b2b2b'O; + const octetstring geran_si13 := '009000185a6fc9e08410ab2b2b2b2b2b2b2b2b2b2b'O; + const octetstring geran_si := geran_si1 & geran_si3 & geran_si13; + + /* Send initial RAN information request via S1AP to MME and expect the MME to forward the request on GTP-C + * (eNB -> MME -> SGSN) */ + S1AP.send(f_make_ts_S1AP_eNBDirectInfTrans(geran_gtp_ci)); + T.start; + alt { + [] GTP.receive(f_make_tr_GTPC_MsgType(geran_gtp_ci)) -> value req_gtpc_pdu { + setverdict(pass); + } + [] GTP.receive { + setverdict(fail, "unexpected GTPC message from MME"); + } + [] T.timeout { + setverdict(fail, "no GTPC RAN INFORMATION REQUEST from MME"); + } + } + + /* Send RAN information response via GTP-C to MME and expect the MME to forward the respnse on S1AP + * (SGSN -> MME -> eNB) */ + f_create_s1ap_expect_proc(id_MMEDirectInformationTransfer, self); + resp_gtpc_pdu := valueof(f_make_ts_GTPC_RANInfoRelay(req_gtpc_pdu, geran_gtp_ci, geran_si)); + GTP.send(resp_gtpc_pdu); + T.start; + alt { + [] S1AP.receive(f_make_tr_S1AP_MMEDirectInfTrans(resp_gtpc_pdu)) { + setverdict(pass); + } + [] S1AP.receive { + setverdict(fail, "unexpected S1AP message from MME"); + } + [] T.timeout { + setverdict(fail, "no S1AP RAN INFORMATION from MME"); + } + } + + setverdict(pass); +} + +testcase TC_RIM_RAN_INF() runs on MTC_CT { + var charstring id := testcasename(); + + f_init_diameter(id); + f_init_s1ap(id, 4); + f_s1ap_setup(0); + f_init_gtp(id); + + timer T := 3.0; + + var ConnHdlrPars pars := f_init_pars(ue_idx := 0); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_TC_RIM_RAN_INF), pars); + + vc_conn.done; +} + control { execute( TC_s1ap_setup_wrong_plmn() ); execute( TC_s1ap_setup_wrong_tac() ); execute( TC_s1ap_setup() ); execute( TC_s1ap_attach() ); execute( TC_gn_echo_request() ); + execute( TC_RIM_RAN_INF() ); } - } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937 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: I22d5aaab64df2824099977fb574afb86a4b7e91f Gerrit-Change-Number: 33937 Gerrit-PatchSet: 8 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: GTP_Templates: add template restriction qualifiers
by laforge 09 Aug '23

09 Aug '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34087 ) Change subject: GTP_Templates: add template restriction qualifiers ...................................................................... GTP_Templates: add template restriction qualifiers The GTP Templates lack the template restriction qualifiers (present, value, omit) in many places. Related: OS#6095 Change-Id: Ic439b4ae85b417fde0ddfb8fa00758d6486b57c8 --- M library/GTP_Templates.ttcn 1 file changed, 195 insertions(+), 177 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index ebd9142..5ead042 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -64,7 +64,7 @@ } /* generalized GTP-C receive template */ - template PDU_GTPC tr_GTP1C_PDU(template OCT1 msg_type, template OCT4 teid, template GTPC_PDUs pdu := ?) := { + template (present) PDU_GTPC tr_GTP1C_PDU(template (present) OCT1 msg_type, template (present) OCT4 teid, template (present) GTPC_PDUs pdu := ?) := { /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an * error if this flag is set to '1'. */ pn_bit := '0'B, @@ -84,7 +84,7 @@ } /* generalized GTP-C send template */ - template PDU_GTPC ts_GTP1C_PDU(OCT1 msg_type, OCT4 teid, GTPC_PDUs pdu, uint16_t seq_nr) := { + template (value) PDU_GTPC ts_GTP1C_PDU(OCT1 msg_type, OCT4 teid, GTPC_PDUs pdu, uint16_t seq_nr) := { /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an * error if this flag is set to '1'. */ pn_bit := '0'B, @@ -109,18 +109,18 @@ } /* recovery IE */ - template Recovery_gtpc ts_Recovery(OCT1 restart_counter) := { + template (value) Recovery_gtpc ts_Recovery(OCT1 restart_counter) := { type_gtpc := '0E'O, restartCounter := restart_counter } - template Recovery_gtpc tr_Recovery(template OCT1 restart_counter) := { + template (present) Recovery_gtpc tr_Recovery(template (present) OCT1 restart_counter) := { type_gtpc := '0E'O, restartCounter := restart_counter } /* IMEI(SV) IE TS 29.060 7.7.53 */ - template IMEISV_gtpc ts_IMEISV(template (value) OCT8 imeisv) := { + template (value) IMEISV_gtpc ts_IMEISV(template (value) OCT8 imeisv) := { type_gtpc := '9A'O, lengthf := 8, imeisv := imeisv @@ -133,7 +133,7 @@ return ts_IMEISV(imeisv); } - template IMEISV_gtpc tr_IMEISV(template (present) OCT8 imeisv) := { + template (present) IMEISV_gtpc tr_IMEISV(template (present) OCT8 imeisv) := { type_gtpc := '9A'O, lengthf := 8, imeisv := imeisv @@ -176,7 +176,7 @@ } /* Charging Characteristics IE TS 29.060 7.7.23 */ - template ChargingCharacteristics_GTPC ts_ChargingCharacteristics(template (value) OCT2 chargingChar) := { + template (value) ChargingCharacteristics_GTPC ts_ChargingCharacteristics(template (value) OCT2 chargingChar) := { type_gtpc := '1A'O, chargingChar := chargingChar } @@ -188,22 +188,25 @@ return ts_ChargingCharacteristics(chargingChar); } - template ChargingCharacteristics_GTPC tr_ChargingCharacteristics(template (present) OCT2 chargingChar) := { + template (present) ChargingCharacteristics_GTPC tr_ChargingCharacteristics(template (present) OCT2 chargingChar) := { type_gtpc := '1A'O, chargingChar := chargingChar } /* template matching reception of GTP-C unit-data */ - template Gtp1cUnitdata tr_GTPC_MsgType(template GtpPeer peer, template OCT1 msg_type, template OCT4 teid, template GTPC_PDUs pdus := ?) := { + template (present) Gtp1cUnitdata tr_GTPC_MsgType(template (present) GtpPeer peer, + template (present) OCT1 msg_type, + template (present) OCT4 teid, + template (present) GTPC_PDUs pdus := ?) := { peer := peer, gtpc := tr_GTP1C_PDU(msg_type, teid, pdus) } /* template matching reception of GTP-C echo-request */ - template Gtp1cUnitdata tr_GTPC_PING(template GtpPeer peer) := tr_GTPC_MsgType(peer, echoRequest, '00000000'O); + template (present) Gtp1cUnitdata tr_GTPC_PING(template (present) GtpPeer peer) := tr_GTPC_MsgType(peer, echoRequest, '00000000'O); - template GTPC_PDUs tr_EchoRespPDU(template OCT1 restart_counter) := { + template (present) GTPC_PDUs tr_EchoRespPDU(template (present) OCT1 restart_counter) := { echoResponse := { recovery := tr_Recovery(restart_counter), private_extension_gtpc := * @@ -211,9 +214,9 @@ } /* template matching reception of GTP-C echo-response */ - template Gtp1cUnitdata tr_GTPC_PONG(template GtpPeer peer) := tr_GTPC_MsgType(peer, echoResponse, '00000000'O, tr_EchoRespPDU(?)); + template (present) Gtp1cUnitdata tr_GTPC_PONG(template (present) GtpPeer peer) := tr_GTPC_MsgType(peer, echoResponse, '00000000'O, tr_EchoRespPDU(?)); - template GTPC_PDUs ts_EchoRespPDU(OCT1 restart_counter) := { + template (value) GTPC_PDUs ts_EchoRespPDU(OCT1 restart_counter) := { echoResponse := { recovery := ts_Recovery(restart_counter), private_extension_gtpc := omit @@ -221,24 +224,24 @@ } /* master template for senidng a GTP-C echo response */ - template Gtp1cUnitdata ts_GTPC_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { + template (value) Gtp1cUnitdata ts_GTPC_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { peer := peer, gtpc := ts_GTP1C_PDU(echoResponse, '00000000'O, valueof(ts_EchoRespPDU(rest_ctr)), seq) } - template GTPC_PDUs ts_EchoReqPDU := { + template (value) GTPC_PDUs ts_EchoReqPDU := { echoRequest := { private_extension_gtpc := omit } } /* master template for sending a GTP-C echo request */ - template Gtp1cUnitdata ts_GTPC_PING(GtpPeer peer, uint16_t seq) := { + template (value) Gtp1cUnitdata ts_GTPC_PING(GtpPeer peer, uint16_t seq) := { peer := peer, gtpc := ts_GTP1C_PDU(echoRequest, '00000000'O, valueof(ts_EchoReqPDU), seq) } - private function f_eua_ipv4_len(template OCT4 ip_addr) return template integer { + private function f_eua_ipv4_len(template (present) OCT4 ip_addr) return template integer { if (istemplatekind(ip_addr, "omit")) { return 2; } else if (istemplatekind(ip_addr, "*")) { @@ -249,7 +252,7 @@ return 6; } - private function f_eua_ipv6_len(template OCT16 ip_addr) return template integer { + private function f_eua_ipv6_len(template (omit) OCT16 ip_addr) return template (present) integer { if (istemplatekind(ip_addr, "omit")) { return 2; } else if (istemplatekind(ip_addr, "*")) { @@ -260,7 +263,7 @@ return 18; } - private function f_eua_ipv4v6_len(template OCT4 ip_addr4, template OCT16 ip_addr6) return template integer { + private function f_eua_ipv4v6_len(template (omit) OCT4 ip_addr4, template (omit) OCT16 ip_addr6) return template (present) integer { var integer len := 2; if (istemplatekind(ip_addr4, "*") or istemplatekind(ip_addr6, "*")) { @@ -288,7 +291,7 @@ } } template EndUserAddress t_EuaIPv4Dyn := t_EuaIPv4(omit); - template EndUserAddress tr_EuaIPv4(template OCT4 ip_addr) modifies t_EuaIPv4 := { + template (present) EndUserAddress tr_EuaIPv4(template (present) OCT4 ip_addr) modifies t_EuaIPv4 := { endUserAddress := { endUserAddressIPv4 := { lengthf := f_eua_ipv4_len(ip_addr) @@ -309,7 +312,7 @@ } } template EndUserAddress t_EuaIPv6Dyn := t_EuaIPv6(omit); - template EndUserAddress tr_EuaIPv6(template OCT16 ip_addr) modifies t_EuaIPv6 := { + template (present) EndUserAddress tr_EuaIPv6(template (present) OCT16 ip_addr) modifies t_EuaIPv6 := { endUserAddress := { endUserAddressIPv6 := { lengthf := f_eua_ipv6_len(ip_addr) @@ -332,7 +335,8 @@ } } template EndUserAddress t_EuaIPv4Dynv6Dyn := t_EuaIPv4v6(omit, omit); - template EndUserAddress tr_EuaIPv4v6(template OCT4 ip_addr4, template OCT16 ip_addr6) modifies t_EuaIPv4v6 := { + template (present) EndUserAddress tr_EuaIPv4v6(template (present) OCT4 ip_addr4, + template (present) OCT16 ip_addr6) modifies t_EuaIPv4v6 := { endUserAddress := { endUserAddressIPv4andIPv6 := { lengthf := f_eua_ipv4v6_len(ip_addr4, ip_addr6) @@ -340,25 +344,25 @@ } } - template AccessPointName ts_APN(octetstring apn) := { + template (value) AccessPointName ts_APN(octetstring apn) := { type_gtpc := '83'O, lengthf := lengthof(apn), apn_value := apn } - template GSN_Address_GTPC ts_GsnAddr(octetstring ip_addr) := { + template (value) GSN_Address_GTPC ts_GsnAddr(octetstring ip_addr) := { type_gtpc := '85'O, lengthf := lengthof(ip_addr), addressf := ip_addr } - template MSISDN ts_Msisdn(octetstring msisdn) := { + template (value) MSISDN ts_Msisdn(octetstring msisdn) := { type_gtpc := '86'O, lengthf := lengthof(msisdn), msisdn := msisdn } - template QualityOfServiceProfile ts_QosDefault := { + template (value) QualityOfServiceProfile ts_QosDefault := { type_gtpc := '87'O, lengthf := 17, allocRetensionPrio := '00'O, @@ -393,7 +397,7 @@ } } - template IMSI_gtpc ts_Imsi(hexstring digits) := { + template (value) IMSI_gtpc ts_Imsi(hexstring digits) := { type_gtpc := '02'O, digits := digits, padding := 'F'H @@ -415,9 +419,9 @@ template (value) GeographicLocationCGI ts_GeographicLocationCGI(template (value) hexstring mcc, - template (value) hexstring mnc, - template (value) OCT2 lac, - template (value) OCT2 cI_value) := + template (value) hexstring mnc, + template (value) OCT2 lac, + template (value) OCT2 cI_value) := { mccDigit1 := mcc[0], mccDigit2 := mcc[1], @@ -429,15 +433,15 @@ cI_value := cI_value } - template GTPC_PDUs ts_CreatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, - BIT4 nsapi, EndUserAddress eua, octetstring apn, - octetstring sgsn_ip_sign, octetstring sgsn_ip_data, - octetstring msisdn, template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit, - template (omit) OCT2 charging_char := omit, - template (omit) OCT8 imeisv := omit, - template(omit) MS_TimeZone ms_tz := omit) := { + template (value) GTPC_PDUs ts_CreatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, + BIT4 nsapi, EndUserAddress eua, octetstring apn, + octetstring sgsn_ip_sign, octetstring sgsn_ip_data, + octetstring msisdn, template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit, + template (omit) OCT2 charging_char := omit, + template (omit) OCT8 imeisv := omit, + template (omit) MS_TimeZone ms_tz := omit) := { createPDPContextRequest := { imsi := ts_Imsi(imsi), rai := omit, @@ -493,17 +497,17 @@ } } - template Gtp1cUnitdata ts_GTPC_CreatePDP(GtpPeer peer, uint16_t seq, hexstring imsi, - OCT1 restart_ctr, OCT4 teid_data, - OCT4 teid_ctrl, BIT4 nsapi, EndUserAddress eua, - octetstring apn, octetstring sgsn_ip_sign, - octetstring sgsn_ip_data, octetstring msisdn, - template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit, - template (omit) OCT2 charging_char := omit, - template (omit) OCT8 imeisv := omit, - template(omit) MS_TimeZone ms_tz := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_CreatePDP(GtpPeer peer, uint16_t seq, hexstring imsi, + OCT1 restart_ctr, OCT4 teid_data, + OCT4 teid_ctrl, BIT4 nsapi, EndUserAddress eua, + octetstring apn, octetstring sgsn_ip_sign, + octetstring sgsn_ip_data, octetstring msisdn, + template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit, + template (omit) OCT2 charging_char := omit, + template (omit) OCT8 imeisv := omit, + template (omit) MS_TimeZone ms_tz := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextRequest, '00000000'O, valueof(ts_CreatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl, @@ -513,12 +517,12 @@ } - template GTPC_PDUs ts_UpdatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, - BIT4 nsapi, - octetstring sgsn_ip_sign, octetstring sgsn_ip_data, - template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit) := { + template (value) GTPC_PDUs ts_UpdatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, + BIT4 nsapi, + octetstring sgsn_ip_sign, octetstring sgsn_ip_data, + template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit) := { updatePDPContextRequest := { updatePDPContextRequestSGSN := { imsi := ts_Imsi(imsi), @@ -565,13 +569,13 @@ } } - template Gtp1cUnitdata ts_GTPC_UpdatePDP(GtpPeer peer, OCT4 teid, uint16_t seq, hexstring imsi, - OCT1 restart_ctr, OCT4 teid_data, - OCT4 teid_ctrl, BIT4 nsapi, octetstring sgsn_ip_sign, - octetstring sgsn_ip_data, - template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_UpdatePDP(GtpPeer peer, OCT4 teid, uint16_t seq, hexstring imsi, + OCT1 restart_ctr, OCT4 teid_data, + OCT4 teid_ctrl, BIT4 nsapi, octetstring sgsn_ip_sign, + octetstring sgsn_ip_data, + template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(updatePDPContextRequest, teid, valueof(ts_UpdatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl, @@ -580,23 +584,23 @@ } - template NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { + template (value) NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { type_gtpc := '14'O, nsapi := nsapi, unused := '0000'B } - template ReorderingRequired ts_ReorderReq(boolean req := false) := { + template (value) ReorderingRequired ts_ReorderReq(boolean req := false) := { type_gtpc := '08'O, reordreq := bool2bit(req), spare := '0000000'B } - template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, - octetstring ggsn_ip_sign, octetstring ggsn_ip_data, - OCT4 chg_id, template EndUserAddress eua := omit, - template Recovery_gtpc recovery := omit, - template ProtConfigOptions pco := omit) := { + template (value) GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, + octetstring ggsn_ip_sign, octetstring ggsn_ip_data, + OCT4 chg_id, template (omit) EndUserAddress eua := omit, + template (omit) Recovery_gtpc recovery := omit, + template (omit) ProtConfigOptions pco := omit) := { createPDPContextResponse := { cause := { '00'O, cause }, reorderingRequired := ts_ReorderReq(false), @@ -634,14 +638,14 @@ } } - template Gtp1cUnitdata ts_GTPC_CreatePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, - OCT1 cause, - OCT4 teid_ctrl, OCT4 teid_data, - BIT4 nsapi, octetstring ggsn_ip_sign, - octetstring ggsn_ip_data, OCT4 chg_id, - template EndUserAddress eua := omit, - template Recovery_gtpc recovery := omit, - template ProtConfigOptions pco := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_CreatePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, + OCT1 cause, + OCT4 teid_ctrl, OCT4 teid_data, + BIT4 nsapi, octetstring ggsn_ip_sign, + octetstring ggsn_ip_data, OCT4 chg_id, + template (omit) EndUserAddress eua := omit, + template (omit) Recovery_gtpc recovery := omit, + template (omit) ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid, valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi, @@ -650,7 +654,7 @@ } /* PCO send base template */ - template ProtConfigOptions ts_PCO := { + template (value) ProtConfigOptions ts_PCO := { type_gtpc := '84'O, lengthf := 0, configProtocol := '000'B, @@ -659,7 +663,7 @@ protocols := {} } /* PCO receive base template */ - template ProtConfigOptions tr_PCO := { + template (present) ProtConfigOptions tr_PCO := { type_gtpc := '84'O, lengthf := ?, configProtocol := '000'B, @@ -668,18 +672,18 @@ protocols := {} } - template ProtConfigOptions ts_PCO_IPv6_DNS modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv6_DNS modifies ts_PCO := { protocols := { { protocolID := '0003'O, lengthProtoID := 0, protoIDContents := ''O } } } - template ProtConfigOptions tr_PCO_IPv6_DNS_resp(template OCT16 contents) modifies tr_PCO := { + template (present) ProtConfigOptions tr_PCO_IPv6_DNS_resp(template (present) OCT16 contents) modifies tr_PCO := { protocols := { *, { protocolID := '0003'O, lengthProtoID := 16, protoIDContents := contents }, * } } - template ProtConfigOptions ts_PCO_IPv4_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser in the GGSN can properly iterate over * the list of protocols, see Change-Id Icc2e6716c33d78d3c3e000f529806228d8aa155e */ @@ -689,7 +693,7 @@ } } - template ProtConfigOptions ts_PCO_IPv4_PRI_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_PRI_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser can cope with a single primary DNS entry * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ @@ -698,7 +702,7 @@ enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Primary)) } } } - template ProtConfigOptions ts_PCO_IPv4_SEC_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_SEC_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser can cope with a single secondary DNS entry * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ @@ -707,7 +711,7 @@ enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Secondary)) } } } - template ProtConfigOptions ts_PCO_IPv4_SEPARATE_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_SEPARATE_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser can cope with a primary and secondary DNS * in separate IPCP containers OS#3381 */ @@ -719,33 +723,33 @@ } } - template ProtocolElement tr_PCO_Proto(OCT2 prot_id) := { + template (present) ProtocolElement tr_PCO_Proto(OCT2 prot_id) := { protocolID := prot_id, lengthProtoID := ?, protoIDContents := ? } - template ProtocolElement ts_PCOelem_PAP_broken := { + template (value) ProtocolElement ts_PCOelem_PAP_broken := { protocolID := 'C023'O, lengthProtoID := 60, /* PPP Password Authentication Protocol containing incorrect Peer-Id-Length set to 4 (6-7 should be the valid one), see OS#3914. */ protoIDContents := '0100003c'O & '0444435338323700bc1c08087c1508083e00790000150808fd06000001000000000000000000000000000000000000000000000000000000'O } - template ProtConfigOptions ts_PCO_PAP_IPv4_DNS modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_PAP_IPv4_DNS modifies ts_PCO := { protocols := { ts_PCOelem_PAP_broken, { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := enc_IpcpPacket(valueof(ts_IPCP_ReqDNS)) } } } - template ProtConfigOptions tr_PCO_Contains(OCT2 prot_id) modifies tr_PCO := { + template (present) ProtConfigOptions tr_PCO_Contains(OCT2 prot_id) modifies tr_PCO := { protocols := { *, tr_PCO_Proto(prot_id), * } } - template ProtConfigOptions ts_PCO_IPv4_DNS_CONT modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_DNS_CONT modifies ts_PCO := { protocols := { { protocolID := '000d'O, lengthProtoID := 0, protoIDContents := ''O } } } - template ProtConfigOptions tr_PCO_IPv4_DNS_CONT_resp(template OCT4 contents) modifies tr_PCO := { + template (present) ProtConfigOptions tr_PCO_IPv4_DNS_CONT_resp(template (present) OCT4 contents) modifies tr_PCO := { protocols := { *, { protocolID := '000d'O, lengthProtoID := 4, protoIDContents := contents }, * } @@ -768,42 +772,43 @@ return ''O; } - template IpcpPacket tr_IPCP(template LcpCode code, template uint8_t identifier, - template IpcpOptionList opts) := { + template (present) IpcpPacket tr_IPCP(template (present) LcpCode code, template (present)uint8_t identifier, + template (present) IpcpOptionList opts) := { code := code, identifier := identifier, len := ?, options := opts } - template IpcpOption tr_IPCP_PrimaryDns(template OCT4 addr) := { + template (present) IpcpOption tr_IPCP_PrimaryDns(template (present) OCT4 addr) := { code := IPCP_OPT_PrimaryDNS, len := 6, data := addr } - template IpcpOption tr_IPCP_SecondaryDns(template OCT4 addr) := { + template (present) IpcpOption tr_IPCP_SecondaryDns(template (present) OCT4 addr) := { code := IPCP_OPT_SecondaryDNS, len := 6, data := addr } - template IpcpPacket tr_IPCP_Ack_DNS(template uint8_t identifier := ?, template OCT4 dns1 := ?, - template OCT4 dns2 := ?) := + template (present) IpcpPacket tr_IPCP_Ack_DNS(template (present) uint8_t identifier := ?, + template (present) OCT4 dns1 := ?, + template (present) OCT4 dns2 := ?) := tr_IPCP(LCP_Configure_Ack, identifier, { *, tr_IPCP_PrimaryDns(dns1), *, tr_IPCP_SecondaryDns(dns2), * }); - template IpcpPacket ts_IPCP(LcpCode code, uint8_t identifier, template IpcpOptionList opts) := { + template (value) IpcpPacket ts_IPCP(LcpCode code, uint8_t identifier, template (value) IpcpOptionList opts) := { code := code, identifier := identifier, len := 0, /* overwritten */ options := opts } - template IpcpPacket ts_IPCP_ReqDNS(uint8_t identifier := 0) := + template (value) IpcpPacket ts_IPCP_ReqDNS(uint8_t identifier := 0) := ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_PrimaryDns('00000000'O), tr_IPCP_SecondaryDns('00000000'O) }); - template IpcpPacket ts_IPCP_ReqDNS_Primary(uint8_t identifier := 0) := + template (value) IpcpPacket ts_IPCP_ReqDNS_Primary(uint8_t identifier := 0) := ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_PrimaryDns('00000000'O) }); - template IpcpPacket ts_IPCP_ReqDNS_Secondary(uint8_t identifier := 0) := + template (value) IpcpPacket ts_IPCP_ReqDNS_Secondary(uint8_t identifier := 0) := ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_SecondaryDns('00000000'O) }); @@ -819,7 +824,7 @@ return ret; } - template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := { + template (value) GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := { deletePDPContextRequest := { cause := omit, tearDownIndicator := f_teardown_ind_IE(teardown_ind), @@ -837,15 +842,15 @@ } } - template Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid, - BIT4 nsapi, template (omit) BIT1 teardown_ind) := { + template (value) Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid, + BIT4 nsapi, template (omit) BIT1 teardown_ind) := { peer := peer, gtpc := ts_GTP1C_PDU(deletePDPContextRequest, teid, valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) } - template GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, - template ProtConfigOptions pco := omit) := { + template (value) GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, + template (omit) ProtConfigOptions pco := omit) := { deletePDPContextResponse := { cause := { '00'O, cause }, protConfigOptions := pco, @@ -856,9 +861,9 @@ } } - template Gtp1cUnitdata ts_GTPC_DeletePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, - OCT1 cause, - template ProtConfigOptions pco := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_DeletePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, + OCT1 cause, + template (omit) ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(deletePDPContextResponse, teid, valueof(ts_DeletePdpRespPDU(cause, pco)), seq) @@ -903,7 +908,7 @@ }, rIMProtocolVersionNumber := int2oct(ver, 1) } - function tr_GTPC_Cell_Identifier_V(template GTP_CellId cid) return template Cell_Identifier_V_GTPC { + function tr_GTPC_Cell_Identifier_V(template (present) GTP_CellId cid) return template (present) Cell_Identifier_V_GTPC { var template Cell_Identifier_V_GTPC ret := { mccDigit1 := ?, mccDigit2 := ?, @@ -915,11 +920,7 @@ rac := ?, cI_value := ? } - if (istemplatekind(cid, "omit")) { - return omit; - } else if (istemplatekind(cid, "*")) { - return *; - } else if (istemplatekind(cid, "?")) { + if (istemplatekind(cid, "?")) { return ?; } if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { @@ -954,11 +955,13 @@ rac := int2oct(cid.ra_id.rac, 1), cI_value := int2oct(cid.cell_id, 2) } - template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(GTP_CellId cid) := { - cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) + template (value) RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(GTP_CellId cid) := { + cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) } - function tr_GTPC_ENB_Identifier(template GTP_CellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier { - var template ENB_Identifier ret := { + function tr_GTPC_ENB_Identifier(template (present) GTP_CellId cid, + template (present) integer tac, + template (present) octetstring gnbid) return template (present) ENB_Identifier { + var template (present) ENB_Identifier ret := { mccDigit1 := ?, mccDigit2 := ?, mccDigit3 := ?, @@ -968,11 +971,7 @@ tAC := ?, globalENB_ID := ? } - if (istemplatekind(cid, "omit") and istemplatekind(tac, "omit") and istemplatekind(gnbid, "omit")) { - return omit; - } else if (istemplatekind(cid, "*") and istemplatekind(tac, "*") and istemplatekind(gnbid, "*")) { - return *; - } else if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) { + if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) { return ?; } if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { @@ -1004,11 +1003,11 @@ tAC := int2oct(tac, 2), globalENB_ID := gnbid } - template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(GTP_CellId cid, integer tac, octetstring gnbid) := { - eNB_Identifier := ts_GTPC_ENB_Identifier(cid, tac, gnbid) + template (value) RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(GTP_CellId cid, integer tac, octetstring gnbid) := { + eNB_Identifier := ts_GTPC_ENB_Identifier(cid, tac, gnbid) } - template RIM_Routing_Information_GTPC - tr_GTPC_RIM_Routing_Information(HEX1 addr_discr, template RIM_Routing_Address_GTPC addr) := { + template (present) RIM_Routing_Information_GTPC + tr_GTPC_RIM_Routing_Information(HEX1 addr_discr, template (present) RIM_Routing_Address_GTPC addr) := { iEI := '54'O, ext := '1'B, lengthIndicator := { @@ -1030,8 +1029,8 @@ rIM_Routing_Address := addr } /* 3GPP TS 48.018 11.3.63.1.1 */ - template RAN_Information_Request_Application_Container_NACC_GTPC - tr_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := { + template (present) RAN_Information_Request_Application_Container_NACC_GTPC + tr_GTPC_RAN_Information_Request_Application_Container_NACC(template (present) GTP_CellId cid) := { iEI := '4D'O, ext := '1'B, lengthIndicator := { @@ -1049,8 +1048,8 @@ reporting_Cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) } /* 3GPP TS 48.018 11.3.63.1 */ - template RAN_Information_Request_Application_Container_GTPC - tru_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := { + template (present) RAN_Information_Request_Application_Container_GTPC + tru_GTPC_RAN_Information_Request_Application_Container_NACC(template (present) GTP_CellId cid) := { nacc := tr_GTPC_RAN_Information_Request_Application_Container_NACC(cid) } template (value) RAN_Information_Request_Application_Container_GTPC @@ -1058,8 +1057,8 @@ nacc := ts_GTPC_RAN_Information_Request_Application_Container_NACC(cid) } /* 3GPP TS 48.018 11.3.63.2.1 */ - template RAN_Information_Application_Container_NACC_GTPC - tr_GTPC_RAN_Information_Application_Container_NACC(template GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + template (present) RAN_Information_Application_Container_NACC_GTPC + tr_GTPC_RAN_Information_Application_Container_NACC(template (present) GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { iEI := '4E'O, ext := '1'B, lengthIndicator := { @@ -1116,10 +1115,10 @@ source_Cell_Identifier := src, rIM_Container := cont } - template PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC - tr_GTPC_RAN_Information_Request(template RIM_Routing_Information_GTPC dest := ?, - template RIM_Routing_Information_GTPC src := ?, - template RAN_Information_Request_RIM_Container_GTPC cont := ?) := { + template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC + tr_GTPC_RAN_Information_Request(template (present) RIM_Routing_Information_GTPC dest := ?, + template (present) RIM_Routing_Information_GTPC src := ?, + template (present) RAN_Information_Request_RIM_Container_GTPC cont := ?) := { bssgpPduType := '71'O, destination_Cell_Identifier := dest, source_Cell_Identifier := src, @@ -1133,7 +1132,7 @@ pDU_BSSGP_RAN_INFORMATION_REQUEST := pdu } } - template RANTransparentContainer tr_RANTransparentContainer_RAN_INFO_REQ(template PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC pdu := ?) := { + template (present) RANTransparentContainer tr_RANTransparentContainer_RAN_INFO_REQ(template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC pdu := ?) := { type_gtpc := '90'O, lengthf := ?, rANTransparentContainerField := { @@ -1142,7 +1141,7 @@ } /* RAN_Information */ - template ApplContainer_or_ApplErrContainer_NACC_GTPC + template (present) ApplContainer_or_ApplErrContainer_NACC_GTPC tru_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { application_Container := tr_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) } @@ -1150,21 +1149,21 @@ tsu_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { application_Container := ts_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) } - template ApplContainer_or_ApplErrContainer_GTPC - tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(template ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { + template (present) ApplContainer_or_ApplErrContainer_GTPC + tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(template (present) ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { nacc := cont } template (value) ApplContainer_or_ApplErrContainer_GTPC tsu_GTPC_ApplContainer_or_ApplErrContainer_NACC(template (value) ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { nacc := cont } - template RAN_Information_RIM_Container_GTPC - tr_GTPC_RAN_Information_RIM_Container(template RIM_Application_Identity_GTPC app_id, - template RIM_Sequence_Number_GTPC seq, - template RIM_PDU_Indications_GTPC ind, - template RIM_Protocol_Version_Number_GTPC ver := omit, - template ApplContainer_or_ApplErrContainer_GTPC app_cont := omit, - template SON_TransferApplicationIdentity son_app_id := omit) := { + template (present) RAN_Information_RIM_Container_GTPC + tr_GTPC_RAN_Information_RIM_Container(template (present) RIM_Application_Identity_GTPC app_id, + template (present) RIM_Sequence_Number_GTPC seq, + template (present) RIM_PDU_Indications_GTPC ind, + template RIM_Protocol_Version_Number_GTPC ver := *, + template ApplContainer_or_ApplErrContainer_GTPC app_cont := *, + template SON_TransferApplicationIdentity son_app_id := *) := { iEI := '58'O, ext := '1'B, lengthIndicator := { @@ -1196,10 +1195,10 @@ applContainer_or_ApplErrContainer := app_cont, sON_TransferApplicationIdentity := son_app_id } - template PDU_BSSGP_RAN_INFORMATION_GTPC - tr_GTPC_RAN_Information(template RIM_Routing_Information_GTPC dest, - template RIM_Routing_Information_GTPC src, - template RAN_Information_RIM_Container_GTPC cont) := { + template (present) PDU_BSSGP_RAN_INFORMATION_GTPC + tr_GTPC_RAN_Information(template (present) RIM_Routing_Information_GTPC dest, + template (present) RIM_Routing_Information_GTPC src, + template (present) RAN_Information_RIM_Container_GTPC cont) := { bssgpPduType := '70'O, destination_Cell_Identifier := dest, source_Cell_Identifier := src, @@ -1214,7 +1213,7 @@ source_Cell_Identifier := src, rIM_Container := cont } - template RANTransparentContainer tr_RANTransparentContainer_RAN_INFO(template PDU_BSSGP_RAN_INFORMATION_GTPC pdu) := { + template (present) RANTransparentContainer tr_RANTransparentContainer_RAN_INFO(template (present) PDU_BSSGP_RAN_INFORMATION_GTPC pdu) := { type_gtpc := '90'O, lengthf := ?, rANTransparentContainerField := { @@ -1229,7 +1228,7 @@ } } - template RANTransparentContainer tr_RANTransparentContainer(template RANTransparentContainerField rANTransparentContainerField) := { + template (present) RANTransparentContainer tr_RANTransparentContainer(template (present) RANTransparentContainerField rANTransparentContainerField) := { type_gtpc := '90'O, lengthf := ?, rANTransparentContainerField := rANTransparentContainerField @@ -1239,7 +1238,7 @@ lengthf := 0, /* overwritten */ rANTransparentContainerField := rANTransparentContainerField } - template GTPC_PDUs tr_RANInfoRelay(template RANTransparentContainer transparentContainer) := { + template (present) GTPC_PDUs tr_RANInfoRelay(template (present) RANTransparentContainer transparentContainer) := { ranInformationRelay := { transparentContainer := transparentContainer, rIM_RoutingAddress := *, @@ -1257,9 +1256,9 @@ private_extension_gtpc := omit } } - template Gtp1cUnitdata - tr_GTPC_RANInfoRelay(template GtpPeer peer, - template RANTransparentContainer transparentContainer) := { + template (present) Gtp1cUnitdata + tr_GTPC_RANInfoRelay(template (present) GtpPeer peer, + template (present) RANTransparentContainer transparentContainer) := { peer := peer, gtpc := tr_GTP1C_PDU(rANInformationRelay, '00000000'O, tr_RANInfoRelay(transparentContainer)) } @@ -1273,10 +1272,10 @@ } - template RAN_Information_Request_RIM_Container_GTPC - tr_GTPC_RAN_Information_Request_RIM_Container(template RIM_Application_Identity_GTPC app_id := ?, - template RIM_Sequence_Number_GTPC seq := ?, - template RIM_PDU_Indications_GTPC ind := ?, + template (present) RAN_Information_Request_RIM_Container_GTPC + tr_GTPC_RAN_Information_Request_RIM_Container(template (present) RIM_Application_Identity_GTPC app_id := ?, + template (present) RIM_Sequence_Number_GTPC seq := ?, + template (present) RIM_PDU_Indications_GTPC ind := ?, template RIM_Protocol_Version_Number_GTPC ver := *, template RAN_Information_Request_Application_Container_GTPC app_cont := *, template SON_TransferApplicationIdentity son_app_id := *) := { @@ -1295,7 +1294,9 @@ /* GTP-U */ - template PDU_GTPU tr_GTP1U_PDU(template OCT1 msg_type, template OCT4 teid, template GTPU_IEs ies := ?) := { + template (present) PDU_GTPU tr_GTP1U_PDU(template (present) OCT1 msg_type, + template (present) OCT4 teid, + template (present) GTPU_IEs ies := ?) := { pn_bit := ?, s_bit := ?, e_bit := ?, @@ -1358,28 +1359,32 @@ gtpu_IEs := ies } - template Gtp1uUnitdata tr_GTPU_MsgType(template GtpPeer peer, template OCT1 msg_type, template OCT4 teid) := { + template (present) Gtp1uUnitdata tr_GTPU_MsgType(template (present) GtpPeer peer, + template (present) OCT1 msg_type, + template (present) OCT4 teid) := { peer := peer, gtpu := tr_GTP1U_PDU(msg_type, teid) } /* template matching reception of GTP-U echo-request/response */ - template Gtp1uUnitdata tr_GTPU_PING(template GtpPeer peer) := tr_GTPU_MsgType(peer, echoRequest, '00000000'O); - template Gtp1uUnitdata tr_GTPU_PONG(template GtpPeer peer) := tr_GTPU_MsgType(peer, echoResponse, '00000000'O); + template (present) Gtp1uUnitdata tr_GTPU_PING(template (present) GtpPeer peer) := tr_GTPU_MsgType(peer, echoRequest, '00000000'O); + template (present) Gtp1uUnitdata tr_GTPU_PONG(template (present) GtpPeer peer) := tr_GTPU_MsgType(peer, echoResponse, '00000000'O); /* template matching reception of GTP-U GPDU */ - template GTPU_IEs t_GPDU(template octetstring data) := { + template GTPU_IEs t_GPDU(template (present) octetstring data) := { g_PDU_IEs := { data := data } } - template Gtp1uUnitdata tr_GTPU_GPDU(template GtpPeer peer, template OCT4 teid, template octetstring data := ?) := { + template (present) Gtp1uUnitdata tr_GTPU_GPDU(template (present) GtpPeer peer, + template (present) OCT4 teid, + template (present) octetstring data := ?) := { peer := peer, gtpu := tr_GTP1U_PDU('FF'O, teid, t_GPDU(data)) } - template GTPU_IEs ts_UEchoReqPDU := { + template (present) GTPU_IEs ts_UEchoReqPDU := { echoRequest_IEs := { private_extension_gtpu := omit } @@ -1402,23 +1407,23 @@ } /* master template for sending a GTP-U echo response */ - template Gtp1uUnitdata ts_GTPU_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { + template (present) Gtp1uUnitdata ts_GTPU_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { peer := peer, gtpu := ts_GTP1U_PDU(echoResponse, seq, '00000000'O, valueof(ts_UEchoRespPDU(rest_ctr))) } - template GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { + template (value) GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { type_gtpu := '85'O, lengthf := lengthof(ip_addr), gSNAddressValue := ip_addr } - template TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { + template (value) TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { type_gtpu := '10'O, teidDataI := teid } - template GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { + template (value) GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { errorIndication_IEs := { teidDataI_gtpu := ts_UteidDataI(teid), gSNAddress_gtpu := ts_UGsnAddr(gsn_addr), @@ -1427,13 +1432,13 @@ } /* master template for sending a GTP-U Error indication */ - template Gtp1uUnitdata ts_GTPU_ErrorIndication(GtpPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { + template (value) Gtp1uUnitdata ts_GTPU_ErrorIndication(GtpPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { peer := peer, gtpu := ts_GTP1U_PDU('1A'O, seq, '00000000'O, valueof(ts_UErrorIndication(teid, gsn_addr))) } /* master template for sending a GTP-U user plane data */ - template Gtp1uUnitdata ts_GTP1U_GPDU(GtpPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { + template (value) Gtp1uUnitdata ts_GTP1U_GPDU(GtpPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { peer := peer, gtpu := ts_GTP1U_PDU('FF'O, seq, teid, { g_PDU_IEs := { data := data }}) } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34087 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: Ic439b4ae85b417fde0ddfb8fa00758d6486b57c8 Gerrit-Change-Number: 34087 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> 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
  • ← Newer
  • 1
  • ...
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • ...
  • 152
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.