Add pcap tracing
authorRichard Whitehouse <github@richardwhiuk.com>
Sat, 16 Apr 2011 20:50:34 +0000 (21:50 +0100)
committerRichard Whitehouse <github@richardwhiuk.com>
Sat, 16 Apr 2011 20:50:34 +0000 (21:50 +0100)
src/simulation/simulation.cc

index 131089fe908bd3900b94868b632bfac969013e1c..2f38835ae4e1be1cf7925857100f8e4eabb8e143 100644 (file)
@@ -108,7 +108,7 @@ int main (int argc, char *argv[])
 
 try {
 
-       std::string csmaTraceFile;
+       std::string csmaTraceFile, pcapTraceFile;
        std::string ipTraceFile;
        std::string networkFile;
        std::string dataFile;
@@ -117,6 +117,7 @@ try {
        CommandLine cmd;                        // Allow CommandLine args
        cmd.AddValue("link", "Link Layer? (moose|ethernet) [moose]", linkLayer);
        cmd.AddValue("csma", "CSMA Trace File", csmaTraceFile);
+       cmd.AddValue("pcap", "CSMA PCAP Trace File", pcapTraceFile);
        cmd.AddValue("ip", "IPv4 Trace File", ipTraceFile);
        cmd.AddValue("network", "Network Topology File", networkFile);
        cmd.AddValue("data", "Network Data File", dataFile);
@@ -185,6 +186,10 @@ try {
                }
        }
 
+       if(pcapTraceFile != ""){
+               link.csma.EnablePcapAll(pcapTraceFile, true);
+       }
+
 
        NS_LOG_INFO ("Run Simulation");
        Simulator::Run ();