Format: application/octet-stream
1 import socket
2 import sys
3 from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union
4
5 DEBUGLEVEL: int
6 TELNET_PORT: int
7
8 IAC: bytes
9 DONT: bytes
10 DO: bytes
11 WONT: bytes
12 WILL: bytes
13 theNULL: bytes
14
15 SE: bytes
16 NOP: bytes
17 DM: bytes
18 BRK: bytes
19 IP: bytes
20 AO: bytes
21 AYT: bytes
22 EC: bytes
23 EL: bytes
24 GA: bytes
25 SB: bytes
26
27 BINARY: bytes
28 ECHO: bytes
29 RCP: bytes
30 SGA: bytes
31 NAMS: bytes
32 STATUS: bytes
33 TM: bytes
34 RCTE: bytes
35 NAOL: bytes
36 NAOP: bytes
37 NAOCRD: bytes
38 NAOHTS: bytes
39 NAOHTD: bytes
40 NAOFFD: bytes
41 NAOVTS: bytes
42 NAOVTD: bytes
43 NAOLFD: bytes
44 XASCII: bytes
45 LOGOUT: bytes
46 BM: bytes
47 DET: bytes
48 SUPDUP: bytes
49 SUPDUPOUTPUT: bytes
50 SNDLOC: bytes
51 TTYPE: bytes
52 EOR: bytes
53 TUID: bytes
54 OUTMRK: bytes
55 TTYLOC: bytes
56 VT3270REGIME: bytes
57 X3PAD: bytes
58 NAWS: bytes
59 TSPEED: bytes
60 LFLOW: bytes
61 LINEMODE: bytes
62 XDISPLOC: bytes
63 OLD_ENVIRON: bytes
64 AUTHENTICATION: bytes
65 ENCRYPT: bytes
66 NEW_ENVIRON: bytes
67
68 TN3270E: bytes
69 XAUTH: bytes
70 CHARSET: bytes
71 RSP: bytes
72 COM_PORT_OPTION: bytes
73 SUPPRESS_LOCAL_ECHO: bytes
74 TLS: bytes
75 KERMIT: bytes
76 SEND_URL: bytes
77 FORWARD_X: bytes
78 PRAGMA_LOGON: bytes
79 SSPI_LOGON: bytes
80 PRAGMA_HEARTBEAT: bytes
81 EXOPL: bytes
82 NOOPT: bytes
83
84 class Telnet:
85 def __init__(self, host: Optional[str] = ..., port: int = ..., timeout: int = ...) -> None: ...
86 def open(self, host: str, port: int = ..., timeout: int = ...) -> None: ...
87 def msg(self, msg: str, *args: Any) -> None: ...
88 def set_debuglevel(self, debuglevel: int) -> None: ...
89 def close(self) -> None: ...
90 def get_socket(self) -> socket.socket: ...
91 def fileno(self) -> int: ...
92 def write(self, buffer: bytes) -> None: ...
93 def read_until(self, match: bytes, timeout: Optional[int] = ...) -> bytes: ...
94 def read_all(self) -> bytes: ...
95 def read_some(self) -> bytes: ...
96 def read_very_eager(self) -> bytes: ...
97 def read_eager(self) -> bytes: ...
98 def read_lazy(self) -> bytes: ...
99 def read_very_lazy(self) -> bytes: ...
100 def read_sb_data(self) -> bytes: ...
101 def set_option_negotiation_callback(self, callback: Optional[Callable[[socket.socket, bytes, bytes], Any]]) -> None: ...
102 def process_rawq(self) -> None: ...
103 def rawq_getchar(self) -> bytes: ...
104 def fill_rawq(self) -> None: ...
105 def sock_avail(self) -> bool: ...
106 def interact(self) -> None: ...
107 def mt_interact(self) -> None: ...
108 def listener(self) -> None: ...
109 def expect(
110 self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[int] = ...
111 ) -> Tuple[int, Optional[Match[bytes]], bytes]: ...
112 if sys.version_info >= (3, 6):
113 def __enter__(self) -> Telnet: ...
114 def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
115