Subject: Telnet CR and LF translations
To: netbsd-help <netbsd-help@NetBSD.ORG>
From: John Maier <JohnAM@datastorm.com>
List: netbsd-help
Date: 03/29/1995 09:20:00
I've been playing with transferring data via Telnet, I've been running into 
a slight problem with NetBSD 1.0.
CRs and LFs get translated when sent from the host.
Example:
I've a file with different sequences of LFs an CRs.  If I FTP the file 
(binary), the data is unchanged.  If I cat it out, the data is changed to 
this:

original data: What I actually get:
Hex:
cr lf sp       0D 00 0D 0A 20
cr cr sp       0D 00 0D 00 20
cr nl sp       0D 00 00 20
cr sp          0D 00 20
lf cr sp       0D 0A 0D 00 20
lf lf sp       0D 0A 0D 0A 20
sp cr sp       20 0D 00 20
sp lf sp       20 0D 0A 20

Hex translation:
cr lf sp       cr nl cr lf sp
cr cr sp       cr nl cr nl sp
cr nl sp       cr nl nl sp
cr sp          cr nl sp
lf cr sp       cr lf cr nl sp
lf lf sp       cr lf cr lf sp
sp cr sp       sp cr nl sp
sp lf sp       sp cr lf sp

nl=NULL(00)
cr=Carrage Return(0D)
lf=Line Feed(0A)
sp=Space(20)

What do I need to do to with my Telnet negotiations to stop this 
translation?

I've even tried adding -k to telnetd in the /etc/inet.conf.

What I'm negotiating in relation to line mode/kludge line mode:
In the telnetd man page, I checked what they have to say about this and we 
seem to be doing it properly.

Here is what we're doing.

DONT SUPPRESS-GO-AHEAD
DO ECHO
in response to a WILL TIMING-MARK we send WONT TIMING-MARK.

Maybe I'm missing the purpose of line mode verses kludge mode.  From
what I read, line mode has the client do all of the editing and then
sends the line upon a enter, where kludge does character at a time,
editing on the host.

At where am I in error?

thanks for the help,
jam

**********************************************************************
*       John A. Maier          * Research Assistant For Datastorm    *
* E-mail: johnam@datastorm.com * Technologies Inc. (Procomm Plus)    *
*                              * (314) 443-3283                      *
**********************************************************************