Skip to content

Commit 9688735

Browse files
ryanbreenclaude
andcommitted
feat(telnet): add port forwarding and shell integration
- Add SLIRP port forwarding: localhost:2323 -> guest:2323 - Add telnetd and pty_test to shell's program registry - Enables running telnetd from the shell Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8c7e5cb commit 9688735

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/bin/qemu-uefi.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,13 @@ fn main() {
291291
_ => {
292292
// Default: SLIRP user-mode networking
293293
// Traffic is internal to QEMU, not visible on host interfaces
294+
// Port forwarding: host:2323 -> guest:2323 (telnet)
294295
qemu.args([
295-
"-netdev", "user,id=net0",
296+
"-netdev", "user,id=net0,hostfwd=tcp::2323-:2323",
296297
"-device", "e1000,netdev=net0,mac=52:54:00:12:34:56",
297298
]);
298299
eprintln!("[qemu-uefi] Network: SLIRP user-mode (10.0.2.x internal)");
300+
eprintln!("[qemu-uefi] Port forward: localhost:2323 -> guest:2323 (telnet)");
299301
}
300302
}
301303

userspace/tests/init_shell.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,17 @@ static PROGRAM_REGISTRY: &[ProgramEntry] = &[
577577
binary_name: b"tcp_client_test\0",
578578
description: "Send TCP message to 10.0.2.2:18888",
579579
},
580+
ProgramEntry {
581+
name: "telnetd",
582+
binary_name: b"telnetd\0",
583+
description: "Telnet server on port 2323",
584+
},
585+
// === PTY Test ===
586+
ProgramEntry {
587+
name: "pty_test",
588+
binary_name: b"pty_test\0",
589+
description: "Test PTY functionality",
590+
},
580591
];
581592

582593
/// Find a program in the registry by command name.

0 commit comments

Comments
 (0)