intrig-unicamp / mininet-wifi

Emulator for Software-Defined Wireless Networks
https://mn-wifi.readthedocs.io/
Other
432 stars 239 forks source link

Is it possible to add a ad hoc station in mininet-wifi CLI? #393

Closed ry4nzhu closed 3 years ago

ry4nzhu commented 3 years ago

I'am running the example examples/adhoc.py and I wonder if it is possible to add another station (e.g. sta4) from the mininet CLI (i.e. after the network is setup). Here is the script that I tried in the CLI but I got name 'adhoc' is not defined. Is it possible to add ad hoc station dynamically in mininet-wifi CLI like this? Thanks。

py net.addStation('sta4', ip6='fe80::3', position='120,10,0')
py net.addLink(sta4, cls=adhoc, intf='sta4-wlan0', ssid='adhocNet', mode='g', channel=5, ht_cap='HT40+', **{'proto':'olsrd'})
ramonfontes commented 3 years ago

You can try:

py net.addStation('sta4', ip6='fe80::3', position='120,10,0')
py sta4.setAdhocMode(intf='sta4-wlan0')
ry4nzhu commented 3 years ago

Thanks. That's what I want.