MCPcopy
hub / github.com/sshuttle/sshuttle / list_routes

Function list_routes

sshuttle/server.py:117–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115
116
117def list_routes():
118 if sys.platform == 'win32':
119 routes = _list_routes(['route', 'PRINT', '-4'], _route_windows)
120 else:
121 if which('ip'):
122 routes = _list_routes(['ip', 'route'], _route_iproute)
123 elif which('netstat'):
124 routes = _list_routes(['netstat', '-rn'], _route_netstat)
125 else:
126 log('WARNING: Neither "ip" nor "netstat" were found on the server. '
127 '--auto-nets feature will not work.')
128 routes = []
129
130 for (family, ip, width) in routes:
131 if not ip.startswith('0.') and not ip.startswith('127.'):
132 yield (family, ip, width)
133
134
135def _exc_dump():

Callers 1

mainFunction · 0.85

Calls 3

whichFunction · 0.90
logFunction · 0.90
_list_routesFunction · 0.85

Tested by

no test coverage detected