Passing std in/out file descriptors between processes
Steve Scott
sscott at fwhnm02.fwrdc.rtsg.mot.com
Fri Apr 5 03:36:46 AEST 1991
On my current work assignment, software development is split between
a U.S. site and an international site. There is an existing IP ethernet
connectivity between the two development sites. Here is what I would like
to do:
In the US site, I have a "box" which must be controlled via a 2400 baud
RS232 port. In the international site, I have an SysVR3.2-based Unix
box which wants to control this "box" via a 2400 baud serial port.
Trouble is, they are multiple thousands of miles apart. The obvious
solution is to use a couple of 2400 baud modems with MNP (for noise
pollution protection). The problem is that we do not know for sure
how often (or how long) these connections would have to be made. The long
distance charges could eat us up.
What I have been asked to evaluate is this:
Could we connect the "box" to a Unix computer sitting in the US lab via a
serial port and let the US Unix computer and the international Unix computer
communicate via the existing TCP/IP network?
This seems like a complicated matter to me (but I HOPE I am wrong ;-)
+------------+ +-----------+ +----------+
| Controlled |---------| US Unix | |Int. Unix |
| Box | | Computer| | Computer|
+------------+ +-----------+ +----------+
^ | |
| |--------------------------|
|
2400 baud ^
RS232 | Existing TCP/IP
connection network connection
So, is this possible:
Could the Int. Unix computer telnet to the US Unix computer, run cu
(or tip) to connect to the Controlled box AND once completed, have
that whole "chain of communications" inherited by the application
running on the Int. Unix computer (which is expecting to talk to
a local /dev/tty type of a connection)?
I presume that a dumb terminal emulation would have to be used during
the telnet session so that terminal control codes are eliminated (or
at least minimized ;-). My biggest problem is: How would I get one
application in the Int. Unix box (the one expecting to talk to the
serial port) to "attach" itself to the telnet session input/output?
To the application, I want the standard in/standard out file descriptors
associated with the telnet session to appear to be the input/output via a
serial port.
So, in general, how does one application take over the standard in/
standard out of another application? Is this possible? Can it be done
with "standard" Unix programs (tee, et al.) in a shell script? Or will
it require some sort of a (dup/close/execl) type of a C program? OR am
I all washed up and there is a better way?
Any hints, tips, pointers, etc. would be VERY MUCH appreciated.
Thanks,
--
+------------------------------------------------------------------------------+
| Steve Scott | Internet: sscott at mot.com |
| Fort Worth Research and Development Center | UUCP: csccat!camdev!sscott |
| Cellular Infrastructure Group | Internal: TX14/1D |
| Radio Telephone Systems Group | Voice: (817) 232-6317 |
| Motorola, Inc. | Fax: (817) 232-6081 |
| The opinions contained herein are STRICTLY my own |
+------------------------------------------------------------------------------+
More information about the Comp.unix.wizards
mailing list