From 326b5d80b38727b1f7b840d00c90ac135d0d638c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 2 Aug 2013 21:14:14 +0200 Subject: libmgcp: add enum mgcp_role This enum indicates if the mgcp is running on the BSC or the BSC-NAT. --- openbsc/src/libmgcp/mgcp_vty.c | 4 +++- openbsc/src/osmo-bsc_mgcp/mgcp_main.c | 2 +- openbsc/src/osmo-bsc_nat/bsc_nat.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'openbsc/src') diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/openbsc/src/libmgcp/mgcp_vty.c index 69984ee92..833908a21 100644 --- a/openbsc/src/libmgcp/mgcp_vty.c +++ b/openbsc/src/libmgcp/mgcp_vty.c @@ -898,7 +898,8 @@ static int allocate_trunk(struct mgcp_trunk_config *trunk) return 0; } -int mgcp_parse_config(const char *config_file, struct mgcp_config *cfg) +int mgcp_parse_config(const char *config_file, struct mgcp_config *cfg, + enum mgcp_role role) { int rc; struct mgcp_trunk_config *trunk; @@ -935,6 +936,7 @@ int mgcp_parse_config(const char *config_file, struct mgcp_config *cfg) return -1; } } + cfg->role = role; return 0; } diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c index 540f7602b..596ea8a49 100644 --- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c +++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c @@ -223,7 +223,7 @@ int main(int argc, char **argv) handle_options(argc, argv); - rc = mgcp_parse_config(config_file, cfg); + rc = mgcp_parse_config(config_file, cfg, MGCP_BSC); if (rc < 0) return rc; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 897c657d1..1eac9837c 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1515,7 +1515,7 @@ int main(int argc, char **argv) /* init vty and parse */ telnet_init(tall_bsc_ctx, NULL, 4244); - if (mgcp_parse_config(config_file, nat->mgcp_cfg) < 0) { + if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) { fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file); return -3; } -- cgit v1.2.3