aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-12-24 21:13:26 +0100
committerHarald Welte <laforge@gnumonks.org>2010-12-26 19:20:03 +0100
commita9b473a3c25d5b0f0993c3c53f6004b0e86fca5c (patch)
treed41b0f0bf4756737e0aa896b50c21f21e1fc7263 /openbsc/include/openbsc
parent3357add225140a2e87a9d69150bf19cf578e24f7 (diff)
SGSN: Implement network-initiated PDP CTX DEACT when GGSN restarts
If the GGSN restarts, its restart counter will increase. We can detect that and accordingly release/delete all PDP contexts for that GGSN.
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/gprs_gmm.h1
-rw-r--r--openbsc/include/openbsc/gprs_sgsn.h14
2 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gprs_gmm.h b/openbsc/include/openbsc/gprs_gmm.h
index b91b489d3..bd129ae4d 100644
--- a/openbsc/include/openbsc/gprs_gmm.h
+++ b/openbsc/include/openbsc/gprs_gmm.h
@@ -4,6 +4,7 @@
#include <osmocore/msgb.h>
#include <openbsc/gprs_sgsn.h>
+int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause);
int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid,
uint8_t cause, uint8_t pco_len, uint8_t *pco_v);
int gsm48_tx_gsm_act_pdp_acc(struct sgsn_pdp_ctx *pdp);
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index b32c5cd4c..fb1b2882b 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -125,6 +125,10 @@ enum pdp_ctx_state {
PDP_STATE_NONE,
PDP_STATE_CR_REQ,
PDP_STATE_CR_CONF,
+
+ /* 04.08 / Figure 6.2 / 6.1.2.2 */
+ PDP_STATE_INACT_PEND,
+ PDP_STATE_INACTIVE = PDP_STATE_NONE,
};
enum pdp_type {
@@ -162,6 +166,10 @@ struct sgsn_pdp_ctx {
uint32_t rx_gtp_snu;
//uint32_t charging_id;
int reordering_reqd;
+
+ struct timer_list timer;
+ unsigned int T; /* Txxxx number */
+ unsigned int num_T_exp; /* number of consecutive T expirations */
};
@@ -182,10 +190,12 @@ struct sgsn_ggsn_ctx {
uint32_t id;
unsigned int gtp_version;
struct in_addr remote_addr;
+ int remote_restart_ctr;
struct gsn_t *gsn;
};
struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id);
struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr);
struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id);
struct apn_ctx {
@@ -202,4 +212,8 @@ extern struct llist_head sgsn_pdp_ctxts;
uint32_t sgsn_alloc_ptmsi(void);
+/* High-level function to be called in case a GGSN has disappeared or
+ * ottherwise lost state (recovery procedure) */
+int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn);
+
#endif /* _GPRS_SGSN_H */