All of lore.kernel.org
 help / color / mirror / Atom feed
* Using pppd as a library
@ 2012-08-14 11:56 neha chatrath
  2012-08-14 14:01 ` Charlie Brady
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: neha chatrath @ 2012-08-14 11:56 UTC (permalink / raw)
  To: linux-ppp

Hello,

I have system requirement in which I need to invoke pppd from a user 
application. This user application needs to do configuration, get status 
etc of the PPP links.
Well there are various ways of doing it, I am exploring the option of 
including pppd as a library in my build. With this,
-I can spawn my application as a thread.
-I can avoid  use of fork and exec operations for executing pppd for 
different links.

Can somebody help me with this. Is there any pppd library already available?

Thanks and regards
Neha Chatrath
Disclaimer : 
This email communication may contain privileged and confidential information and is intended for the
use of the addressee only.If you are not an intended recipient you are requested not to reproduce,copy
disseminate or in any manner distribute this email communication as the same is strictly prohibited. If
you have received this email in error, Please notify the sender immediately by return e-mail and delete
the communication sent in error.Email communications cannot be guaranteed to be secure & error free
and INDIABULLS is not liable for any errors in the email communication or for the proper, timely and
complete transmission thereof.


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

* Re: Using pppd as a library
  2012-08-14 11:56 Using pppd as a library neha chatrath
@ 2012-08-14 14:01 ` Charlie Brady
  2012-08-14 14:29 ` Bill Unruh
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Charlie Brady @ 2012-08-14 14:01 UTC (permalink / raw)
  To: linux-ppp


On Tue, 14 Aug 2012, neha chatrath wrote:

> Hello,
> 
> I have system requirement in which I need to invoke pppd from a user
> application. This user application needs to do configuration, get status etc
> of the PPP links.
> Well there are various ways of doing it, I am exploring the option of
> including pppd as a library in my build. With this,
> -I can spawn my application as a thread.
> -I can avoid  use of fork and exec operations for executing pppd for different
> links.

Why do you want to avoid such useful constructs? I suggest you google for 
"make a rod for your own back".

> Can somebody help me with this. Is there any pppd library already available?
> 
> Thanks and regards
> Neha Chatrath

Really, the following is true?

> Disclaimer : This email communication may contain privileged and 
> confidential information and is intended for the use of the addressee 
> only.

Total bullcrap...

> If you are not an intended recipient you are
> requested not to reproduce,copy
> disseminate or in any manner distribute this email communication as the same
> is strictly prohibited. If
> you have received this email in error, Please notify the sender immediately by
> return e-mail and delete
> the communication sent in error.Email communications cannot be guaranteed to
> be secure & error free
> and INDIABULLS is not liable for any errors in the email communication or for
> the proper, timely and
> complete transmission thereof.
> 
> --
> 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] 7+ messages in thread

* Re: Using pppd as a library
  2012-08-14 11:56 Using pppd as a library neha chatrath
  2012-08-14 14:01 ` Charlie Brady
@ 2012-08-14 14:29 ` Bill Unruh
  2012-08-14 14:57 ` James Carlson
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Bill Unruh @ 2012-08-14 14:29 UTC (permalink / raw)
  To: linux-ppp

On Tue, 14 Aug 2012, Charlie Brady wrote:


It is legal crap some companies require, not realising that using it like this
makes it worthless as a legal bulwark. Anyone they try to prosecute need only
point out that this disclaimer is used on material for which the disclaimer is
clearly nonsense, and thus that the company does not take it seriously itself,
so why should the court.

>
> Really, the following is true?
>
>> Disclaimer : This email communication may contain privileged and
>> confidential information and is intended for the use of the addressee
>> only.
>
> Total bullcrap...
>
>> If you are not an intended recipient you are
>> requested not to reproduce,copy
>> disseminate or in any manner distribute this email communication as the same
>> is strictly prohibited. If
>> you have received this email in error, Please notify the sender immediately by
>> return e-mail and delete
>> the communication sent in error.Email communications cannot be guaranteed to
>> be secure & error free
>> and INDIABULLS is not liable for any errors in the email communication or for
>> the proper, timely and
>> complete transmission thereof.

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

* Re: Using pppd as a library
  2012-08-14 11:56 Using pppd as a library neha chatrath
  2012-08-14 14:01 ` Charlie Brady
  2012-08-14 14:29 ` Bill Unruh
@ 2012-08-14 14:57 ` James Carlson
  2012-08-15  6:20 ` Marcel Holtmann
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: James Carlson @ 2012-08-14 14:57 UTC (permalink / raw)
  To: linux-ppp

On 08/14/12 07:44, neha chatrath wrote:
> I have system requirement in which I need to invoke pppd from a user
> application. This user application needs to do configuration, get status
> etc of the PPP links.
> Well there are various ways of doing it, I am exploring the option of
> including pppd as a library in my build. With this,
> -I can spawn my application as a thread.
> -I can avoid  use of fork and exec operations for executing pppd for
> different links.

You'll need to somehow deal with the event loop that handles both timers
and control path I/O.  And you may also have to deal with blocking
operations, such as name service look-ups that occur during
configuration parsing, that the rest of your application may not be
expecting in a library.

