All of lore.kernel.org
 help / color / mirror / Atom feed
* pty
@ 2009-10-28 19:08 tony.chamberlain
  2009-10-28 19:43 ` pty Charlie Brady
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tony.chamberlain @ 2009-10-28 19:08 UTC (permalink / raw)
  To: linux-ppp

This is somewhat different from my other question and is on a different
system and of course the person who developed it left.

There is a mobile phone which connects to a CDMA BTS and then from there
to a Linux machine.  A process called pdsn is running on the linux machine
and detects when the mobile phone calls.  It then spawns a process with
a bunch of parameters (port, ip, etc) like this

   pppd pty 'ppp_relay -p port -a address ...'

So pppd uses ppp_relay (which is also something he wrote) to handle the
ppp stuff.

Now this worked on Red Hat 9 but there seems to be a problem on CentOS 4.5.
From what I can tell, ppp_relay receives a TCP port number (I guess from 
pdsn?) and tries to communicate to the pppd process through this port.
It sends a message but never gets a response.

I am curious how the pppd pty process (in this case ppp_relay) communicates
to pppd?  We did a netstat and found pppd but no TCP nor UDP ports were
associated with it.  It was just a UNIX-type process.

Is ppp_relay attempting to talk through a port when it should be using
some kind of Linux message?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pty
  2009-10-28 19:08 pty tony.chamberlain
@ 2009-10-28 19:43 ` Charlie Brady
  2009-10-28 20:20 ` pty James Carlson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Charlie Brady @ 2009-10-28 19:43 UTC (permalink / raw)
  To: linux-ppp


On Wed, 28 Oct 2009, tony.chamberlain@lemko.com wrote:

> Is ppp_relay attempting to talk through a port when it should be using
> some kind of Linux message?

Post the source code to ppp_relay and somebody might be able to tell you. 
Otherwise it's a bit like you asking us what colour clothing you are 
wearing. How could we know?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pty
  2009-10-28 19:08 pty tony.chamberlain
  2009-10-28 19:43 ` pty Charlie Brady
@ 2009-10-28 20:20 ` James Carlson
  2009-10-28 20:23 ` pty Bill Unruh
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: James Carlson @ 2009-10-28 20:20 UTC (permalink / raw)
  To: linux-ppp

tony.chamberlain@lemko.com wrote:
> I am curious how the pppd pty process (in this case ppp_relay) communicates
> to pppd?  We did a netstat and found pppd but no TCP nor UDP ports were
> associated with it.  It was just a UNIX-type process.

The ppp_relay process will have stdin and stdout connected to the master
side of a pty pair.  Pppd then configures PPP to run on the slave side.
 Pppd is completely unaware of what that child process is doing; it
won't have any network ports open.

The process run by the pppd "pty" option should read and write
AHDLC-encoded PPP packets on standard input and output.  Where and how
it gets those packets are a problem for the person writing ppp_relay.

Or, as the fine man page says:

       pty script
        Specifies  that  the command script is to be used to communicate
        rather than a specific  terminal  device.   Pppd  will  allocate
        itself  a  pseudo-tty master/slave pair and use the slave as its
        terminal device.  The script will be run in a child process with
        the  pseudo-tty  master  as  its  standard input and output.  An
        explicit device name may not be given if this  option  is  used.
        (Note:  if  the record option is used in conjuction with the pty
        option, the child process will have pipes on its standard  input
        and output.)

-- 
James Carlson         42.703N 71.076W         <carlsonj@workingcode.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pty
  2009-10-28 19:08 pty tony.chamberlain
  2009-10-28 19:43 ` pty Charlie Brady
  2009-10-28 20:20 ` pty James Carlson
