Maintain per ggsn pdp ctx list

This way we can easily track all pdp context associated to a specific
ggsn, which is useful to handle some scenarios, such as the one
implemented in next commit, in which specs references that GSNs should
ping only other GSNs with at least one pdp ctx in common. So the list
of pdp ctx per GGSN is really useful too (and cheap computationally)
to check if we should arm or disarm the echo procedure timer.

So this commit can be seen as a preparation for next commit.

Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a
diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 64e5619..33b12dc 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -296,6 +296,7 @@
 	struct sgsn_mm_ctx	*mm;	/* back pointer to MM CTX */
 	int			destroy_ggsn; /* destroy it on destruction */
 	struct sgsn_ggsn_ctx	*ggsn;	/* which GGSN serves this PDP */
+	struct llist_head	ggsn_list;	/* list_head for ggsn->pdp_list */
 	struct rate_ctr_group	*ctrg;
 
 	//unsigned int		id;
@@ -338,6 +339,7 @@
 					 uint8_t tid);
 
 struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
+					struct sgsn_ggsn_ctx *ggsn,
 					uint8_t nsapi);
 void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp);
 void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp);
@@ -350,12 +352,14 @@
 	struct in_addr remote_addr;
 	int remote_restart_ctr;
 	struct gsn_t *gsn;
+	struct llist_head pdp_list;	/* list of associated pdp ctx (struct sgsn_pdp_ctx*) */
 };
 struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id);
 void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc);
 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);
+int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn);
 
 struct apn_ctx {
 	struct llist_head list;
@@ -378,10 +382,6 @@
 uint32_t sgsn_alloc_ptmsi(void);
 void sgsn_inst_init(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);
-
 char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len);
 
 /*