From cea0e04f479b34d67bddd9309453771da02f5c05 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 9 Jul 2017 20:55:13 +0100 Subject: [PATCH] make left/right IP addresses configurable via modparam / config file --- testproject/IPL4_example.cfg | 8 -------- testproject/NFCT_testsuite.cfg | 11 +++++++++++ testproject/NFCT_testsuite.ttcn | 14 ++++++++++---- 3 files changed, 21 insertions(+), 12 deletions(-) delete mode 100644 testproject/IPL4_example.cfg create mode 100644 testproject/NFCT_testsuite.cfg diff --git a/testproject/IPL4_example.cfg b/testproject/IPL4_example.cfg deleted file mode 100644 index 80f192a..0000000 --- a/testproject/IPL4_example.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[TESTPORT_PARAMETERS] -*.TUN.device_name := "foo" -*.TUN.debugging := "YES" -*.TUN2.device_name := "bar" -*.TUN2.debugging := "YES" - -#[MODUlE_PARAMETERS] -#IPL4_demo.px_IPv4_Address1_UE = "127.0.0.1" diff --git a/testproject/NFCT_testsuite.cfg b/testproject/NFCT_testsuite.cfg new file mode 100644 index 0000000..85fa2d1 --- /dev/null +++ b/testproject/NFCT_testsuite.cfg @@ -0,0 +1,11 @@ +[TESTPORT_PARAMETERS] +*.TUN.device_name := "foo" +*.TUN.debugging := "YES" +*.TUN2.device_name := "bar" +*.TUN2.debugging := "YES" + +[MODULE_PARAMETERS] +NFCT_testsuite.left_ip := "1.1.1.200" +NFCT_testsuite.left_ip6 := "1::0200" +NFCT_testsuite.right_ip := "2.2.2.200" +NFCT_testsuite.right_ip6 := "2::0200" diff --git a/testproject/NFCT_testsuite.ttcn b/testproject/NFCT_testsuite.ttcn index 351212e..dafd25f 100644 --- a/testproject/NFCT_testsuite.ttcn +++ b/testproject/NFCT_testsuite.ttcn @@ -15,6 +15,12 @@ module NFCT_testsuite { import from http_www_netfilter_org_xml_libnetfilter_conntrack all; import from XSD all; + modulepar charstring left_ip := "1.1.1.200"; + modulepar charstring left_ip6 := "1::200"; + + modulepar charstring right_ip := "2.2.2.200"; + modulepar charstring right_ip6 := "2::200"; + type component dummy_CT { port TunDevice_PT TUN; port TunDevice_PT TUN2; @@ -38,16 +44,16 @@ module NFCT_testsuite { private function flow_gen(integer port_delta, unsignedbyte l3_prot := 4, unsignedbyte l4_prot := c_ip_proto_udp) return flow_info { var flow_info flowi := { l3_protocol := c_ip_proto_ipv4, - src_ip := "1.1.1.200", - dst_ip := "2.2.2.200", + src_ip := left_ip, + dst_ip := right_ip, l4_protocol := l4_prot, src_port := 1000 + port_delta, dst_port := 2000 + port_delta } if (l3_prot == 6) { flowi.l3_protocol := c_ip_proto_ipv6; - flowi.src_ip := ""; - flowi.dst_ip := ""; + flowi.src_ip := left_ip6; + flowi.dst_ip := right_ip6; } return flowi }