Go to the FreeLists Home Page Home Signup Help Login
 



[openbeosnetteam] || [Date Prev] [09-2003 Date Index] [Date Next] || [Thread Prev] [09-2003 Thread Index] [Thread Next]

[openbeosnetteam] Re: moving ppp to other location

  • From: "Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx>
  • To: <openbeosnetteam@xxxxxxxxxxxxx>
  • Date: Sat, 6 Sep 2003 16:37:53 +0200
> "Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx> wrote:
> > as libkernelppp.a can now be built (woohooo! :)), I would like to
> > move it to
> > some other location.
> > My suggestion is to move the:
> > 1) source files to:
> > src/libs/kernelppp
>
> Nope, I wouldn't put it there. First of all, we don't have kernel
> shared libs, second of all, we don't have a default location of where
> to put them, and finally, this is net stuff, and obviously a driver/
> module, so I would put it into:

It is not a driver, but only a library that will be used by the
driver&manager.

> /src/add-ons/kernel/network/ppp

This makes people think it is a kernel-loadable module, but it is not.

> Or even a subdirectory there.
> But since you only build a static library, I don't know from what it is
> going to be used? And how is your system integrated with the rest?
> As I understand it, the network core stack will handle all PPP
> communication with the userland by opening your ppp module, but is
> anything else going to use it?
> But I think that Philippe should have the final word there, anyway.

There is no special PPP userland communication. PPP is a kernel module
(unlike in Linux/BSD).
The core stack loads the PPP manager (as it does with ethernet and
loopback). The PPP manager exports an extended network interface structure
(with additional special PPP features) for access by other modules/drivers.
The pppcontrol driver allows to talk to the manager from userland.
All (registered) PPP interfaces are added to the core. The PPP IP control
protocol talks to the core stack's IP module. When you open a socket and
send data, the PPP manager's output() function is be called (the same as
with ethernet) and the manager lookups the PPPProtocol with the correct
address family and calls that protocol's Send() method. This protocol can
now modify the packet if needed and pass it to its PPPInterface.
PPPInterface then asks the PPPDevice to really send the packet and in case
of the PPPoE device this packet will be passed to the target ethernet
interface...
The manager links against libkernelppp.a because all classes (PPPInterface,
etc.) are defined there. All PPP modules must link against this library, too
(as they derive from those classes).

> > 2) kernel space header files to:
> > headers/private/net/kernelppp
> >
> > This makes it more integrated into the system.
> >
> > alternative:
> > headers/libs/kernelppp
>
> Why not just headers/private/net/ppp?

Because the API is only available for kernel modules. Later there will be a
userland API that talks to the pppcontrol driver to query all interfaces.

> > This might be easier to find for most people.
> >
> > 3) userland header files to:
> > headers/os/net/ppp
> >
> > alternative:
> > headers/os/drivers/ppp
> >
> > From userland you actually talk to a _driver_ using ioctl. On the
> > other side
> > you want to access a _network_interface_. I am not really sure which
> > is
> > better.
>
> headers/os/drivers is only *for* drivers in the kernel, usually not
> userland stuff, that would probably go into os/kernel for the general
> case.
> In this case, however, I would just put all PPP related user headers in
> headers/os/net/ppp, or even just one net/PPP.h file, dunno how much you
> want to put in there.

There are at least three headers at the moment. Milestone #2 will contain a
userland C++ API, so os/net/ppp is probably the best place to put it into.

Waldemar






[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.