pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/37594?usp=email )

Change subject: gtp: Allow tx Direct Tunnel Flags in UpdatePDPCtx{Req,Resp}
......................................................................

gtp: Allow tx Direct Tunnel Flags in UpdatePDPCtx{Req,Resp}

In Update PDP Ctx Response, only SGSN is expected to transmit Direct
Tunnel Flags in the message.

Related: SYS#5435
Change-Id: I36d93619e2fe9cafd3092515df18b82d29099d2d
---
M TODO-RELEASE
M gtp/gtp.c
M include/osmocom/gtp/pdp.h
3 files changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..1815fce 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
 # If any interfaces have been added since the last public release: c:r:a + 1.
 # If any interfaces have been removed or changed since the last public 
release: c:r:0.
 #library       what                    description / commit summary line
+libgtp    append new field  dir_tun_flags in struct pdp_t (older users not 
using the field should be fine since struct pdp_t is allocated internally)
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 245927b..62cad60 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -1686,6 +1686,11 @@
                gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_OMC_ID,
                          pdp->omcid.l, pdp->omcid.v);

+       /* Direct Tunnel Flags */
+       if ((pdp->version == 1) && pdp->dir_tun_flags.l)
+               gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_DIR_TUN_FLAGS,
+                         pdp->dir_tun_flags.l, pdp->dir_tun_flags.v);
+
        gtp_req(gsn, pdp->version, pdp, &packet, length, inetaddr, cbp);

        return 0;
@@ -1747,6 +1752,11 @@
                                  pdp->qos_neg.l, pdp->qos_neg.v);

                /* TODO: Charging gateway address */
+
+               /* Direct Tunnel Flags */
+               if ((gsn->mode == GTP_MODE_SGSN) && (version == 1) && 
pdp->dir_tun_flags.l)
+                       gtpie_tlv(&packet, &length, GTP_MAX, 
GTPIE_DIR_TUN_FLAGS,
+                               pdp->dir_tun_flags.l, pdp->dir_tun_flags.v);
        }

        return gtp_resp(version, gsn, pdp, &packet, length, peer,
diff --git a/include/osmocom/gtp/pdp.h b/include/osmocom/gtp/pdp.h
index 4dcdde4..da4a382 100644
--- a/include/osmocom/gtp/pdp.h
+++ b/include/osmocom/gtp/pdp.h
@@ -46,6 +46,11 @@
        unsigned char *v;
 };

+struct ul1_t {
+       unsigned int l;
+       unsigned char v[1];
+};
+
 struct ul16_t {
        unsigned int l;
        unsigned char v[16];
@@ -244,6 +249,8 @@
        bool tx_gpdu_seq;               /* Transmit (true) or suppress G-PDU 
sequence numbers */

        struct llist_head qmsg_list_req; /* list of req qmsg_t in retrans queue 
belonging this pdp ctx */
+
+       struct ul1_t dir_tun_flags; /* Direct Tunnel Flags, TS 29.060 7.7.81 */
 };

 /* functions related to pdp_t management */

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/37594?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I36d93619e2fe9cafd3092515df18b82d29099d2d
Gerrit-Change-Number: 37594
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to