bugfix ident
This commit is contained in:
parent
927c189b92
commit
6bb4f4d0e5
3 changed files with 45 additions and 64 deletions
2
AUTHORS
2
AUTHORS
|
|
@ -2,5 +2,5 @@ N:Johann Dréo
|
||||||
P:nojhan
|
P:nojhan
|
||||||
E:nojhan@gmail.com
|
E:nojhan@gmail.com
|
||||||
D:2009-06-23
|
D:2009-06-23
|
||||||
C:Initial code, maintener
|
C:Initial code, lead developper
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
current:
|
||||||
|
* added a via_host field (show on which host the tunnel is build)
|
||||||
|
* don't try to show connections if the user is not root
|
||||||
|
|
||||||
0.2:
|
0.2:
|
||||||
* update from the deprecated popen3 functions to the subprocess module (need python >= 2.4)
|
* update from the deprecated popen3 functions to the subprocess module (need python >= 2.4)
|
||||||
* html help page
|
* html help page
|
||||||
|
|
|
||||||
|
|
@ -33,16 +33,7 @@ from operator import itemgetter
|
||||||
class SSHTunnel(dict):
|
class SSHTunnel(dict):
|
||||||
"""A dictionary that stores an SSH connection related to a tunnel"""
|
"""A dictionary that stores an SSH connection related to a tunnel"""
|
||||||
|
|
||||||
def __init__(self,
|
def __init__(self, local_address = '1.1.1.1', local_port = 0, foreign_address = '1.1.1.1', foreign_port = 0, target_host = "Unknown", status = 'UNKNOWN', ssh_pid = 0, autossh_pid = 0 ):
|
||||||
local_address = '1.1.1.1',
|
|
||||||
local_port = 0,
|
|
||||||
foreign_address = '1.1.1.1',
|
|
||||||
foreign_port = 0,
|
|
||||||
target_host = "Unknown",
|
|
||||||
status = 'UNKNOWN',
|
|
||||||
ssh_pid = 0,
|
|
||||||
autossh_pid = 0
|
|
||||||
):
|
|
||||||
|
|
||||||
# informations available with netstat
|
# informations available with netstat
|
||||||
self['local_address'] = local_address
|
self['local_address'] = local_address
|
||||||
|
|
@ -274,25 +265,9 @@ class AutoSSHTunnelMonitor(list):
|
||||||
# add to the list of tunnels of the AutoSSHInstance instance
|
# add to the list of tunnels of the AutoSSHInstance instance
|
||||||
i['tunnels'] += [t]
|
i['tunnels'] += [t]
|
||||||
|
|
||||||
return autosshs
|
|
||||||
|
|
||||||
# instanciation
|
|
||||||
tunnels += [ SSHTunnel( local_addr, local_port, foreign_addr, foreign_port, autohost, status, sshpid, ppid ) ]
|
|
||||||
|
|
||||||
return tunnels
|
return tunnels
|
||||||
|
|
||||||
|
|
||||||
def bind_tunnels(self, autosshs, tunnels):
|
|
||||||
"""Bind autossh process to the related ssh connections, according to the pid"""
|
|
||||||
for t in tunnels:
|
|
||||||
for i in autosshs:
|
|
||||||
if i['pid'] == t['autossh_pid']:
|
|
||||||
# add to the list of tunnels of the AutoSSHInstance instance
|
|
||||||
i['tunnels'] += [t]
|
|
||||||
|
|
||||||
return autosshs
|
|
||||||
|
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
# INTERFACES
|
# INTERFACES
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
@ -359,6 +334,8 @@ class monitorCurses:
|
||||||
if kc != -1: # if keypress
|
if kc != -1: # if keypress
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
ch = chr(0)
|
||||||
|
|
||||||
if 0 < kc < 256: # if ascii key
|
if 0 < kc < 256: # if ascii key
|
||||||
# ascii character from the keycode
|
# ascii character from the keycode
|
||||||
ch = chr(kc)
|
ch = chr(kc)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue