bindings: replace pybindgen bindings support with cppyy bindings
This commit is contained in:
@@ -16,14 +16,7 @@
|
||||
# * Ported to Python by Mohit P. Tahiliani
|
||||
# */
|
||||
|
||||
import ns.core
|
||||
import ns.network
|
||||
import ns.point_to_point
|
||||
import ns.applications
|
||||
import ns.wifi
|
||||
import ns.mobility
|
||||
import ns.csma
|
||||
import ns.internet
|
||||
from ns import ns
|
||||
import sys
|
||||
|
||||
# // Default Network Topology
|
||||
@@ -37,23 +30,21 @@ import sys
|
||||
# // ================
|
||||
# // LAN 10.1.2.0
|
||||
|
||||
cmd = ns.core.CommandLine()
|
||||
cmd.nCsma = 3
|
||||
cmd.verbose = "True"
|
||||
cmd.nWifi = 3
|
||||
cmd.tracing = "False"
|
||||
cmd = ns.getCommandLine(__file__)
|
||||
nCsma ="3"
|
||||
verbose = "True"
|
||||
nWifi = "3"
|
||||
tracing = "False"
|
||||
|
||||
cmd.AddValue("nCsma", "Number of \"extra\" CSMA nodes/devices")
|
||||
cmd.AddValue("nWifi", "Number of wifi STA devices")
|
||||
cmd.AddValue("verbose", "Tell echo applications to log if true")
|
||||
cmd.AddValue("tracing", "Enable pcap tracing")
|
||||
cmd.AddValue("nCsma", "Number of extra CSMA nodes/devices", ns.null_callback(), nCsma)
|
||||
cmd.AddValue("nWifi", "Number of wifi STA devices", ns.null_callback(), nWifi)
|
||||
cmd.AddValue("verbose", "Tell echo applications to log if true", ns.null_callback(), verbose)
|
||||
cmd.AddValue("tracing", "Enable pcap tracing", ns.null_callback(), tracing)
|
||||
|
||||
cmd.Parse(sys.argv)
|
||||
|
||||
nCsma = int(cmd.nCsma)
|
||||
verbose = cmd.verbose
|
||||
nWifi = int(cmd.nWifi)
|
||||
tracing = cmd.tracing
|
||||
nCsma = int(nCsma)
|
||||
nWifi = int(nWifi)
|
||||
|
||||
# The underlying restriction of 18 is due to the grid position
|
||||
# allocator's configuration; the grid layout will exceed the
|
||||
@@ -137,7 +128,7 @@ serverApps = echoServer.Install(csmaNodes.Get(nCsma))
|
||||
serverApps.Start(ns.core.Seconds(1.0))
|
||||
serverApps.Stop(ns.core.Seconds(10.0))
|
||||
|
||||
echoClient = ns.applications.UdpEchoClientHelper(csmaInterfaces.GetAddress(nCsma), 9)
|
||||
echoClient = ns.applications.UdpEchoClientHelper(ns.addressFromIpv4Address(csmaInterfaces.GetAddress(nCsma)), 9)
|
||||
echoClient.SetAttribute("MaxPackets", ns.core.UintegerValue(1))
|
||||
echoClient.SetAttribute("Interval", ns.core.TimeValue(ns.core.Seconds (1.0)))
|
||||
echoClient.SetAttribute("PacketSize", ns.core.UintegerValue(1024))
|
||||
|
||||
Reference in New Issue
Block a user