Change in ...osmo-ggsn[master]: libgtp: Introduce cb_recovery3

laforge gerrit-no-reply at lists.osmocom.org
Thu Aug 29 05:28:09 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/15266 )

Change subject: libgtp: Introduce cb_recovery3
......................................................................

libgtp: Introduce cb_recovery3

Since osmo-ggsn can manage several GSN structures simultaneously, it
needs the gsn_t pointer to know the ggsn it should forward the call to.

Related: OS#4165
Change-Id: I33b4fe594d5833993af01cce34737e61e597b320
---
M gtp/gtp.c
M gtp/gtp.h
2 files changed, 23 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/gtp/gtp.c b/gtp/gtp.c
index f0318f7..f70f534 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -219,6 +219,8 @@
 		gsn->cb_recovery(peer, recovery);
 	if (gsn->cb_recovery2)
 		gsn->cb_recovery2(peer, pdp, recovery);
+	if (gsn->cb_recovery3)
+		gsn->cb_recovery3(gsn, peer, pdp, recovery);
 }
 
 int gtp_set_cb_recovery(struct gsn_t *gsn,
@@ -242,6 +244,21 @@
 	return 0;
 }
 
+/* cb_recovery()
+ * pdp may be NULL if Recovery IE was received from a message independent
+ * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the
+ * local setup. In case pdp is known, caller may want to keep that pdp alive to
+ * handle subsequent msg cb as this specific pdp ctx is still valid according to
+ * specs.
+ */
+int gtp_set_cb_recovery3(struct gsn_t *gsn,
+			 int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer,
+					      struct pdp_t *pdp, uint8_t recovery))
+{
+	gsn->cb_recovery3 = cb_recovery3;
+	return 0;
+}
+
 int gtp_set_cb_data_ind(struct gsn_t *gsn,
 			       int (*cb_data_ind) (struct pdp_t * pdp,
 						   void *pack, unsigned len))
diff --git a/gtp/gtp.h b/gtp/gtp.h
index c2c5122..f2a4e1d 100644
--- a/gtp/gtp.h
+++ b/gtp/gtp.h
@@ -277,6 +277,7 @@
 	int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len);
 	int (*cb_recovery) (struct sockaddr_in * peer, uint8_t recovery);
 	int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery);
+	int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery);
 
 	/* Counters */
 
@@ -373,6 +374,11 @@
 int gtp_set_cb_recovery2(struct gsn_t *gsn,
 			int (*cb) (struct sockaddr_in * peer,
 				   struct pdp_t * pdp,
+				   uint8_t recovery))
+	OSMO_DEPRECATED("Use gtp_set_cb_recovery3() instead, to obtain gsn handling the recovery");;
+int gtp_set_cb_recovery3(struct gsn_t *gsn,
+			int (*cb) (struct gsn_t * gsn, struct sockaddr_in * peer,
+				   struct pdp_t * pdp,
 				   uint8_t recovery));
 
 void gtp_clear_queues(struct gsn_t *gsn);

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

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I33b4fe594d5833993af01cce34737e61e597b320
Gerrit-Change-Number: 15266
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190829/e506fa76/attachment.html>


More information about the gerrit-log mailing list