%description:

Tests IPv4NetworkConfigurator for a wired LAN.
Topology:
   server <--> router <--> switch <--> clients

%file: test.ned

import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.ethernet.Eth10M;
import inet.node.ethernet.EtherSwitch;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;

network Test
{
    parameters:
        int numHosts;
    submodules:
        configurator: IPv4NetworkConfigurator {
            parameters:
                dumpAddresses = true;
        }
        server: StandardHost;
        router: Router;
        switch: EtherSwitch;
        client[numHosts]: StandardHost;
    connections:
        server.ethg++ <--> Eth10M <--> router.ethg++;
        router.ethg++ <--> Eth10M <--> switch.ethg++;
        for i=0..numHosts-1 {
            client[i].ethg++ <--> Eth10M <--> switch.ethg++;
        }
}

%inifile: omnetpp.ini

[General]
network = Test
cmdenv-express-mode = false
tkenv-plugin-path = ../../../etc/plugins
ned-path = .;../../../../src;../../lib
sim-time-limit = 1s

#omnetpp 5.0 - 5.1 compatibility:
eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"

*.numHosts = 3

%contains-regex: stdout
Link 0
    server / eth0 id=\d+  on:nwLayer.ifOut\[\d+\]  MTU:1500 BROADCAST MULTICAST  macAddr:0A-AA-00-00-00-[0-9A-F]{2} IPv4:\{.*inet_addr:10.0.0.1/30.*}
    router / eth0 id=\d+  on:nwLayer.ifOut\[\d+\]  MTU:1500 BROADCAST MULTICAST  macAddr:0A-AA-00-00-00-[0-9A-F]{2} IPv4:\{.*inet_addr:10.0.0.2/30.*}
Link 1
    router / eth1 id=\d+  on:nwLayer.ifOut\[\d+\]  MTU:1500 BROADCAST MULTICAST  macAddr:0A-AA-00-00-00-[0-9A-F]{2} IPv4:\{.*inet_addr:10.0.0.9/29.*}
    client\[0\] / eth0 id=\d+  on:nwLayer.ifOut\[\d+\]  MTU:1500 BROADCAST MULTICAST  macAddr:0A-AA-00-00-00-[0-9A-F]{2} IPv4:\{.*inet_addr:10.0.0.10/29.*}
    client\[1\] / eth0 id=\d+  on:nwLayer.ifOut\[\d+\]  MTU:1500 BROADCAST MULTICAST  macAddr:0A-AA-00-00-00-[0-9A-F]{2} IPv4:\{.*inet_addr:10.0.0.11/29.*}
    client\[2\] / eth0 id=\d+  on:nwLayer.ifOut\[\d+\]  MTU:1500 BROADCAST MULTICAST  macAddr:0A-AA-00-00-00-[0-9A-F]{2} IPv4:\{.*inet_addr:10.0.0.12/29.*}

%#--------------------------------------------------------------------------------------------------------------
%not-contains: stdout
undisposed object:
%not-contains: stdout
-- check module destructor
%#--------------------------------------------------------------------------------------------------------------
