diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-30 13:01:22 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-30 13:08:32 +0200 |
commit | 571ba8e4daafebd12fb64a99bba4a4bcc976872c (patch) | |
tree | 9085cd998cf7d21c1eb2552b228947d0dcbdb282 | |
parent | bed6234e269aa782e5a1a78edf5f39e048059300 (diff) |
nat: Add MGCP code and parsing to the nat code..
For the nat we will have NAT and MGCP in the same process
and this commit starts with that. We are linking in the MGCP
code and one can embed MGCP config snippets...
-rw-r--r-- | openbsc/include/openbsc/bsc_nat.h | 7 | ||||
-rw-r--r-- | openbsc/src/Makefile.am | 1 | ||||
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 4 | ||||
-rw-r--r-- | openbsc/src/nat/bsc_nat_vty.c | 3 |
4 files changed, 14 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 638791a8b..ab80cb401 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -22,6 +22,8 @@ #ifndef BSC_NAT_H #define BSC_NAT_H +#include "mgcp.h" + #include <sys/types.h> #include <sccp/sccp_types.h> @@ -33,6 +35,8 @@ #define DIR_BSC 1 #define DIR_MSC 2 +#define NAT_IPAC_PROTO_MGCP + struct bsc_nat; /* @@ -135,6 +139,9 @@ struct bsc_nat { /* known BSC's */ struct llist_head bsc_configs; int num_bsc; + + /* MGCP config */ + struct mgcp_config *mgcp_cfg; }; /* create and init the structures */ diff --git a/openbsc/src/Makefile.am b/openbsc/src/Makefile.am index b552d2f83..f25583138 100644 --- a/openbsc/src/Makefile.am +++ b/openbsc/src/Makefile.am @@ -54,5 +54,6 @@ ipaccess_proxy_SOURCES = ipaccess/ipaccess-proxy.c debug.c bsc_nat_SOURCES = nat/bsc_nat.c nat/bsc_filter.c nat/bsc_sccp.c \ nat/bsc_nat_utils.c nat/bsc_nat_vty.c nat/bsc_mgcp_utils.c \ + mgcp/mgcp_protocol.c mgcp/mgcp_network.c mgcp/mgcp_vty.c \ bsc_msc.c bssap.c bsc_nat_LDADD = libvty.a libbsc.a libsccp.a diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 4a25dc39c..744a30e6b 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -702,10 +702,12 @@ int main(int argc, char** argv) return -4; } + nat->mgcp_cfg = talloc_zero(nat, struct mgcp_config); + /* init vty and parse */ bsc_nat_vty_init(nat); telnet_init(NULL, 4244); - if (vty_read_config_file(config_file) < 0) { + if (mgcp_parse_config(config_file, nat->mgcp_cfg) < 0) { fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file); return -3; } diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c index 6dae0d65c..3a468e9fa 100644 --- a/openbsc/src/nat/bsc_nat_vty.c +++ b/openbsc/src/nat/bsc_nat_vty.c @@ -25,6 +25,7 @@ #include <openbsc/bsc_nat.h> #include <openbsc/gsm_04_08.h> +#include <openbsc/mgcp.h> #include <osmocore/talloc.h> @@ -208,6 +209,8 @@ int bsc_nat_vty_init(struct bsc_nat *nat) install_element(BSC_NODE, &cfg_bsc_token_cmd); install_element(BSC_NODE, &cfg_bsc_lac_cmd); + mgcp_vty_init(); + return 0; } |