[openbeosnetteam] Re: Quick question about the stack
- From: "Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx>
- To: <openbeosnetteam@xxxxxxxxxxxxx>
- Date: Sat, 10 Jan 2004 14:11:48 +0100
Hi,
we have a special ioctl() that allows to call the control() function of an
interface module (pppconfig makes use of it).
There are two different module types that the core knows of:
- protocol
- interface
Ethernet is a normal interface module. When loaded it iterates over all drivers
in
/dev/net
and attaches an ifnet to each device.
The core has two threads for sending and receiving. It starts one pair for each
registered ifnet.
Driver interfaces (which open() a driver in /dev) can be handled by these
threads, too. The receiver calls read() and transforms that data into a packet
and puts this packet into the queue specified in the ifnet. The other one
write()s all outgoing packets in the ifnet's queue. These threads are used by
Ethernet.
The functions for creating such a thread are (core.c):
start_tx_thread(ifnet*)
start_rx_thread(ifnet*)
They distinguish between ethernet and other interfaces.
Loopback uses these functions, too, but start_rx_thread() will run a different
thread function that calls the input() function pointed to by the ifnet
structure.
PPP does not use any of those functions at all.
You can look into core.c to see the inner workings in detail.
Waldemar
----- Original Message -----
From: "Brennan Cleveland" <warriorspot@xxxxxxxxxxxxx>
To: <openbeosnetteam@xxxxxxxxxxxxx>
Sent: Friday, January 09, 2004 7:18 PM
Subject: [openbeosnetteam] Quick question about the stack
Hi,
Im looking over the stack diagram again, and I just want to clarify a
few points.
According to the diagram, the stack is very modular (which is good).
That said, lets use ping for an example. ping, as an app, only
"knows about" the libnet.so sockets API, and libnet.so interfaces
with the stack driver. The stack driver interfaces with core, and
core interfaces with the protocol modules. Are there any violations
anywhere in the code to this modularity? For example, any case where
code in ping.c makes a call directly to a routine in the net stack
driver, bypassing libnet.so?
Also, where does the ethernet driver fit in? It looks like the
ethernet module would interact with the driver, which then obviously
controls the hardware...
Thanks,
Brennan
- References:
- [openbeosnetteam] Quick question about the stack
- From: Brennan Cleveland
Other related posts:
- » [openbeosnetteam] Quick question about the stack
- » [openbeosnetteam] Re: Quick question about the stack
- » [openbeosnetteam] Re: Quick question about the stack
- [openbeosnetteam] Quick question about the stack
- From: Brennan Cleveland