Re: [Queue-developers] Cross-platform termios handling...
Brought to you by:
wkrebs
|
From: Mike C. <da...@ix...> - 2000-08-21 18:00:47
|
On Sun, Aug 20, 2000 at 01:15:23PM -0400, W. G. Krebs wrote:
> One of the early drafts of the internet protocol actually included the telnet
> WILL/WONT mechanism for negotiating various things.
In general, the telnet protocol, especially the negotiation, is show as an
example of how NOT to do things. You really do not want to follow that
example.
Shoot... just thought of stuff for rlogin, and already delete the
references but...
One thing to remember with the r commands is that you either run a command
non-interactively, or you run an interactive shell that probably gets
initialized with something equivalent to "stty sane", regardless of what
the originating terminal was set for. You can't remotely run a command
that requires a terminal.
Now, on the otherhand, there is ssh. How does ssh solve this? Or OpenSSH?
Or (what's the gnu one? lsh?)? They may be better canidates for examples.
> For simplicity, however, we could write a translator function that translates
> Linux termios to the simplified rlogin structure (portable) and then use code
> from rlogin to translate the simplified structure to machine termios on
> non-Linux systems. This might save us some porting effort.
Use XDR. It will save a lot of headaches in the long run. Of course, you
can't just pass the binary values of the structures across. Where one
system will have:
#define FOO 0
#define BAR 1
the other one will have:
#define FOO 1
#define BAR 2
So you still have to come up with things like:
enum {
QUEUE_FOO,
QUEUE_BAR
}
And do mappings from each local system to a neutral format, pass that
across, and convert back. But for the passing of the neutral format, you
probably should look at XDR.
mrc
--
Mike Castle Life is like a clock: You can work constantly
da...@ix... and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day. -- mrc
We are all of us living in the shadow of Manhattan. -- Watchmen
|