FreeCalypso > hg > osmo-playpen
diff smsc-daemon/main.c @ 19:9ff041d85da5
proto-smsc-daemon: allow HLR GSUP server other than 127.0.0.1
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 16 Dec 2023 22:23:23 +0000 |
parents | d9db8661d9f3 |
children |
line wrap: on
line diff
--- a/smsc-daemon/main.c Mon Nov 13 12:47:12 2023 -0800 +++ b/smsc-daemon/main.c Sat Dec 16 22:23:23 2023 +0000 @@ -79,19 +79,21 @@ int main(int argc, char **argv) { - char *server_host = "127.0.0.1"; + const char *server_host; uint16_t server_port = OSMO_GSUP_PORT; void *ctx = talloc_named_const(NULL, 0, "proto-smsc"); osmo_init_logging2(ctx, &smsc_log_info); - if (argc < 3 || argc > 4) { - fprintf(stderr, "usage: %s ipa-name logfile [local-socket]\n", + if (argc < 4 || argc > 5) { + fprintf(stderr, + "usage: %s hlr-ip ipa-name logfile [local-socket]\n", argv[0]); exit(1); } - set_ipa_name(argv[1]); - open_log_file(argv[2]); + server_host = argv[1]; + set_ipa_name(argv[2]); + open_log_file(argv[3]); build_ipa_dev(); g_gc = osmo_gsup_client_create2(ctx, &gsup_ipa_dev, server_host, @@ -100,8 +102,8 @@ fprintf(stderr, "error: osmo_gsup_client_create2() failed\n"); exit(1); } - if (argv[3]) - setup_local_socket(argv[3]); + if (argv[4]) + setup_local_socket(argv[4]); while (1) { osmo_select_main(0);