📄 telnet_8h-source.html
字号:
00142 );00143 00157 BOOL <a class="code" href="classPTelnetSocket.html#a3">Write</a>(00158 <span class="keyword">const</span> <span class="keywordtype">void</span> * buf, <span class="comment">// Pointer to a block of memory to write.</span>00159 PINDEX len <span class="comment">// Number of bytes to write.</span>00160 );00161 00162 00174 <span class="keyword">virtual</span> BOOL <a class="code" href="classPTelnetSocket.html#a4">Connect</a>(00175 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & address <span class="comment">// Address of remote machine to connect to.</span>00176 );00177 00178 00193 <span class="keyword">virtual</span> BOOL <a class="code" href="classPTelnetSocket.html#a5">Accept</a>(00194 <a class="code" href="classPSocket.html">PSocket</a> & socket <span class="comment">// Listening socket making the connection.</span>00195 );00196 00197 00204 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPTelnetSocket.html#a6">OnOutOfBand</a>(00205 <span class="keyword">const</span> <span class="keywordtype">void</span> * buf, <span class="comment">// Data to be received as URGENT TCP data.</span>00206 PINDEX len <span class="comment">// Number of bytes pointed to by <CODE>buf</CODE>.</span>00207 );00208 00209 00210 <span class="comment">// New functions</span><a name="l00211"></a><a class="code" href="classPTelnetSocket.html#s63">00211</a> <span class="keyword">enum</span> <a class="code" href="classPTelnetSocket.html#s63">Command</a> {00212 <a class="code" href="classPTelnetSocket.html#s63s0">IAC</a> = 255, <span class="comment">// Interpret As Command - escape character.</span>00213 <a class="code" href="classPTelnetSocket.html#s63s1">DONT</a> = 254, <span class="comment">// You are not to use option.</span>00214 <a class="code" href="classPTelnetSocket.html#s63s2">DO</a> = 253, <span class="comment">// Request to use option.</span>00215 <a class="code" href="classPTelnetSocket.html#s63s3">WONT</a> = 252, <span class="comment">// Refuse use of option.</span>00216 <a class="code" href="classPTelnetSocket.html#s63s4">WILL</a> = 251, <span class="comment">// Accept the use of option.</span>00217 <a class="code" href="classPTelnetSocket.html#s63s5">SB</a> = 250, <span class="comment">// Subnegotiation begin.</span>00218 <a class="code" href="classPTelnetSocket.html#s63s6">GoAhead</a> = 249, <span class="comment">// Function GA, you may reverse the line.</span>00219 <a class="code" href="classPTelnetSocket.html#s63s7">EraseLine</a> = 248, <span class="comment">// Function EL, erase the current line.</span>00220 <a class="code" href="classPTelnetSocket.html#s63s8">EraseChar</a> = 247, <span class="comment">// Function EC, erase the current character.</span>00221 <a class="code" href="classPTelnetSocket.html#s63s9">AreYouThere</a> = 246, <span class="comment">// Function AYT, are you there?</span>00222 <a class="code" href="classPTelnetSocket.html#s63s10">AbortOutput</a> = 245, <span class="comment">// Function AO, abort output stream.</span>00223 <a class="code" href="classPTelnetSocket.html#s63s11">InterruptProcess</a> = 244, <span class="comment">// Function IP, interrupt process, permanently.</span>00224 <a class="code" href="classPTelnetSocket.html#s63s12">Break</a> = 243, <span class="comment">// NVT character break.</span>00225 <a class="code" href="classPTelnetSocket.html#s63s13">DataMark</a> = 242, <span class="comment">// Marker for connection cleaning.</span>00226 <a class="code" href="classPTelnetSocket.html#s63s14">NOP</a> = 241, <span class="comment">// No operation.</span>00227 <a class="code" href="classPTelnetSocket.html#s63s15">SE</a> = 240, <span class="comment">// Subnegotiation end.</span>00228 <a class="code" href="classPTelnetSocket.html#s63s16">EndOfReccord</a> = 239, <span class="comment">// End of record for transparent mode.</span>00229 <a class="code" href="classPTelnetSocket.html#s63s17">AbortProcess</a> = 238, <span class="comment">// Abort the entire process</span>00230 <a class="code" href="classPTelnetSocket.html#s63s18">SuspendProcess</a>= 237, <span class="comment">// Suspend the process.</span>00231 <a class="code" href="classPTelnetSocket.html#s63s19">EndOfFile</a> = 236 <span class="comment">// End of file marker.</span>00232 };00233 <span class="comment">// Defined telnet commands codes</span>00234 00255 BOOL <a class="code" href="classPTelnetSocket.html#a7">SendCommand</a>(00256 <a class="code" href="classPTelnetSocket.html#s63">Command</a> cmd, <span class="comment">// Command code to send</span>00257 <span class="keywordtype">int</span> opt = 0 <span class="comment">// Option for command code.</span>00258 );00259 00260 <a name="l00261"></a><a class="code" href="classPTelnetSocket.html#s64">00261</a> <span class="keyword">enum</span> <a class="code" href="classPTelnetSocket.html#s64">Options</a> {00262 <a class="code" href="classPTelnetSocket.html#s64s20">TransmitBinary</a> = 0, <span class="comment">// Assume binary 8 bit data is transferred.</span>00263 <a class="code" href="classPTelnetSocket.html#s64s21">EchoOption</a> = 1, <span class="comment">// Automatically echo characters sent.</span>00264 <a class="code" href="classPTelnetSocket.html#s64s22">ReconnectOption</a> = 2, <span class="comment">// Prepare to reconnect</span>00265 <a class="code" href="classPTelnetSocket.html#s64s23">SuppressGoAhead</a> = 3, <span class="comment">// Do not use the GA protocol.</span>00266 <a class="code" href="classPTelnetSocket.html#s64s24">MessageSizeOption</a> = 4, <span class="comment">// Negatiate approximate message size</span>00267 <a class="code" href="classPTelnetSocket.html#s64s25">StatusOption</a> = 5, <span class="comment">// Status packets are understood.</span>00268 <a class="code" href="classPTelnetSocket.html#s64s26">TimingMark</a> = 6, <span class="comment">// Marker for synchronisation.</span>00269 <a class="code" href="classPTelnetSocket.html#s64s27">RCTEOption</a> = 7, <span class="comment">// Remote controlled transmission and echo.</span>00270 <a class="code" href="classPTelnetSocket.html#s64s28">OutputLineWidth</a> = 8, <span class="comment">// Negotiate about output line width.</span>00271 <a class="code" href="classPTelnetSocket.html#s64s29">OutputPageSize</a> = 9, <span class="comment">// Negotiate about output page size.</span>00272 <a class="code" href="classPTelnetSocket.html#s64s30">CRDisposition</a> = 10, <span class="comment">// Negotiate about CR disposition.</span>00273 <a class="code" href="classPTelnetSocket.html#s64s31">HorizontalTabsStops</a> = 11, <span class="comment">// Negotiate about horizontal tabstops.</span>00274 <a class="code" href="classPTelnetSocket.html#s64s32">HorizTabDisposition</a> = 12, <span class="comment">// Negotiate about horizontal tab disposition</span>00275 <a class="code" href="classPTelnetSocket.html#s64s33">FormFeedDisposition</a> = 13, <span class="comment">// Negotiate about formfeed disposition.</span>00276 <a class="code" href="classPTelnetSocket.html#s64s34">VerticalTabStops</a> = 14, <span class="comment">// Negotiate about vertical tab stops.</span>00277 <a class="code" href="classPTelnetSocket.html#s64s35">VertTabDisposition</a> = 15, <span class="comment">// Negotiate about vertical tab disposition.</span>00278 <a class="code" href="classPTelnetSocket.html#s64s36">LineFeedDisposition</a> = 16, <span class="comment">// Negotiate about output LF disposition.</span>00279 <a class="code" href="classPTelnetSocket.html#s64s37">ExtendedASCII</a> = 17, <span class="comment">// Extended ascic character set.</span>00280 <a class="code" href="classPTelnetSocket.html#s64s38">ForceLogout</a> = 18, <span class="comment">// Force logout.</span>00281 <a class="code" href="classPTelnetSocket.html#s64s39">ByteMacroOption</a> = 19, <span class="comment">// Byte macro.</span>00282 <a class="code" href="classPTelnetSocket.html#s64s40">DataEntryTerminal</a> = 20, <span class="comment">// data entry terminal.</span>00283 <a class="code" href="classPTelnetSocket.html#s64s41">SupDupProtocol</a> = 21, <span class="comment">// supdup protocol.</span>00284 <a class="code" href="classPTelnetSocket.html#s64s42">SupDupOutput</a> = 22, <span class="comment">// supdup output.</span>00285 <a class="code" href="classPTelnetSocket.html#s64s43">SendLocation</a> = 23, <span class="comment">// Send location.</span>00286 <a class="code" href="classPTelnetSocket.html#s64s44">TerminalType</a> = 24, <span class="comment">// Provide terminal type information.</span>00287 <a class="code" href="classPTelnetSocket.html#s64s45">EndOfRecordOption</a> = 25, <span class="comment">// Record boundary marker.</span>00288 <a class="code" href="classPTelnetSocket.html#s64s46">TACACSUID</a> = 26, <span class="comment">// TACACS user identification.</span>00289 <a class="code" href="classPTelnetSocket.html#s64s47">OutputMark</a> = 27, <span class="comment">// Output marker or banner text.</span>00290 <a class="code" href="classPTelnetSocket.html#s64s48">TerminalLocation</a> = 28, <span class="comment">// Terminals physical location infromation.</span>00291 <a class="code" href="classPTelnetSocket.html#s64s49">Use3270RegimeOption</a> = 29, <span class="comment">// 3270 regime.</span>00292 <a class="code" href="classPTelnetSocket.html#s64s50">UseX3PADOption</a> = 30, <span class="comment">// X.3 PAD</span>00293 <a class="code" href="classPTelnetSocket.html#s64s51">WindowSize</a> = 31, <span class="comment">// NAWS - Negotiate About Window Size.</span>00294 <a class="code" href="classPTelnetSocket.html#s64s52">TerminalSpeed</a> = 32, <span class="comment">// Provide terminal speed information.</span>00295 <a class="code" href="classPTelnetSocket.html#s64s53">FlowControl</a> = 33, <span class="comment">// Remote flow control.</span>00296 <a class="code" href="classPTelnetSocket.html#s64s54">LineModeOption</a> = 34, <span class="comment">// Terminal in line mode option.</span>00297 <a class="code" href="classPTelnetSocket.html#s64s55">XDisplayLocation</a> = 35, <span class="comment">// X Display location.</span>00298 <a class="code" href="classPTelnetSocket.html#s64s56">EnvironmentOption</a> = 36, <span class="comment">// Provide environment information.</span>00299 <a class="code" href="classPTelnetSocket.html#s64s57">AuthenticateOption</a> = 37, <span class="comment">// Authenticate option.</span>00300 <a class="code" href="classPTelnetSocket.html#s64s58">EncriptionOption</a> = 38, <span class="comment">// Encryption option.</span>00301 <a class="code" href="classPTelnetSocket.html#s64s59">ExtendedOptionsList</a> = 255, <span class="comment">// Code for extended options.</span>00302 <a class="code" href="classPTelnetSocket.html#s64s60">MaxOptions</a>00303 };00304 <span class="comment">// Defined TELNET options.</span>00305 00306 00312 <span class="keyword">virtual</span> BOOL <a class="code" href="classPTelnetSocket.html#a8">SendDo</a>(00313 BYTE <a class="code" href="classPTelnetSocket.html#n0">option</a> <span class="comment">// Option to DO</span>00314 );00315 00321 <span class="keyword">virtual</span> BOOL <a class="code" href="classPTelnetSocket.html#a9">SendDont</a>(00322 BYTE <a class="code" href="classPTelnetSocket.html#n0">option</a> <span class="comment">// Option to DONT</span>00323 );00324 00330 <span class="keyword">virtual</span> BOOL <a class="code" href="classPTelnetSocket.html#a10">SendWill</a>(00331 BYTE <a class="code" href="classPTelnetSocket.html#n0">option</a> <span class="comment">// Option to WILL</span>00332 );00333 00339 <span class="keyword">virtual</span> BOOL <a class="code" href="classPTelnetSocket.html#a11">SendWont</a>(00340 BYTE <a class="code" href="classPTelnetSocket.html#n0">option</a> <span class="comment">// Option to WONT</span>00341 );00342 <a name="l00343"></a><a class="code" href="classPTelnetSocket.html#s65">00343</a> <span class="keyword">enum</span> <a class="code" href="classPTelnetSocket.html#s65">SubOptionCodes</a> {00344 <a class="code" href="classPTelnetSocket.html#s65s61">SubOptionIs</a> = 0, <span class="comment">// Sub-option is...</span>00345 <a class="code" href="classPTelnetSocket.html#s65s62">SubOptionSend</a> = 1, <span class="comment">// Request to send option.</span>00346 };00347 <span class="comment">// Codes for sub option negotiation.</span>00348 00354 BOOL <a class="code" href="classPTelnetSocket.html#a12">SendSubOption</a>(00355 BYTE code, <span class="comment">// Suboptions option code.</span>00356 <span class="keyword">const</span> BYTE * info, <span class="comment">// Information to send.</span>00357 PINDEX len, <span class="comment">// Length of information.</span>00358 <span class="keywordtype">int</span> subCode = -1 <span class="comment">// Suboptions sub-code, -1 indicates no sub-code.</span>00359 );00360 <a name="l00364"></a><a class="code" href="classPTelnetSocket.html#a13">00364</a> <span class="keywordtype">void</span> <a class="code" href="classPTelnetSocket.html#a13">SetOurOption</a>(00365 BYTE code, <span class="comment">// Option to check.</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -