aboutsummaryrefslogtreecommitdiffstats
path: root/gtp/gtp.h
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-08-28 19:44:20 +0200
committerpespin <pespin@sysmocom.de>2019-09-05 09:59:52 +0000
commitc94837c6a401bf0f80791b619a9b4cfbe9160afd (patch)
tree9bd500fae6a49a1678c4ec3067ea49e3bab0fc08 /gtp/gtp.h
parent68c5a745570fa097406a574550dc393be01cf56b (diff)
gtp: Manage queue timers internally
Currently each user (application) of libgtp needs to manage its own timers in order to call gtp_retrans_timeout() and gtp_retrans() and maintain retransmit and duplicate queues working correctly. This adds unnecesary complexity to applications since nowadays, as a libosmocore user, libgtp can handle this internally in an easy way. Furthermore, keeping the timers internal to the library allows for easier extension of features as well as re-implementation of related code in the future. Last but not least, it was detected that existing known applications (osmo-sgsn, osmo-ggsn, sgsnemu) are not using correctly the API, since they should be updating their timers through gtp_retrans_timeout() everytime a message is enqueued/transmitted, otherwise they may fire gtp_retrans() for retransmition too late in some cases. Related: OS#4178 Change-Id: Ife7cfd66d6356f413263fe5bda9e43091f5c9e98
Diffstat (limited to 'gtp/gtp.h')
-rw-r--r--gtp/gtp.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gtp/gtp.h b/gtp/gtp.h
index f2a4e1d..e03d77d 100644
--- a/gtp/gtp.h
+++ b/gtp/gtp.h
@@ -14,6 +14,7 @@
#include <osmocom/core/utils.h>
#include <osmocom/core/defs.h>
+#include <osmocom/core/timer.h>
#include "pdp.h"
@@ -268,6 +269,8 @@ struct gsn_t {
struct pdp_t pdpa[PDP_MAX]; /* PDP storage */
struct pdp_t *hashtid[PDP_MAX]; /* Hash table for IMSI + NSAPI */
+ struct osmo_timer_list queue_timer; /* internal queue_{req,resp} timer */
+
/* Call back functions */
int (*cb_delete_context) (struct pdp_t *);
int (*cb_create_context_ind) (struct pdp_t *);
@@ -348,8 +351,8 @@ extern int gtp_fd(struct gsn_t *gsn);
extern int gtp_decaps0(struct gsn_t *gsn);
extern int gtp_decaps1c(struct gsn_t *gsn);
extern int gtp_decaps1u(struct gsn_t *gsn);
-extern int gtp_retrans(struct gsn_t *gsn);
-extern int gtp_retranstimeout(struct gsn_t *gsn, struct timeval *timeout);
+extern int gtp_retrans(struct gsn_t *gsn) OSMO_DEPRECATED("This API is a no-op, libgtp already does the job internally");
+extern int gtp_retranstimeout(struct gsn_t *gsn, struct timeval *timeout) OSMO_DEPRECATED("This API is a no-op and will return a 1 day timeout");
extern int gtp_set_cb_delete_context(struct gsn_t *gsn,
int (*cb_delete_context) (struct pdp_t *