Add telnet control (set_telnet/telnet_enabled + CLI)#1
Merged
Conversation
Verified on hardware (SD-2N-4G, firmware 30.13...R): - set_telnet(True) opens port 23, set_telnet(False) closes it - Read-modify-write preserves other InnerServer subkeys (SSH, FTP, etc.) - Sync + async surfaces, CLI subcommand, unit test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds control of the built-in Dahua telnet server via the DHIP binary protocol (TCP 5000), mirroring the flow in the
open_telnet.shreference script but using the existingconfigManager.setConfigmachinery instead of HTTP RPC2.Verified on hardware
Device: 10.216.128.118 (SD-2N-4G-class camera), admin / admin54321.
set_telnet(True)nc -zv)set_telnet(False)telnet_enabled()matches written stateBefore/after
InnerServerconfig read back from the device:Public API
set_telnetdoes a read-modify-write ofInnerServer.Telnetso sibling subkeys (SSH, FTP, ...) are preserved.CLI
Sync / async
Mirrored in both
DahuaClient(sync) andAsyncDahuaClient(async), per the CLAUDE.md convention.Tests
tests/test_dahua.TestTelnet.test_set_telnet_read_modify_write— fake-server round-trip; verifies the SSH subkey is preserved across enable/disable.python -m unittest discover -s tests— 30 passedpython tests/test_loopback.py— OKChecklist
python -m unittest discover -s testspasses;tests/test_loopback.pypasses.