@ 2009-10-28 20:23 ` Bill Unruh
  2009-10-28 22:48 ` pty tony.chamberlain
  2009-10-28 23:38 ` pty James Carlson
  4 siblings, 0 replies; 6+ messages in thread
From: Bill Unruh @ 2009-10-28 20:23 UTC (permalink / raw)
  To: linux-ppp

I presume that you have the program ppp_relay which you say he wrote. You will
have to look into that to see what it does.

man pppd

  pty script
               Specifies that the command script is to be used to commu-
               nicate rather than a specific terminal device.  Pppd will
               allocate  itself  a  pseudo-tty master/slave pair and use
               the slave as its terminal device.  The script will be run
               in  a  child  process  with  the pseudo-tty master as its
               standard input and output.  An explicit device  name  may
               not  be  given  if  this  option  is used.  (Note: if the
               record option is used in conjuction with the pty  option,
               the  child  process will have pipes on its standard input
               and output.)

pppd connects it stdout to that program's stdin, and stdin to that program's
stdout. Ie, that program is responsible for all communications with the phone.

You will have to look at it to see why no responses are generated. ( you could
also look at the debug output of pppd to see what pppd is seeing-- you can up
the log level to get more detailed info.
pppd uses the daemon log facility of syslog for its error messages. 
iYou need something like
daemon.*       /var/log/daemonlog
in /etc/syslog.conf
to get the stuff output to the file /var/log/daemonlog.

See the entry for "debug" in man pppd

On Wed, 28 Oct 2009, tony.chamberlain@lemko.com wrote:

> This is somewhat different from my other question and is on a different
> system and of course the person who developed it left.
>
> There is a mobile phone which connects to a CDMA BTS and then from there
> to a Linux machine.  A process called pdsn is running on the linux machine
> and detects when the mobile phone calls.  It then spawns a process with
> a bunch of parameters (port, ip, etc) like this
>
>   pppd pty 'ppp_relay -p port -a address ...'
>
> So pppd uses ppp_relay (which is also something he wrote) to handle the
> ppp stuff.
>
> Now this worked on Red Hat 9 but there seems to be a problem on CentOS 4.5.
>> From what I can tell, ppp_relay receives a TCP port number (I guess from
> pdsn?) and tries to communicate to the pppd process through this port.
> It sends a message but never gets a response.
>
> I am curious how the pppd pty process (in this case ppp_relay) communicates
> to pppd?  We did a netstat and found pppd but no TCP nor UDP ports were
> associated with it.  It was just a UNIX-type process.
>
> Is ppp_relay attempting to talk through a port when it should be using
> some kind of Linux message?
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-- 
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@physics.ubc.ca
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re:  pty
  2009-10-28 19:08 pty tony.chamberlain
                   ` (2 preceding siblings ...)
  2009-10-28 20:23 ` pty Bill Unruh
@ 2009-10-28 22:48 ` tony.chamberlain
  2009-10-28 23:38 ` pty James Carlson
  4 siblings, 0 replies; 6+ messages in thread
From: tony.chamberlain @ 2009-10-28 22:48 UTC (permalink / raw)
  To: linux-ppp

It did show connect ---> /dev/pts/3 or so, but then timed out.

I really wanted just to make sure I understood correctly too that pppd
communicates to ppp_relay via stdin and stdout.  And I understand 
pppd_relay talks to the phone and then sends whatever, via stdout, to pppd
and then ppp_relay also reads from pppd and converts and does whatever
and sends back to the phone:


                             
pppd   <----->   ppp_relay  <========> phone

??

-----Original Message-----
From: Bill Unruh [mailto:unruh@physics.ubc.ca]
Sent: Wednesday, October 28, 2009 03:23 PM
To: tony.chamberlain@lemko.com
Cc: 'ppp, Linux'
Subject: Re: pty

I presume that you have the program ppp_relay which you say he wrote. You will
have to look into that to see what it does.

man pppd

  pty script
               Specifies that the command script is to be used to commu-
               nicate rather than a specific terminal device.  Pppd will
               allocate  itself  a  pseudo-tty master/slave pair and use
               the slave as its terminal device.  The script will be run
               in  a  child  process  with  the pseudo-tty master as its
               standard input and output.  An explicit device  name  may
               not  be  given  if  this  option  is used.  (Note: if the
               record option is used in conjuction with the pty  option,
               the  child  process will have pipes on its standard input
               and output.)

pppd connects it stdout to that program's stdin, and stdin to that program's
stdout. Ie, that program is responsible for all communications with the phone.

You will have to look at it to see why no responses are generated. ( you could
also look at the debug output of pppd to see what pppd is seeing-- you can up
the log level to get more detailed info.
pppd uses the daemon log facility of syslog for its error messages. 
iYou need something like
daemon.*       /var/log/daemonlog
in /etc/syslog.conf
to get the stuff output to the file /var/log/daemonlog.

See the entry for "debug" in man pppd

On Wed, 28 Oct 2009, tony.chamberlain@lemko.com wrote:

> This is somewhat different from my other question and is on a different
> system and of course the person who developed it left.
>
> There is a mobile phone which connects to a CDMA BTS and then from there
> to a Linux machine.  A process called pdsn is running on the linux machine
> and detects when the mobile phone calls.  It then spawns a process with
> a bunch of parameters (port, ip, etc) like this
>
>   pppd pty 'ppp_relay -p port -a address ...'
>
> So pppd uses ppp_relay (which is also something he wrote) to handle the
> ppp stuff.
>
> Now this worked on Red Hat 9 but there seems to be a problem on CentOS 4.5.
>> From what I can tell, ppp_relay receives a TCP port number (I guess from
> pdsn?) and tries to communicate to the pppd process through this port.
> It sends a message but never gets a response.
>
> I am curious how the pppd pty process (in this case ppp_relay) communicates
> to pppd?  We did a netstat and found pppd but no TCP nor UDP ports were
> associated with it.  It was just a UNIX-type process.
>
> Is ppp_relay attempting to talk through a port when it should be using
> some kind of Linux message?
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-- 
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@physics.ubc.ca
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pty
  2009-10-28 19:08 pty tony.chamberlain
                   ` (3 preceding siblings ...)
  2009-10-28 22:48 ` pty tony.chamberlain
@ 2009-10-28 23:38 ` James Carlson
  4 siblings, 0 replies; 6+ messages in thread
From: James Carlson @ 2009-10-28 23:38 UTC (permalink / raw)
  To: linux-ppp

On Oct 28, 2009, at 6:48 PM, tony.chamberlain@lemko.com wrote:

> It did show connect ---> /dev/pts/3 or so, but then timed out.
>
> I really wanted just to make sure I understood correctly too that pppd
> communicates to ppp_relay via stdin and stdout.  And I understand
> pppd_relay talks to the phone and then sends whatever, via stdout,  
> to pppd
> and then ppp_relay also reads from pppd and converts and does whatever
> and sends back to the phone:
>
>
>
> pppd   <----->   ppp_relay  <========> phone
>
> ??

Yep; that's it exactly.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-28 23:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28 19:08 pty tony.chamberlain
2009-10-28 19:43 ` pty Charlie Brady
2009-10-28 20:20 ` pty James Carlson
2009-10-28 20:23 ` pty Bill Unruh
2009-10-28 22:48 ` pty tony.chamberlain
2009-10-28 23:38 ` pty James Carlson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.