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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Aug 22 14:59:58 UTC 2019


pespin has uploaded this change for review. ( 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, 22 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/66/15266/1

diff --git a/gtp/gtp.c b/gtp/gtp.c
index 94c3245..949b62a 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,20 @@
 	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..a1d5f18 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: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190822/a3e2ad47/attachment.htm>


More information about the gerrit-log mailing list