oob in rlogin

Mon, 24 Oct 88 11:42:53 EDT

>>from grn@stl.stc.co.uk:
>>Is there a public domain specification of the Berkeley networking
>>utilities such as rlogin?

> Keith Bostic:
>Unfortunately, no; the source code itself, however, while not public
>domain, is freely redistributable. This includes inetd, ping, rcp,
>rdist, rexecd, rlogin, rmt, route, rsh, rwho, rwhod, and talk among
>other things.

        To quote my friend Schultzy:
                "The source code is the ultimate documentation..."

        This isn't exactly the clearest source code, so I will make a humble
        attempt to explain what goes on (also benefiting those without it):

>>The type of question that I would expect to be able to answer given a
>>specification is the use made out-of-band data in rlogin for example.

        OOB data is used to pass four flags to the client:

                #define TIOCPKT_FLUSHWRITE 0x02
                #define TIOCPKT_NOSTOP 0x10
                #define TIOCPKT_DOSTOP 0x20
                #define TIOCPKT_WINDOW 0x80

        Any others are ignored. TIOCPKT_FLUSHWRITE does just that, the
        client flushes the terminal queues, and any data up to the OOB mark.
        TIOCPKT_WINDOW causes the client to signal its parent process of
        a window size change. TIOCPKT_NOSTOP turns disables CBREAK, enables
        RAW, sets t_stopc and t_startc to -1. TIOCPKT_DOSTOP reverses the
        effects of TIOCPKT_NOSTOP. This assumes a knowledge of the Berkeley
        terminal driver. The oob data is written and read as type char.

> I've been working on-and-off for a year or so trying to get my own
>version of rlogin working under SunOS-3.2 and lately 3.5.2. The stumbling
>block has been the out-of-band data part.
> (text deleted)
> Perhaps I've made my job harder than it has to be by trying to get
>my rlogin to run as a suntools application. I use the notifier to tell me
>when oob data is available, but I don't think it works properly.
>Sometimes, my oob routine gets called by the notifier (which supposedly
>means there is oob data waiting to be read) but when I try to read it,
>nothing is there (i.e. select says there is nothing pending, recv returns
>0, ioctl says I'm not at the mark, etc).

        I would have to see the source code to make a determination about
        this, but it sounds like the evaluation is correct. For the
        benefit of others: make sure that you read in the data up to the
        mark and store it for later, or throw it away. It is possible
        that the oob data has not been sent because the process is blocked
        on output and the input buffer is full.

>>A second and related question is why does the SunOS 4.0 implementation
>>of rlogin and rsh reject connections with client port numbers in the
>>range 0-512? My desire for specification of the interoperability
>>requirements of these networking utilities was partly prompted by the
>>failure of our local rlogin implementation to interwork with the new
>>Sun implementation.

        Low numbers are reserved for servers. A client process
        shouldn't be down in this range. Rlogind and rshd reject
        numbers below IPPORT_RESERVED/2 (512) just for good measure.
        Also they expect numbers between IPPORT_RESERVED/2 and
        IPPORT_RESERVED to guarantee the authenticity of the client.

Joel A. Mussman
jam@radc-lonex.arpa, jam@etn-wlv.eaton.com

This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:43:56 GMT