Skip to main content

Command Meanings

2.1 The LINEMODE function​

   IAC WILL LINEMODE

The sender of this command REQUESTS permission to begin sub-negotiation of the editing/signaling status. This should only be sent by the client side of the connection.

   IAC WONT LINEMODE

The sender of this command DEMANDS that sub-negotiation of the editing/signaling status not be allowed.

   IAC DO LINEMODE

The sender of this command REQUESTS that the remote side begin sub-negotiation of the editing/signaling status. This should only be sent by the server side of the connection.

   IAC DONT LINEMODE

The sender of this command DEMANDS that the remote side not begin sub-negotiation of the editing/signaling status.

2.2 LINEMODE suboption MODE​

   IAC SB LINEMODE MODE mask IAC SE

The sender of this command CONFIRMS, or REQUESTS permission for, a switch to the mode defined by "mask".

The "mask" is a bit mask of various modes that the connection can be in. Under normal operation, the server side of the connection will initiate mode changes, and the client will confirm the mode changes. The currently defined modes are:

EDIT When set, the client side of the connection should process all input lines, performing any editing functions, and only send completed lines to the remote side. When unset, client side should not process any input from the user, and the server side should take care of all character processing that needs to be done.

TRAPSIG When set, the client side should translate appropriate interrupts/signals to their Telnet equivalent. (These would be IP, BRK, AYT, ABORT, EOF, and SUSP) When unset, the client should pass interrupts/signals as their normal ASCII values.

FLOW Logically, this belongs in the "mask". However, this would overlap the Telnet TOGGLE-FLOW-CONTROL option, so the Telnet TOGGLE-FLOW-CONTROL option is used instead. When DO/WILL LINEMODE is negotiated, DO/WILL TOGGLE-FLOW-CONTROL should also be negotiated. See RFC 1080, "Telnet Remote Flow Control", for correct usage.

ECHO Logically, this belongs in the "mask". However, this would overlap the Telnet ECHO option, so the Telnet ECHO option is used instead. The client side should never negotiate "WILL ECHO". When the server has negotiated "WILL ECHO", the client should not echo data typed by the user back to the user. When the server has negotiated "WONT ECHO", the the client is responsible for echoing data typed by the user back to the user. See RFC 857, "Telnet ECHO OPTION" for a complete discussion on the use of the Telnet ECHO option.

SOFT_TAB When set, the client side should expand the Horizontal Tab (HT) code, USASCII 9, into the appropriate number of spaces to move the printer to the next horizontal tab stop. When unset, the client side should allow the Horizontal Tab code to pass through un-modified.

LIT_ECHO When set, if the client side is echoing a non-printable character that the user has typed to the users screen, the character should be echoed as the literal character. If the LIT_ECHO bit is not set, then the client side may echo the character in any manner that it desires. (Many systems echo unprintable characters as two character sequences, for example, they will echo "^A" for an ASCII 1 value.)

When the client side of a connection receives a MODE command, it MUST agree with at least the state of the EDIT and TRAPSIG bits. If a MODE command is received with a mode mask that is currently in use (ignoring the MODE_ACK bit), the MODE command is ignored. If a MODE command is received that is different from the current mode mask, then a reply is sent with either the new mode mask and the MODE_ACK bit set, or a subset of the new mode mask. The only exception is that if the server receives a MODE with either the EDIT or TRAPSIG bits not set, it may set the EDIT and TRAPSIG bits in the response, and if the client receives a MODE with the EDIT or TRAPSIG bits set, it may not clear them in the response.

When a MODE command is received with the MODE_ACK bit set, and the mode is different that what the current mode is, the client will ignore the new mode, and the server will switch to the new mode. This ensures that both sides of the connection will resolve to the same mode. In all cases, a response is never generated to a MODE command that has the MODE_ACK bit set.

2.3 LINEMODE suboption FORWARDMASK​

   IAC SB LINEMODE DO FORWARDMASK mask0 mask1 ... mask31 IAC SE

