SSH: Implement pseudo terminal support.

Untested yet, because SSH tests are currently broken.
(They are fixed in 2.2 and will be merged back soon.)
This commit is contained in:
Christian Kandeler
2011-04-01 10:08:09 +02:00
parent 5488849c40
commit 7373155c0a
6 changed files with 45 additions and 3 deletions

View File

@@ -154,6 +154,23 @@ void SshOutgoingPacket::generateEnvPacket(quint32 remoteChannel,
.appendBool(false).appendString(var).appendString(value).finalize();
}
void SshOutgoingPacket::generatePtyRequestPacket(quint32 remoteChannel,
const SshPseudoTerminal &terminal)
{
init(SSH_MSG_CHANNEL_REQUEST).appendInt(remoteChannel)
.appendString("pty-req").appendBool(false)
.appendString(terminal.termType).appendInt(terminal.columnCount)
.appendInt(terminal.rowCount);
QByteArray modeString;
for (SshPseudoTerminal::ModeMap::ConstIterator it = terminal.modes.constBegin();
it != terminal.modes.constEnd(); ++it) {
modeString += encodeInt(static_cast<quint8>(it.key()));
modeString += encodeInt(it.value());
}
modeString += encodeInt(static_cast<quint8>(0)); // TTY_OP_END
appendString(modeString).finalize();
}
void SshOutgoingPacket::generateExecPacket(quint32 remoteChannel,
const QByteArray &command)
{