Opening a socket connection on a serial port

J

John Ramsden

I have a perl script that needs to control connects and
disconnects of a dialup connection, and transfer data via
a TCP socket stream opened on it. This must work on Windows
and Unix.

After poking about on CPAN and elsewhere, I concluded that
for the basic modem control I need the Devel::SerialPort
module.

(Question in passing: Does Devel::SerialPort work on Windows
as well as Unix? The documentation says it was derived for
POSIX from Win32::SerialPort.)

But I'm not sure how to identify or map (?) this so that
my script can use it for a TCP socket connection.

Any advice, and/or pointers to code samples would be greatly
appreciated.

To put things in context, this requirement is for a security
hyperaware customer, who insists that the system on which my
monitoring package will runs must have no network link to the
outside world.

But as it may be linked to a local LAN, I can't assume the
modem will be the _only_ possibility for a socket connection
to use. Hence the need to somehow tie the socket open request
explicitly to the modem.

Thanks in advance.


Cheers

John Ramsden ([email protected])
 
D

David Efflandt

I have a perl script that needs to control connects and
disconnects of a dialup connection, and transfer data via
a TCP socket stream opened on it. This must work on Windows
and Unix.

(Question in passing: Does Devel::SerialPort work on Windows
as well as Unix? The documentation says it was derived for
POSIX from Win32::SerialPort.)

Device::SerialPort is a Unix port of Win32::SerialPort. So you use
Win32::SerialPort in Windows, and Device::SerialPort in Linux or Unix.

While that could chat with a modem, dialout to a shell, communicate
with a shell, it will NOT do TCP/IP.

TCP/IP would work easiest (transparently) if the user already had an
automatic PPP connection set up in Windows DUN, or demand pppd set up in
Unix.

Otherwise, if you are trying to initiate the PPP connection from your
script, I know how to do that in Linux or FreeBSD (assuming script running
as user that has permission to do that), but could not begin to guess how
to do that on various Win systems (which may also have permission issues).
 
J

John Ramsden

Device::SerialPort is a Unix port of Win32::SerialPort. So you use
Win32::SerialPort in Windows, and Device::SerialPort in Linux or Unix.

Ah, OK. Sounds reasonable.
While that could chat with a modem, dialout to a shell, communicate
with a shell, it will NOT do TCP/IP.

TCP/IP would work easiest (transparently) if the user already had an
automatic PPP connection set up in Windows DUN, or demand pppd set up in
Unix.

Otherwise, if you are trying to initiate the PPP connection from your
script, I know how to do that in Linux or FreeBSD

If this is fairly simple, and remotely perl-ish, would there be any
chance of posting a summary or a pointer?

Many thanks for your reply. I'm gradually getting an idea of roughly
what is required; so now it's just a matter of sussing out the details.


Cheers

John Ramsden ([email protected])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top