diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-22 03:25:11 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-24 06:16:04 +0100 |
commit | 22481bf76d129d3c41d20b96b6587ef085be485b (patch) | |
tree | 8c8de852e945dd5422a83bc7e0c37548d2911fe2 /openbsc/src/nat/bsc_nat.c | |
parent | b973955295b720b8ba7c556d0165750ed9bfb381 (diff) | |
parent | 61b4232c6363ff9d78ef73b9dbf47ec16c94d610 (diff) |
Merge remote branch 'origin/master' into on-waves/bsc-master
* Move to libosmocore
* Move to new debugging architecture
* Register the BTS types
* Has only been compile tested
Conflicts:
openbsc/include/openbsc/Makefile.am
openbsc/include/openbsc/gsm_data.h
openbsc/include/openbsc/ipaccess.h
openbsc/include/openbsc/mgcp.h
openbsc/include/openbsc/msgb.h
openbsc/include/openbsc/tlv.h
openbsc/src/Makefile.am
openbsc/src/abis_rsl.c
openbsc/src/bsc_init.c
openbsc/src/bsc_mgcp.c
openbsc/src/chan_alloc.c
openbsc/src/debug.c
openbsc/src/gsm_subscriber_base.c
openbsc/src/msgb.c
openbsc/src/rest_octets.c
openbsc/src/sccp/sccp.c
openbsc/src/vty/command.c
openbsc/src/vty_interface.c
openbsc/tests/Makefile.am
Diffstat (limited to 'openbsc/src/nat/bsc_nat.c')
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 6ce78be7f..09df4dcb6 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -36,19 +36,20 @@ #include <getopt.h> #include <openbsc/debug.h> -#include <openbsc/msgb.h> #include <openbsc/bsc_msc.h> #include <openbsc/bsc_nat.h> #include <openbsc/bssap.h> #include <openbsc/ipaccess.h> #include <openbsc/abis_nm.h> -#include <openbsc/talloc.h> #include <openbsc/telnet_interface.h> +#include <osmocore/talloc.h> + #include <vty/vty.h> #include <sccp/sccp.h> +struct debug_target *stderr_target; static const char *config_file = "bsc-nat.cfg"; static char *msc_address = "127.0.0.1"; static struct in_addr local_addr; @@ -309,7 +310,7 @@ static int forward_sccp_to_bts(struct msgb *msg) if (!bsc) return -1; if (!bsc->authenticated) { - LOGP(DNAT, LOGL_ERRO, "Selected BSC not authenticated.\n"); + LOGP(DNAT, LOGL_ERROR, "Selected BSC not authenticated.\n"); return -1; } @@ -707,16 +708,16 @@ static void handle_options(int argc, char** argv) print_help(); exit(0); case 's': - debug_use_color(0); + debug_set_use_color(stderr_target, 0); break; case 'd': - debug_parse_category_mask(optarg); + debug_parse_category_mask(stderr_target, optarg); break; case 'c': config_file = strdup(optarg); break; case 'T': - debug_timestamp(1); + debug_set_print_timestamp(stderr_target, 1); break; case 'm': msc_address = strdup(optarg); @@ -749,6 +750,11 @@ int main(int argc, char** argv) { int rc; + debug_init(); + stderr_target = debug_target_create_stderr(); + debug_add_target(stderr_target); + debug_set_all_filter(stderr_target, 1); + /* parse options */ local_addr.s_addr = INADDR_ANY; handle_options(argc, argv); |