runtimepy.net.tcp.telnet package#
Submodules#
runtimepy.net.tcp.telnet.codes module#
Code enumerations relevant to the telnet (RFC 854) protocol.
- class runtimepy.net.tcp.telnet.codes.TelnetCode(*values)[source]#
Bases:
IntEnum
An enumeration of byte values important to the telnet protocol.
- AO = 245#
- AYT = 246#
- BREAK = 243#
- DATA_MARK = 242#
- DO = 253#
- DONT = 254#
- EC = 247#
- EL = 248#
- GA = 249#
- IAC = 255#
- IP = 244#
- NOP = 241#
- SB = 250#
- SE = 240#
- WILL = 251#
- WONT = 252#
- class runtimepy.net.tcp.telnet.codes.TelnetNvt(*values)[source]#
Bases:
IntEnum
Telnet data relevant to the NVT printer and keyboard.
- BEL = 7#
- BS = 8#
- CR = 13#
- FF = 12#
- HT = 9#
- LF = 10#
- NUL = 0#
- VT = 11#
runtimepy.net.tcp.telnet.np_05b module#
A module implementing a Telnet interface for the NP-05B.
- class runtimepy.net.tcp.telnet.np_05b.Np05bConnection(transport: Transport, protocol: QueueProtocol, **kwargs)[source]#
Bases:
BasicTelnet
,AsyncCommandProcessingMixin
A class implementing a communication interface with the NP-05B networked PDU.
- chan_to_idx: dict[str, int]#
- default_auto_restart = True#
- async handle_command(args: Namespace, channel: BitField | Channel[Int8Primitive] | Channel[Int16Primitive] | Channel[Int32Primitive] | Channel[Int64Primitive] | Channel[Uint8Primitive] | Channel[Uint16Primitive] | Channel[Uint32Primitive] | Channel[Uint64Primitive] | Channel[FloatPrimitive] | Channel[DoublePrimitive] | Channel[BooleanPrimitive] | None) None [source]#
Handle a command.
- lock: Lock#
- async np05b_command(message: Np05bStrings, *parts: str) None [source]#
Send a command then read outlet states.
- num_ports = 5#
- prev_cmd: str#
- process_response(command: Np05bStrings, command_data: str, response: str) None [source]#
Process a command response from the NP-05B.
- prompt = '>'#
Module contents#
A module implementing a basic telnet (RFC 854) connection interface.
- class runtimepy.net.tcp.telnet.BasicTelnet(transport: Transport, protocol: QueueProtocol, **kwargs)[source]#
Bases:
Telnet
A simple telnet implementation.
- async handle_nvt(action: TelnetNvt) None [source]#
Handle a signal for the network virtual-terminal.
- async process_command(code: TelnetCode) None [source]#
Process a telnet command.
- async process_option(code: TelnetCode, option: int, _: BinaryIO) None [source]#
Process a telnet option.
- class runtimepy.net.tcp.telnet.Telnet(transport: Transport, protocol: QueueProtocol, **kwargs)[source]#
Bases:
TcpConnection
A class implementing a basic telnet interface.
- abstractmethod async handle_nvt(action: TelnetNvt) None [source]#
Handle a signal for the network virtual-terminal.
- log_alias = 'TELNET'#
- abstractmethod async process_command(code: TelnetCode) None [source]#
Process a telnet command.
- abstractmethod async process_option(code: TelnetCode, option: int, stream: BinaryIO) None [source]#
Process a telnet option.
- async process_telnet_message(data: bytes) bool [source]#
By default, treat all incoming data bytes as text.
- send_command(code: TelnetCode) None [source]#
Send a telnet command.
- send_option(option: TelnetCode, code: int) None [source]#
Send a telnet option sequence. if the ‘SB’ is the desired code, the additional data can be sent using the ‘send_binary’ method directly.
- class runtimepy.net.tcp.telnet.TelnetCode(*values)[source]#
Bases:
IntEnum
An enumeration of byte values important to the telnet protocol.
- AO = 245#
- AYT = 246#
- BREAK = 243#
- DATA_MARK = 242#
- DO = 253#
- DONT = 254#
- EC = 247#
- EL = 248#
- GA = 249#
- IAC = 255#
- IP = 244#
- NOP = 241#
- SB = 250#
- SE = 240#
- WILL = 251#
- WONT = 252#