The sender of this command request that the other side send any buffered data when any of the ASCII characters defined by the bit mask are received. Only the side of the connection that sent DO LINEMODE (the server side) may negotiate this. The mask is up to 32 octets long. Each octet represents 8 ASCII character codes. The high order bit of mask0 corresponds to an ASCII code of 0. The low order bit of mask0 corresponds to an ASCII code of 7. The high order bit of mask1 corresponds to an ASCII code of 8. The low order bit of mask1 corresponds to an ASCII code of 15, and so on. The mask list may be terminated before the end of the list, in which case all the rest of the mask octets are assumed to be reset (equal to zero). When the server side is in DONT TRANSMIT-BINARY mode, then only the first 16 octets of the mask (ASCII codes 0 through 127) are used. If any individual octet of the mask is equal to IAC, it must be sent as a double IAC.

   IAC SB LINEMODE DONT FORWARDMASK IAC SE

The sender of this command requests that the other side stop using the forward mask to determine when to send buffered data.

   IAC SB LINEMODE WILL FORWARDMASK IAC SE

This command is sent in response to a DO FORWARDMASK command. It indicates that the forward mask will be used to determine when to send buffered data.

   IAC SB LINEMODE WONT FORWARDMASK IAC SE

This command is sent in response to a DO FORWARDMASK command. It indicates that the forward mask will not be used to determine when to send buffered data.

2.4 LINEMODE suboption SLC, Set Local Characters​

The SLC suboption uses a list of octet triplets. The first octet specifies the function, the second octet specifies modifiers to the function, and the third octet specifies the ASCII character for the function.

   IAC SB LINEMODE SLC <list of octet triplets> IAC SE

The sender of this command REQUESTS that the list of octet triplets be used to set the local character to be used to send to perform the specified function.

There are four levels that a function may be set to. SLC_NOSUPPORT is the lowest, SLC_CANTCHANGE is the next higher level, SLC_VALUE is above that, and SLC_DEFAULT is the highest level.

If the SLC_LEVELBITS in the second octet are equal to SLC_DEFAULT, then this particular function should use the system default on the other side of the connection.

If the SLC_LEVELBITS in the second octet are equal to SLC_VALUE, then this function is supported, and the current value is specified by the third octet.

If the SLC_LEVELBITS in the second octet are equal to SLC_CANTCHANGE, then this is a function that is supported, but the value for this function, specified in the third octet, cannot be changed.

If the SLC_LEVELBITS in the second octet are equal to SLC_NOSUPPORT, then this particular function is not supported and should be disabled by the other side.

If this is a response to a previous request to change a special character, and we are agreeing to the change, then the SLC_ACK bit must be set in the second octet.

If the SLC_FLUSHIN bit is set in the second octet, then whenever this function is sent, a Telnet "sync" should be sent at the same time to flush the input stream.

If the SLC_FLUSHOUT bit is set in the second octet, then whenever this function is sent, output data should be flushed.

Only the client may send an octet triplet with the first octet equal to zero. In this case, the SLC_LEVELBITS may only be set to SLC_DEFAULT or SLC_VALUE, and the third octet does not matter. When the server receives 0 SLC_DEFAULT 0, it should switch to its system default special character settings, and send all those special characters to the client. When the server receives 0 SLC_VALUE 0, it should just send its current special character settings. Note that if the server does not support some of the editing functions, they should be sent as XXX SLC_DEFAULT 0, rather than as XXX SLC_NOSUPPORT 0, so that the client may choose to use its own values for those functions, rather than have to disable those functions even if it supports them.

If any of the octets in the list of octet triplets is equal to IAC, it must be sent as a double IAC.

When a connection is established, it is the responsibility of the client to either request the remote default values for the special characters, or to send across what all the special characters should be set to.

The function values can be put into two groups, functions that are to be translated to their Telnet equivalents before being sent across the Telnet connection, and functions that are to be recognized and processed locally.

First, we have those characters that are to be mapped into their Telnet equivalents:

SLC_SYNCH Synch. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description.

SLC_BRK Break. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description.

SLC_IP Interrupt Process. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description.

SLC_AO Abort Output. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description.

SLC_AYT Are You There. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description.

