6 Net::Telnet - Defines constants for the telnet protocol
10 use Telnet qw(TELNET_IAC TELNET_DO TELNET_DONT);
14 This module is B<VERY> preliminary as I am not 100% sure how it should
17 Currently it just exports constants used in the telnet protocol.
19 Should it contain sub's for packing and unpacking commands ?
21 Please feel free to send me any suggestions
25 This is not an implementation of the 'telnet' command but of the telnet
26 protocol as defined in RFC854
30 Graham Barr <Graham.Barr@tiuk.ti.com>
38 Copyright (c) 1995 Graham Barr. All rights reserved. This program is free
39 software; you can redistribute it and/or modify it under the same terms
44 use vars qw(@ISA $VERSION);
48 $VERSION = sprintf("%d.%02d", q$Revision: 2.0 $ =~ /(\d+)\.(\d+)/);
51 TELNET_IAC => 255, # interpret as command:
52 TELNET_DONT => 254, # you are not to use option
53 TELNET_DO => 253, # please, you use option
54 TELNET_WONT => 252, # I won't use option
55 TELNET_WILL => 251, # I will use option
56 TELNET_SB => 250, # interpret as subnegotiation
57 TELNET_GA => 249, # you may reverse the line
58 TELNET_EL => 248, # erase the current line
59 TELNET_EC => 247, # erase the current character
60 TELNET_AYT => 246, # are you there
61 TELNET_AO => 245, # abort output--but let prog finish
62 TELNET_IP => 244, # interrupt process--permanently
63 TELNET_BREAK => 243, # break
64 TELNET_DM => 242, # data mark--for connect. cleaning
65 TELNET_NOP => 241, # nop
66 TELNET_SE => 240, # end sub negotiation
67 TELNET_EOR => 239, # end of record (transparent mode)
68 TELNET_ABORT => 238, # Abort process
69 TELNET_SUSP => 237, # Suspend process
70 TELNET_EOF => 236, # End of file: EOF is already used...
72 TELNET_SYNCH => 242, # for telfunc calls
75 while(($n,$v) = each %telnet) { eval "sub $n {$v}"; }
81 while(($n,$v) = each %telnet) {
91 TELOPT_BINARY => 0, # 8-bit data path
92 TELOPT_ECHO => 1, # echo
93 TELOPT_RCP => 2, # prepare to reconnect
94 TELOPT_SGA => 3, # suppress go ahead
95 TELOPT_NAMS => 4, # approximate message size
96 TELOPT_STATUS => 5, # give status
97 TELOPT_TM => 6, # timing mark
98 TELOPT_RCTE => 7, # remote controlled transmission and echo
99 TELOPT_NAOL => 8, # negotiate about output line width
100 TELOPT_NAOP => 9, # negotiate about output page size
101 TELOPT_NAOCRD => 10, # negotiate about CR disposition
102 TELOPT_NAOHTS => 11, # negotiate about horizontal tabstops
103 TELOPT_NAOHTD => 12, # negotiate about horizontal tab disposition
104 TELOPT_NAOFFD => 13, # negotiate about formfeed disposition
105 TELOPT_NAOVTS => 14, # negotiate about vertical tab stops
106 TELOPT_NAOVTD => 15, # negotiate about vertical tab disposition
107 TELOPT_NAOLFD => 16, # negotiate about output LF disposition
108 TELOPT_XASCII => 17, # extended ascic character set
109 TELOPT_LOGOUT => 18, # force logout
110 TELOPT_BM => 19, # byte macro
111 TELOPT_DET => 20, # data entry terminal
112 TELOPT_SUPDUP => 21, # supdup protocol
113 TELOPT_SUPDUPOUTPUT => 22, # supdup output
114 TELOPT_SNDLOC => 23, # send location
115 TELOPT_TTYPE => 24, # terminal type
116 TELOPT_EOR => 25, # end or record
117 TELOPT_TUID => 26, # TACACS user identification
118 TELOPT_OUTMRK => 27, # output marking
119 TELOPT_TTYLOC => 28, # terminal location number
120 TELOPT_3270REGIME => 29, # 3270 regime
121 TELOPT_X3PAD => 30, # X.3 PAD
122 TELOPT_NAWS => 31, # window size
123 TELOPT_TSPEED => 32, # terminal speed
124 TELOPT_LFLOW => 33, # remote flow control
125 TELOPT_LINEMODE => 34, # Linemode option
126 TELOPT_XDISPLOC => 35, # X Display Location
127 TELOPT_OLD_ENVIRON => 36, # Old - Environment variables
128 TELOPT_AUTHENTICATION => 37, # Authenticate
129 TELOPT_ENCRYPT => 38, # Encryption option
130 TELOPT_NEW_ENVIRON => 39, # New - Environment variables
131 TELOPT_EXOPL => 255, # extended-options-list
134 while(($n,$v) = each %telopt) { eval "sub $n {$v}"; }
140 while(($n,$v) = each %telopt) {
148 # sub-option qualifiers
150 sub TELQUAL_IS {0} # option is...
151 sub TELQUAL_SEND {1} # send option
152 sub TELQUAL_INFO {2} # ENVIRON: informational version of IS
153 sub TELQUAL_REPLY {2} # AUTHENTICATION: client version of IS
154 sub TELQUAL_NAME {3} # AUTHENTICATION: client version of IS
156 sub LFLOW_OFF {0} # Disable remote flow control
157 sub LFLOW_ON {1} # Enable remote flow control
158 sub LFLOW_RESTART_ANY {2} # Restart output on any char
159 sub LFLOW_RESTART_XON {3} # Restart output only on XON
161 # LINEMODE suboptions
164 sub LM_FORWARDMASK {2}
168 sub MODE_TRAPSIG {0x02}
170 sub MODE_SOFT_TAB {0x08}
171 sub MODE_LIT_ECHO {0x10}
175 # Not part of protocol, but needed to simplify things...
176 sub MODE_FLOW {0x0100}
177 sub MODE_ECHO {0x0200}
178 sub MODE_INBIN {0x0400}
179 sub MODE_OUTBIN {0x0800}
180 sub MODE_FORCE {0x1000}
204 while(($n,$v) = each %slc) { eval "sub $n {$v}"; }
210 while(($n,$v) = each %slc) {
220 sub SLC_NOSUPPORT {0}
221 sub SLC_CANTCHANGE {1}
224 sub SLC_LEVELBITS {0x03}
231 sub SLC_FLUSHIN {0x40}
232 sub SLC_FLUSHOUT {0x20}
235 sub OLD_ENV_VALUE {0}
237 sub NEW_ENV_VALUE {1}
241 @EXPORT_OK = (keys %telnet, keys %telopt, keys %slc);