Mapping pppd to a virtual terminal

I want to start a ppp session on particular named device. For this a
resource (like /dev/spp1) is created by using ResourceManager, which handles
the read and write on this device entry.

But the pppd cannot be started on this device. This is the response :

pppd /dev/spp1 10.2.1.21:

pppd: tcgetattr(/dev/spp1): Inappropriate I/O control operation
pppd: tcgetattr(/dev/spp1): Inappropriate I/O control operation

Is it not possible to start the pppd over a resource created by
ResourceManager?

I want to start the pppd on a virtual device entry whoose read and write is
managed by my process. If this cannot be done using ResourceManager, then
what are the other options? Please guide me how to do this.

Thanks in advance,
Jo

Joseph <jmails@gmail.com> wrote:

I want to start a ppp session on particular named device. For this a
resource (like /dev/spp1) is created by using ResourceManager, which handles
the read and write on this device entry.

But the pppd cannot be started on this device. This is the response :

pppd /dev/spp1 10.2.1.21:

pppd: tcgetattr(/dev/spp1): Inappropriate I/O control operation
pppd: tcgetattr(/dev/spp1): Inappropriate I/O control operation

Is it not possible to start the pppd over a resource created by
ResourceManager?

Yes it is – but it is a little tricky. pppd expects to be attached
to a terminal device, and to be able to issue a bunch of devctl()
operations that most terminal devices are expected to support.

You might find it easier to write a io-char driver than a simple
resource manager, since it already has code to handle the devctl()
operations that pppd expects – this can be downloaded as a free
DDK.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Thanks Gibbs.

Is it possible to use the pseudo terminals (/dev/pttyx) for this purpose?

i.e. If I start the pppd with /dev/ttyp5 and then handle the read and write
to /dev/pttyp5, will it work?

Is there any way I can verify the above?

Thanks a lot.
Jo


“David Gibbs” <dagibbs@qnx.com> wrote in message
news:eccm6v$su8$1@inn.qnx.com

Joseph <> jmails@gmail.com> > wrote:
I want to start a ppp session on particular named device. For this a
resource (like /dev/spp1) is created by using ResourceManager, which
handles
the read and write on this device entry.

But the pppd cannot be started on this device. This is the response :

pppd /dev/spp1 10.2.1.21:

pppd: tcgetattr(/dev/spp1): Inappropriate I/O control operation
pppd: tcgetattr(/dev/spp1): Inappropriate I/O control operation

Is it not possible to start the pppd over a resource created by
ResourceManager?

Yes it is – but it is a little tricky. pppd expects to be attached
to a terminal device, and to be able to issue a bunch of devctl()
operations that most terminal devices are expected to support.

You might find it easier to write a io-char driver than a simple
resource manager, since it already has code to handle the devctl()
operations that pppd expects – this can be downloaded as a free
DDK.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Joseph <jmails@gmail.com> wrote:

Thanks Gibbs.

Is it possible to use the pseudo terminals (/dev/pttyx) for this purpose?

i.e. If I start the pppd with /dev/ttyp5 and then handle the read and write
to /dev/pttyp5, will it work?

I’ve never tried it. The pty driver should give pppd the bits of stuff
it wants.

Is there any way I can verify the above?

Run two network stacks, each with a pppd connected to a pty, and
write a little program that “pipes” the data between the two ptys.

Then, see if the two stacks can talk to each other accross this
“network”. (There are command line options to the stacks, and
environment variables that can be set to specify which stack a
specific application will use.)

Of course, going through pppd like this will impose extra overhead
(as compared to writing a devc-* driver directly yourself.)

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com