From a5a4014d67a5eae045541681b94359eb4bf0bd18 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 1 Apr 2010 08:47:12 +0200 Subject: nat: Allow to send MGCP messages from the BSC to the network --- openbsc/src/nat/bsc_filter.c | 3 +++ openbsc/tests/bsc-nat/bsc_nat_test.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) (limited to 'openbsc') diff --git a/openbsc/src/nat/bsc_filter.c b/openbsc/src/nat/bsc_filter.c index 1561676c9..891d4555d 100644 --- a/openbsc/src/nat/bsc_filter.c +++ b/openbsc/src/nat/bsc_filter.c @@ -67,6 +67,9 @@ static struct bsc_pkt_filter black_list[] = { static struct bsc_pkt_filter white_list[] = { /* allow IPAC_PROTO_SCCP messages to both sides */ { IPAC_PROTO_SCCP, ALLOW_ANY, ALLOW_ANY, ALLOW_ANY, FILTER_TO_BOTH }, + + /* allow MGCP messages to both sides */ + { NAT_IPAC_PROTO_MGCP, ALLOW_ANY, ALLOW_ANY, ALLOW_ANY, FILTER_TO_BOTH }, }; struct bsc_nat_parsed* bsc_nat_parse(struct msgb *msg) diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 217c4f415..c3b86c060 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -89,6 +89,12 @@ static const u_int8_t bssmap_release_complete[] = { 0x05, 0x01, 0x02, 0x03, 0x00, 0x00, 0x03 }; +/* MGCP wrap... */ +static const u_int8_t mgcp_msg[] = { + 0x00, 0x03, 0xfc, + 0x20, 0x20, 0x20, +}; + struct filter_result { const u_int8_t *data; const u_int16_t length; @@ -145,6 +151,12 @@ static const struct filter_result results[] = { .dir = DIR_BSC, .result = 0, }, + { + .data = mgcp_msg, + .length = ARRAY_SIZE(mgcp_msg), + .dir = DIR_MSC, + .result = 0, + }, }; static void test_filter(void) -- cgit v1.2.3