(target)
| 181 | addrs.add(a.split('/')[0]) |
| 182 | return addrs |
| 183 | |
| 184 | |
| 185 | def do_mtr(target, count=5, source=None): |
| 186 | """Snapshot per-hop loss/latency from this host to `target` over `count` |
| 187 | probe cycles. `source`, if given, binds the trace to one of this host's |
| 188 | local IPv4 addresses (mtr -a) so a multi-homed box can choose which |
| 189 | interface/path the probes leave from.""" |
| 190 | count = _clamp_int(count, 5, 1, 20) |
| 191 | cmd = ['mtr', '-n', '-r', '-c', str(count)] |
| 192 | if source: |