make left/right IP addresses configurable via modparam / config file

master
Harald Welte 5 years ago
parent 577c373ead
commit cea0e04f47
  1. 8
      testproject/IPL4_example.cfg
  2. 11
      testproject/NFCT_testsuite.cfg
  3. 14
      testproject/NFCT_testsuite.ttcn

@ -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"

@ -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"

@ -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
}

Loading…
Cancel
Save