diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-18 14:32:29 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-18 14:32:29 +0200 |
commit | 77289c202f1e0a748a31d473f7b64c6728377950 (patch) | |
tree | f92678140fbbf5625adb5d2ae0db2001938ca4e6 /openbsc/src/gprs/gprs_sgsn.c | |
parent | 55e0df7c431b6c2e8114c663092ab2c2f1a3e8d8 (diff) |
[GPRS] SGSN: properly delete a PDP context after receiving PDP CTX DEACT REQ
Diffstat (limited to 'openbsc/src/gprs/gprs_sgsn.c')
-rw-r--r-- | openbsc/src/gprs/gprs_sgsn.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 38056f0e2..2671796ab 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -123,6 +123,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc(uint32_t tlli, return ctx; } + struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_nsapi(const struct sgsn_mm_ctx *mm, uint8_t nsapi) { @@ -135,6 +136,19 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_nsapi(const struct sgsn_mm_ctx *mm, return NULL; } +struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm, + uint8_t tid) +{ + struct sgsn_pdp_ctx *pdp; + + llist_for_each_entry(pdp, &mm->pdp_list, list) { + if (pdp->ti == tid) + return pdp; + } + return NULL; +} + + struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, uint8_t nsapi) { @@ -165,11 +179,11 @@ void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp) /* GGSN contexts */ -struct ggsn_ctx *ggsn_ctx_alloc(uint32_t id) +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id) { - struct ggsn_ctx *ggc; + struct sgsn_ggsn_ctx *ggc; - ggc = talloc_zero(tall_bsc_ctx, struct ggsn_ctx); + ggc = talloc_zero(tall_bsc_ctx, struct sgsn_ggsn_ctx); if (!ggc) return NULL; @@ -179,9 +193,9 @@ struct ggsn_ctx *ggsn_ctx_alloc(uint32_t id) return ggc; } -struct ggsn_ctx *ggsn_ctx_by_id(uint32_t id) +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id) { - struct ggsn_ctx *ggc; + struct sgsn_ggsn_ctx *ggc; llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) { if (id == ggc->id) @@ -190,13 +204,13 @@ struct ggsn_ctx *ggsn_ctx_by_id(uint32_t id) return NULL; } -struct ggsn_ctx *ggsn_ctx_find_alloc(uint32_t id) +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id) { - struct ggsn_ctx *ggc; + struct sgsn_ggsn_ctx *ggc; - ggc = ggsn_ctx_by_id(id); + ggc = sgsn_ggsn_ctx_by_id(id); if (!ggc) - ggc = ggsn_ctx_alloc(id); + ggc = sgsn_ggsn_ctx_alloc(id); return ggc; } |