Esempio n. 1
0
        public CcmBridge(string name, string ipPrefix, bool instantiateSshClient = false)
        {
            Name     = name;
            IpPrefix = ipPrefix;
            CcmDir   = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
            if (instantiateSshClient)
            {
                string sshHost     = "TBD";
                int    sshPort     = -1;
                string sshUser     = "******";
                string sshPassword = "******";
                _sshClient = new Renci.SshNet.SshClient(sshHost, sshPort, sshUser, sshPassword);
                _sshClient.Connect();

                _sshShellStream = _sshClient.CreateShellStream("CCM", 80, 60, 100, 100, 1000);
                var outp = new StringBuilder();
                while (true)
                {
                    outp.Append(_sshShellStream.Read());
                    if (outp.ToString().Trim().EndsWith("$"))
                    {
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
        private CCMBridge()
        {
            _ccmDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
            _ssh_client = new Renci.SshNet.SshClient(Options.Default.SSH_HOST, Options.Default.SSH_PORT, Options.Default.SSH_USERNAME, Options.Default.SSH_PASSWORD);
            _ssh_client.Connect();

            _ssh_shellStream = _ssh_client.CreateShellStream("CCM", 80, 60, 100, 100, 1000);
            var outp = new StringBuilder();
            while (true)
            {
                outp.Append(_ssh_shellStream.Read());
                if (outp.ToString().Trim().EndsWith("$"))
                    break;
            }
        }
Esempio n. 3
0
        private CCMBridge()
        {
            _ccmDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
            _ssh_client = new Renci.SshNet.SshClient(_ssh_host, _ssh_port, _ssh_username, _ssh_password);
            _ssh_client.Connect();

            _ssh_shellStream = _ssh_client.CreateShellStream("CCM", 80, 60, 100, 100, 1000);
            var outp = new StringBuilder();
            while (true)
            {
                outp.Append(_ssh_shellStream.Read());
                if (outp.ToString().Trim().EndsWith("$"))
                    break;
            }
        }
Esempio n. 4
0
        private CCMBridge()
        {
            _ccmDir     = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
            _ssh_client = new Renci.SshNet.SshClient(Options.Default.SSH_HOST, Options.Default.SSH_PORT, Options.Default.SSH_USERNAME, Options.Default.SSH_PASSWORD);
            _ssh_client.Connect();

            _ssh_shellStream = _ssh_client.CreateShellStream("CCM", 80, 60, 100, 100, 1000);
            var outp = new StringBuilder();

            while (true)
            {
                outp.Append(_ssh_shellStream.Read());
                if (outp.ToString().Trim().EndsWith("$"))
                {
                    break;
                }
            }
        }
Esempio n. 5
0
        private CCMBridge()
        {
            _ccmDir     = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
            _ssh_client = new Renci.SshNet.SshClient(_ssh_host, _ssh_port, _ssh_username, _ssh_password);
            _ssh_client.Connect();

            _ssh_shellStream = _ssh_client.CreateShellStream("CCM", 80, 60, 100, 100, 1000);
            var outp = new StringBuilder();

            while (true)
            {
                outp.Append(_ssh_shellStream.Read());
                if (outp.ToString().Trim().EndsWith("$"))
                {
                    break;
                }
            }
        }
Esempio n. 6
0
        public CcmBridge(string name, string ipPrefix, bool instantiateSshClient = false)
        {
            Name = name;
            IpPrefix = ipPrefix;
            CcmDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
            if (instantiateSshClient)
            {
                string sshHost = "TBD";
                int sshPort = -1;
                string sshUser  = "******";
                string sshPassword = "******";
                _sshClient = new Renci.SshNet.SshClient(sshHost, sshPort, sshUser, sshPassword);
                _sshClient.Connect();

                _sshShellStream = _sshClient.CreateShellStream("CCM", 80, 60, 100, 100, 1000);
                var outp = new StringBuilder();
                while (true)
                {
                    outp.Append(_sshShellStream.Read());
                    if (outp.ToString().Trim().EndsWith("$"))
                        break;
                }
            }
        }