SLC_EOR End of Record. See RFC 885, "TELNET END OF RECORD OPTION" for a complete description.

SLC_ABORT Abort. See section 2.5 for a complete description.

SLC_EOF End of File. See section 2.5 for a complete description.

SLC_SUSP Suspend. See section 2.5 for a complete description.

Next, we have the locally interpreted functions.

SLC_EC Erase Character. This is the character that is typed to erase one character from the input stream. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description.

SLC_EL Erase Line. This is the character that is typed to erase the entire contents of the current line of input. See RFC 854, "TELNET PROTOCOL SPECIFICATION", for a complete description.

SLC_EW Erase Word. This is the character that is typed to erase one word from the input stream.

SLC_RP Reprint Line. This is the character that is typed to cause the current line of input to be reprinted, leaving the cursor at the end of the line.

SLC_LNEXT Literal Next. This is the character that is typed to indicate that the next character is to be taken literally, no character processing should be done with it, and if it is a special character that would normally get mapped into a Telnet option, that mapping should not be done.

SLC_XON Start Output. This is the character that is sent to resume output to the users terminal.

SLC_XOFF Stop Output. This is the character that is sent to stop output to the users terminal.

SLC_FORW1 Forwarding character. This is a character that should cause all data currently being buffered, and this character, to be sent immediately.

SLC_FORW2 Forwarding character. This is another character that is to be treated in the same manner as SLC_FORW1.

SLC_MCL Move cursor one character left. When visual editing is supported, this is the character that, when typed, will move the cursor one character to the left in the display.

SLC_MCR Move cursor one character right. When visual editing is supported, this is the character that, when typed, will move the cursor one character to the right in the display.

SLC_MCWL Move cursor one word left. When visual editing is supported, this is the character that, when typed, will move the cursor one word to the left in the display.

SLC_MCWR Move cursor one word right. When visual editing is supported, this is the character that, when typed, will move the cursor one word to the right in the display.

SLC_MCBOL Move cursor to the begining of the line. When visual editing is supported, this is the character that, when typed, will move the cursor to the begining of the line that is being edited.

SLC_MCEOL Move cursor to the end of the line. When visual editing is supported, this is the character that, when typed, will move the cursor to the end of the line that is being edited.

SLC_INSRT Enter insert mode. When visual editing is supported, after this character is typed, all normal characters that are subsequently typed will be inserted into the display.

SLC_OVER Enter overstrike mode. When visual editing is supported, after this character is typed, all normal charactersthat are subsequently typed will overwrite any characters in the current display. If the SLC_INSRT and SLC_OVER variables are set to the same value, then that value is to act as a toggle between overstrike and insert mode.

SLC_ECR Erase character to the right. When visual editing is supported, this is the character that, when typed, will erase one character to the right of the cursor.

SLC_EWR Erase word to the right. When visual editing is supported, this is the character that, when typed, will erase one word to the right of the cursor.

SLC_EBOL Erase to the begining of the line. When visual editing is supported, this is the character that, when typed, will erase all the characters to the left of the cursor.

SLC_EEOL Erase to the end of the line. When visual editing is supported, this is the character that, when typed, will erase all characters to the right of the cursor.

For SLC_EEOL, SLC_EWR, and SLC_ECR, if a system has a cursor that is not diplayed between characters, but is positioned over a character, that character is assumed to be to the right of the cursor. Thus, the SLC_ECR will erase the character that is under the current cursor position.

2.5 New control characters​

   IAC ABORT

Abort. Similar to "IAC IP", but means only to abort or terminate the process to which the NVT is connected. (The Telnet spec says IP may "suspend, interrupt, abort or terminate" the process.) If a system does not have two methods of interrupting a process, then ABORT and IP should have the same effect.

   IAC SUSP

Suspend the execution of the current process attached to the NVT in such a way that another process will take over control of the NVT, and the suspended process can be resumed at a later time. If the receiving system does not support this functionality, it should be ignored.

   IAC EOF

End Of File. The recipient should notify the process connected to the NVT that an end of file has been reached. This is intended for systems that support the ability for the user to type in an EOF character at the keyboard.