Home | History | Annotate | Download | only in hosts

Lines Matching refs:port

38         @param port: The host object associated with this instance of
45 def _setup_port(self, port, command_name, remote_pid=None):
49 We could open the port, but doing that would conflict with security
51 the port on the target we use an ssh tunnel.
55 a remote port. As such, it enforces a single proxy->remote port
56 policy, i.e if one starts a jsonrpc proxy/server from port A->B,
57 and then tries to start an xmlrpc proxy forwarded to the same port,
71 to the same remote port. If methods are invoked on the client
74 @param port: The remote forwarding port.
80 @return the local port which is used for port forwarding on the ssh
83 self.disconnect(port)
85 tunnel_proc = self._host.create_ssh_tunnel(port, local_port)
86 self._rpc_proxy_map[port] = (command_name, tunnel_proc, remote_pid)
90 def _setup_rpc(self, port, command_name, remote_pid=None):
93 @param port: The remote forwarding port.
102 port, command_name, remote_pid=remote_pid)
105 def tunnel_connect(self, port):
108 @param port: The remote forwarding port.
112 return self._RPC_HOST_ADDRESS_FORMAT % self._setup_port(port, None)
115 def xmlrpc_connect(self, command, port, command_name=None,
121 starts an XMLRPC server on the given `port`. The command
140 If a server is already running on the remote port, this
146 @param port Port number on which the server is expected to
163 self.disconnect(port)
174 # Tunnel through SSH to be able to reach that remote port.
175 rpc_url = self._setup_rpc(port, command_name, remote_pid=remote_pid)
207 self.disconnect(port)
212 def jsonrpc_connect(self, port):
224 to the same remote port, provided the remote port has an rpc server
229 @param port: port on the remote host that is serving this proxy.
238 proxy = jsonrpclib.jsonrpc.ServerProxy(self._setup_rpc(port, None))
240 logging.info('Established a jsonrpc connection through port %s.', port)
244 def disconnect(self, port):
248 the given `port`. Also closes the local ssh tunnel created
254 This function does nothing if requested to disconnect a port
257 @param port Port number passed to a previous call to
260 if port not in self._rpc_proxy_map:
262 remote_name, tunnel_proc, remote_pid = self._rpc_proxy_map[port]
291 self._host.disconnect_ssh_tunnel(tunnel_proc, port)
292 del self._rpc_proxy_map[port]
297 for port in self._rpc_proxy_map.keys():
298 self.disconnect(port)