It sounds like a non-trivial thing to get right, at least to me.  (Of
course, it's probably possible to do it wrong with less effort.  ;-})

Note also that the current code assumes that it's running in a single
process per PPP link.  It's littered with statics and other things that
would need to be cleaned up if you were to make it useful for multiple
links in a single process.

I wouldn't do it this way.  Instead, I would use some IPC mechanism to
get at the data necessary.  Then it's just a matter of figuring out how
to get the IPC into the existing event loop (or go multi-threaded if you
dare).  Suitable IPCs (UDP sockets, named pipes, Solaris Doors) will
vary depending on OS, and suitable protocols to use over the IPC will
also vary depending on the application.  In some cases, it may make
sense to build an SNMP agent into the pppd code.

If fork+exec is expensive in your neighborhood (it certainly shouldn't
be, but I don't live where you do), then I think you have a long row to hoe.

> Can somebody help me with this. Is there any pppd library already
> available?

To my knowledge, it's never been done.  When I was with a start-up many
years ago, I did modify the code so that it could handle multiple links
at once, because we scaled to many thousands of links, but I still did
the control and monitoring through an IPC.  (No, I don't have that code
... it went with the start-up.  :-<)

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

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

* Re: Using pppd as a library
  2012-08-14 11:56 Using pppd as a library neha chatrath
                   ` (2 preceding siblings ...)
  2012-08-14 14:57 ` James Carlson
@ 2012-08-15  6:20 ` Marcel Holtmann
  2012-08-15  7:14 ` walter harms
  2012-08-15 13:07 ` James Carlson
  5 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2012-08-15  6:20 UTC (permalink / raw)
  To: linux-ppp

Hi James,

> > Can somebody help me with this. Is there any pppd library already
> > available?
> 
> To my knowledge, it's never been done.  When I was with a start-up many
> years ago, I did modify the code so that it could handle multiple links
> at once, because we scaled to many thousands of links, but I still did
> the control and monitoring through an IPC.  (No, I don't have that code
> ... it went with the start-up.  :-<)

we have written PPP from scratch for the oFono project for exactly the
same reason. We needed something in form of a library and not a daemon.

http://git.kernel.org/?p=network/ofono/ofono.git

Look under gatchat directory.

Especially when it comes to intermixing of 3GPP 27.007 and 27.010 with
PPP for online mode, the current pppd causes too much overhead. It is
not only that you have to spawn the pppd process and its extra plugin
for handling feedback. You also need to have a TTY or PTY to use it. And
that was causing overhead that was not acceptable to us.

Regards

Marcel



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

* Re: Using pppd as a library
  2012-08-14 11:56 Using pppd as a library neha chatrath
                   ` (3 preceding siblings ...)
  2012-08-15  6:20 ` Marcel Holtmann
@ 2012-08-15  7:14 ` walter harms
  2012-08-15 13:07 ` James Carlson
  5 siblings, 0 replies; 7+ messages in thread
From: walter harms @ 2012-08-15  7:14 UTC (permalink / raw)
  To: linux-ppp



Am 15.08.2012 08:20, schrieb Marcel Holtmann:
> Hi James,
> 
>>> Can somebody help me with this. Is there any pppd library already
>>> available?
>>
>> To my knowledge, it's never been done.  When I was with a start-up many
>> years ago, I did modify the code so that it could handle multiple links
>> at once, because we scaled to many thousands of links, but I still did
>> the control and monitoring through an IPC.  (No, I don't have that code
>> ... it went with the start-up.  :-<)
> 
> we have written PPP from scratch for the oFono project for exactly the
> same reason. We needed something in form of a library and not a daemon.
> 
> http://git.kernel.org/?p=network/ofono/ofono.git
> 
> Look under gatchat directory.
> 
> Especially when it comes to intermixing of 3GPP 27.007 and 27.010 with
> PPP for online mode, the current pppd causes too much overhead. It is
> not only that you have to spawn the pppd process and its extra plugin
> for handling feedback. You also need to have a TTY or PTY to use it. And
> that was causing overhead that was not acceptable to us.
> 

hi,

The question is do they need ppp at all ? I certainly has advantages to use
tcp/ip but it is no requirement is several cases. Going with a more simple
protocol can reduce the overhead considerable.

re,
 wh

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

* Re: Using pppd as a library
  2012-08-14 11:56 Using pppd as a library neha chatrath
                   ` (4 preceding siblings ...)
  2012-08-15  7:14 ` walter harms
@ 2012-08-15 13:07 ` James Carlson
  5 siblings, 0 replies; 7+ messages in thread
From: James Carlson @ 2012-08-15 13:07 UTC (permalink / raw)
  To: linux-ppp

walter harms wrote:
> The question is do they need ppp at all ? I certainly has advantages to use
> tcp/ip but it is no requirement is several cases. Going with a more simple
> protocol can reduce the overhead considerable.

Please explain.  What "more simple protocol" are you suggesting?  SLIP,
perhaps?

I expect that the original poster's design constraints include having an
interoperable implementation -- that is, being able to talk to peer
machines built by other vendors.  Whether the overhead is "considerable"
or not doesn't seem to factor into the choice.

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

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

end of thread, other threads:[~2012-08-15 13:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-14 11:56 Using pppd as a library neha chatrath
2012-08-14 14:01 ` Charlie Brady
2012-08-14 14:29 ` Bill Unruh
2012-08-14 14:57 ` James Carlson
2012-08-15  6:20 ` Marcel Holtmann
2012-08-15  7:14 ` walter harms
2012-08-15 13:07 ` 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.