I've changed the way things work a bit:
1. netns is replaced by mnexec, a general-purpose mininet helper.
2. For interactive commands, we now use mnexec -p, which prints out
the pid, so we can kill it when someone hits control-C!
3. We close file descriptors for subshells. This might save memory,
but who knows.
4. We detach our subshells from the tty using mnexec -s; thus
control-C should not terminate everything.
5. Given 4, mn -c is now necessary if you kill mininet.
Call netns using setsid to detach from the tty; this is
intended to fix the problem of control-C killing your network.
sendInt() doesn't actually work - hopefully we can fix this in the
future, but it's tricky since we want to detach the many shells from
our tty, but then optionally send tty interrupts to them! Ideally we
would either know the pid of the subprocess or be able to send a signal
to bash to get it to interrupt its subprocess.
waitOutput() now uses monitor. We also handle sentinels
coming in the middle of output (but default at end should
still work well.)
Call netns using setsid to detach from the tty; this is
intended to fix the problem of control-C killing your network.
sendInt() doesn't actually work - hopefully we can fix this in the
future, but it's tricky since we want to detach the many shells from
our tty, but then optionally send tty interrupts to them! Ideally we
would either know the pid of the subprocess or be able to send a signal
to bash to get it to interrupt its subprocess.
waitOutput() now uses monitor. We also handle sentinels
coming in the middle of output (but default at end should
still work well.)
We need to figure out how to specify the IP addresses for the
routed control network. For now I'm going back to 192.168.12x.y
Also changed controller params to use IP strings rather than
numbers. However, we still need to clarify what ControllerParams
is actually for.
Also tweaked cmd/cmdPrint to make them more beautiful and functional,
and a few other minor changes, such as using a new idiom for verbose.
These changes support reinstating the examples.
There is probably a better way of doing this, but currently
parseCustomFile can modify globals (e.g. TOPOS) as well as
instance variables (self.validate) and classes (e.g. MyTopo),
which are also in the global name space.
Inconveniently enough, lambdas don't seem to be full closures
in Python; if they were, this trickiness would be unnecessary.
Even so, using execfile() seems like it might be a bit dubious...
This increases flexibility by allowing a topology to be manually created
in Python, or specified using another format, without having to create
a Topo object first.
However, Topos are useful, and are still the default topology object!
Shell now works (although we should use quietRun instead to avoid
file descriptor problem!)
exit/quit/EOF now all exit.
Renamed pingall and pingpair to make them easier to type - I think
commands should not require use of the shift key in general, although
ping-all and ping-pair might be OK.
It's possible that mn_clean is a bit easier to read; mnclean may be easier
to type, however.
Added variables to Makefile so that source files are listed in a single
location.
- invoke ofdatapath with --fail=closed (no controller = no connectivity!)
- stop hosts before switches before the controller
- this seems slightly more sensible
- it's the reverse of the startup order
- fix retry() so it kind of works (it's actually helpful I think!)
Not sure if I want nox_core -v in nox.py - it's useful for debugging.
ripcordtest.py (and grid.py) still depend on routing, which I haven't been
able to test yet.
Unfortunately, I can't test this at the moment since nox seems not to
be able to find the routing module.
Added/renamed examples: grid.py, tree1024.py
Added -v flag to nox arguments, so we have some chance of figuring
out why nox is dying, as it generally is.