diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-07-13 10:14:28 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-07-13 10:14:28 +0200 |
commit | 41239d5c227a41016af7107e30aa415b18e35600 (patch) | |
tree | 5eb61b04f85e142e5bb21cbe591ce19fbaf31395 /openbsc/src | |
parent | 943e1f16b94f5fa6e5db501038a95ff8bfb4dee3 (diff) |
ganc: actually read + use settings from the config file
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/osmo-ganc/ganc_server.c | 9 | ||||
-rw-r--r-- | openbsc/src/osmo-ganc/main.c | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/openbsc/src/osmo-ganc/ganc_server.c b/openbsc/src/osmo-ganc/ganc_server.c index 8cccb3a5f..e799ffdc9 100644 --- a/openbsc/src/osmo-ganc/ganc_server.c +++ b/openbsc/src/osmo-ganc/ganc_server.c @@ -276,6 +276,8 @@ static int tx_csr_request_acc(struct gan_peer *peer) static int rx_rc_discovery_req(struct gan_peer *peer, struct msgb *msg, struct tlv_parsed *tp) { + struct ganc_bts *bts; + if (TLVP_PRESENT(tp, GA_IE_MI)) { gsm48_mi_to_string(peer->imsi, sizeof(peer->imsi), TLVP_VAL(tp, GA_IE_MI), TLVP_LEN(tp, GA_IE_MI)); @@ -286,8 +288,11 @@ static int rx_rc_discovery_req(struct gan_peer *peer, struct msgb *msg, if (TLVP_PRESENT(tp, GA_IE_GAN_CM) && TLVP_LEN(tp, GA_IE_GAN_CM) >=2) memcpy(peer->gan_classmark, TLVP_VAL(tp, GA_IE_GAN_CM), 2); - return tx_unc_disco_acc(peer, "segw.uma.sysmocom.de", - "ganc-laforge.gnumonks.org"); + /* FIXME: we need to select the virtual BTS based on MAC address + * and/or ESSID of the AP */ + bts = peer->bts = g_ganc_bts; + + return tx_unc_disco_acc(peer, bts->segw_host, bts->ganc_host); } /* 10.1.5 GA-RC REGISTER REQUEST */ diff --git a/openbsc/src/osmo-ganc/main.c b/openbsc/src/osmo-ganc/main.c index 12d69b022..bf772dc97 100644 --- a/openbsc/src/osmo-ganc/main.c +++ b/openbsc/src/osmo-ganc/main.c @@ -34,6 +34,7 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/talloc.h> #include <osmocom/vty/vty.h> +#include <osmocom/vty/telnet_interface.h> #include <osmocom/sccp/sccp.h> @@ -201,6 +202,12 @@ int main(int argc, char **argv) /* initialize SCCP */ sccp_set_log_area(DSCCP); + struct telnet_connection dummy_conn; + rc = vty_read_config_file(config_file, &dummy_conn); + if (rc < 0) { + fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file); + return rc; + } ganc_server_start(NULL, 14001); |