python telnet script for openvms host

David Bolen db3l at fitlinxx.com
Wed Dec 27 22:20:02 EST 2000


Ennis Rosamond <ennisr at my-deja.com> writes:

> Looking at the actual client/host dialog with the aid of the telnetlib
> debug option, it appeared that perhaps the host was proposing 'suppress
> go ahead', but that acceptance of the option was not being returned by
> the client.  (The actual host message was '\377\373\003'.  I haven't yet
> found the interpretation of either 377 or 373.)

These values are octal, so \377 is the same as 0xFF (255 decimal),
which is the IAC (interpret as command) octet in telnet (which starts
all special sequences, such as options).

\373 is the same as 0xFB (251) which is WILL, and yes, option 3 is
suppress go ahead.

> To fix the script, I added a write call to the host with the message
> '\255\253\003', meaning 'do suppress go ahead', following the login

Hmm, except that's not what that means - if they were decimal values
you'd be ok, but they're octal - you should have to use '\377\375\003'
to send a DO SGA message.

However, that seems to tickle another problem - the telnetlib write()
method will automatically quote (double) any IAC character.  So it
doesn't appear that you can use tn.write() in your code to answer any
options.  You'd have to go through directly to tn.sock.send() (or use
the nicer get_socket() method to get the socket).

The fact that it seems to work may indicate that the underlying
problem is more subtle and it's just the fact that you're generating
data at that point in the process that is cleaning something up.

Of course, at some level it may not matter if it now does what you
want :-)

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list