Move global ggsn_list into struct sgsn_instance
Change-Id: I9d4c74476b777a866af2796dd376ed50da7b5d01changes/81/30881/1
parent
e659f75cf1
commit
44bde6b85a
|
@ -376,7 +376,6 @@ struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix);
|
|||
struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi_prefix);
|
||||
|
||||
extern struct llist_head sgsn_mm_ctxts;
|
||||
extern struct llist_head sgsn_ggsn_ctxts;
|
||||
extern struct llist_head sgsn_apn_ctxts;
|
||||
extern struct llist_head sgsn_pdp_ctxts;
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ struct sgsn_instance {
|
|||
|
||||
struct rate_ctr_group *rate_ctrs;
|
||||
|
||||
struct llist_head ggsn_list; /* list of struct sgsn_ggsn_ctx */
|
||||
struct llist_head mme_list; /* list of struct sgsn_mme_ctx */
|
||||
|
||||
struct ctrl_handle *ctrlh;
|
||||
|
|
|
@ -64,7 +64,6 @@ extern void *tall_sgsn_ctx;
|
|||
extern struct osmo_tdef sgsn_T_defs[];
|
||||
|
||||
LLIST_HEAD(sgsn_mm_ctxts);
|
||||
LLIST_HEAD(sgsn_ggsn_ctxts);
|
||||
LLIST_HEAD(sgsn_apn_ctxts);
|
||||
LLIST_HEAD(sgsn_pdp_ctxts);
|
||||
|
||||
|
@ -918,6 +917,7 @@ struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx)
|
|||
inst->rate_ctrs = rate_ctr_group_alloc(inst, &sgsn_ctrg_desc, 0);
|
||||
OSMO_ASSERT(inst->rate_ctrs);
|
||||
|
||||
INIT_LLIST_HEAD(&inst->ggsn_list);
|
||||
INIT_LLIST_HEAD(&inst->mme_list);
|
||||
|
||||
osmo_timer_setup(&inst->llme_timer, sgsn_llme_check_cb, NULL);
|
||||
|
|
|
@ -73,7 +73,7 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id)
|
|||
ggc->gsn = sgsn->gsn;
|
||||
INIT_LLIST_HEAD(&ggc->pdp_list);
|
||||
osmo_timer_setup(&ggc->echo_timer, echo_timer_cb, ggc);
|
||||
llist_add(&ggc->list, &sgsn_ggsn_ctxts);
|
||||
llist_add(&ggc->list, &sgsn->ggsn_list);
|
||||
|
||||
return ggc;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id)
|
|||
{
|
||||
struct sgsn_ggsn_ctx *ggc;
|
||||
|
||||
llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) {
|
||||
llist_for_each_entry(ggc, &sgsn->ggsn_list, list) {
|
||||
if (id == ggc->id)
|
||||
return ggc;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr)
|
|||
{
|
||||
struct sgsn_ggsn_ctx *ggc;
|
||||
|
||||
llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) {
|
||||
llist_for_each_entry(ggc, &sgsn->ggsn_list, list) {
|
||||
if (!memcmp(addr, &ggc->remote_addr, sizeof(*addr)))
|
||||
return ggc;
|
||||
}
|
||||
|
|
|
@ -252,7 +252,7 @@ static int config_write_sgsn(struct vty *vty)
|
|||
vty_out(vty, " gtp local-ip %s%s",
|
||||
inet_ntoa(g_cfg->gtp_listenaddr.sin_addr), VTY_NEWLINE);
|
||||
|
||||
llist_for_each_entry(gctx, &sgsn_ggsn_ctxts, list) {
|
||||
llist_for_each_entry(gctx, &sgsn->ggsn_list, list) {
|
||||
if (gctx->id == UINT32_MAX)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in New Issue