gbproxy: Add comments to sgsn functions

Change-Id: I8c96308045112f25292b0e57c306d8486a2524cc
diff --git a/src/gb_proxy_main.c b/src/gb_proxy_main.c
index e85e951..c660ede 100644
--- a/src/gb_proxy_main.c
+++ b/src/gb_proxy_main.c
@@ -303,6 +303,8 @@
 
 	gprs_ns2_vty_create();
 
+	/* TODO: Warn if we create a gbproxy_nse for an NSEI which we don't have a bind */
+
 	/* start telnet after reading config for vty_get_bind_addr() */
 	rc = telnet_init_dynif(tall_sgsn_ctx, NULL,
 			       vty_get_bind_addr(), OSMO_VTY_PORT_GBPROXY);
diff --git a/src/gb_proxy_peer.c b/src/gb_proxy_peer.c
index 595e2a6..a966c6c 100644
--- a/src/gb_proxy_peer.c
+++ b/src/gb_proxy_peer.c
@@ -343,7 +343,15 @@
 	return nse;
 }
 
-/* SGSN */
+/***********************************************************************
+ * SGSN - Serving GPRS Support Node
+ ***********************************************************************/
+
+/*! Allocate a new SGSN. This ensures the corresponding gbproxy_nse is allocated as well
+ *  \param[in] cfg The gbproxy configuration
+ *  \param[in] nsei The nsei where the SGSN can be reached
+ *  \return The SGSN, NULL if it couldn't be allocated
+ */
 struct gbproxy_sgsn *gbproxy_sgsn_alloc(struct gbproxy_config *cfg, uint16_t nsei)
 {
 	struct gbproxy_sgsn *sgsn;
@@ -381,6 +389,9 @@
 	talloc_free(sgsn);
 }
 
+/*! Free the SGSN. This ensures the corresponding gbproxy_nse is freed as well
+ *  \param[in] sgsn The SGSN
+ */
 void gbproxy_sgsn_free(struct gbproxy_sgsn *sgsn)
 {
 	if (!sgsn)
@@ -392,6 +403,11 @@
 	_sgsn_free(sgsn);
 }
 
+/*! Return the SGSN for a given NSEI
+ *  \param[in] cfg The gbproxy configuration
+ *  \param[in] nsei The nsei where the SGSN can be reached
+ *  \return Returns the matching SGSN or NULL if it couldn't be found
+ */
 struct gbproxy_sgsn *gbproxy_sgsn_by_nsei(struct gbproxy_config *cfg, uint16_t nsei)
 {
 	struct gbproxy_sgsn *sgsn;
@@ -405,6 +421,11 @@
 	return NULL;
 }
 
+/*! Return the SGSN for a given NSEI, creating a new one if none exists
+ *  \param[in] cfg The gbproxy configuration
+ *  \param[in] nsei The nsei where the SGSN can be reached
+ *  \return Returns the SGSN
+ */
 struct gbproxy_sgsn *gbproxy_sgsn_by_nsei_or_new(struct gbproxy_config *cfg, uint16_t nsei)
 {
 	struct gbproxy_sgsn *sgsn;