path: root/openbsc/src/gprs/sgsn_vty.c
diff options
authorNeels Hofmeyr <>2015-11-08 20:34:47 +0100
committerNeels Hofmeyr <>2015-11-16 15:16:30 +0100
commit30f7bcbd79ad1b661dff844a43f0ccbf4f07cebf (patch)
tree68715097523724d61c56a99f2db6f947fac2f55b /openbsc/src/gprs/sgsn_vty.c
parentc8a614d2e9c56fe13c22f239be82f2a2c958e039 (diff)
gtphub: add first bits of GRX ares
For the resolving function, change the function signature to return a gtphub_peer_port. In consequence, publish two functions concerned with gtphub_peer_port instances for use in test and gtphub_ext.c. Add GGSN resolution queue, callback and cache. Simple implementation: if an SGSN asks for a GGSN, it will first get no answer, and I hope it will ask again once the GGSN is in the cache. Within gtphub_ext.c, have a dummy sgsn struct, as the sgsn_ares code currently depends on it (half the functions pass an sgsn instance pointer around, but the other half use the global one). In the unit tests, wrap away the ares initialization so that they can work without a DNS server around. The netcat test breaks because of this, will remove it. Using sgsn_ares, implement the gtphub_resolve_ggsn_addr() function, I hope: untested. Minor cosmetics just to see if you're paying attention... ;) Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/sgsn_vty.c')
1 files changed, 5 insertions, 0 deletions
diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index 3a73c9f55..3f6116393 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/src/gprs/sgsn_vty.c
@@ -110,6 +110,11 @@ DECLARE_TIMER(3397, "Wait for DEACT AA PDP CTX ACK timer (s)")
#define GSM48_MAX_APN_LEN 102 /* */
+/* TODO: consolidate with gprs_apn_to_str(). */
+/** Copy apn to a static buffer, replacing the length octets in apn_enc with '.'
+ * and terminating with a '\0'. Return the static buffer.
+ * len: the length of the encoded APN (which has no terminating zero).
+ */
static char *gprs_apn2str(uint8_t *apn, unsigned int len)
static char apnbuf[GSM48_MAX_APN_LEN+1];