aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-05 09:10:30 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:11 +0800
commitf05506ecebffc9c87129df7c74bae510c235c860 (patch)
tree9376f740f65c2d7e293a8f824aa081052732d26e /openbsc/tests
parent806aca94c24a554ebec0b4786b262a149de1cfd8 (diff)
nat: Remember where the BTS is listening for things.
Extract the port from the BSS's MGCP Gateway so we know where to forward the data to.
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index def6bfec8..705372c8d 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -482,6 +482,19 @@ static void test_mgcp_parse(void)
}
}
+static void test_mgcp_parse_port(void)
+{
+ int port;
+
+ fprintf(stderr, "Test MGCP port parsing.\n");
+
+ port = bsc_mgcp_extract_port(mdcx_resp);
+ if (port != 4002) {
+ fprintf(stderr, "Could not parse port. Got: %d\n", port);
+ abort();
+ }
+}
+
int main(int argc, char **argv)
{
struct debug_target *stderr_target;
@@ -497,6 +510,7 @@ int main(int argc, char **argv)
test_mgcp_find();
test_mgcp_rewrite();
test_mgcp_parse();
+ test_mgcp_parse_port();
return 0;
}