[openbeos] Re: Some network land questions:

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 02 Aug 2007 14:33:13 +0200

"Oliver Ruiz Dorantes" <urnenfel@xxxxxxxxxx> wrote:
> I have noticed that in the structure net_buffer, the following field:
> 
> typedef struct net_buffer {
>     struct list_link link;
>     [...]
> }
> 
> Is this field being used now for something? where?
> Whats its intention?

It's used to be able to have a list of net_buffers without needing to 
allocate any memory. Its use is protocol dependent - the buffers you 
get through the stack don't use it.

> Could I safe&freely from a driver... (totally disconnected from the 
> TCP/IP
> stack) use this field to keep an own queue of net_buffers?

Exactly, that's its purpose :-)

> Seems the "struct list_link" is defined in the header <util/list.h> 
> but... I
> cant find it webrowsing the SVN...

headers/private/kernel/util/ - it's currently a bit messy as it's 
private kernel stuff, but the networking headers aren't public either, 
right now.
We definitely need to do some cleanup before being able to make them 
public.

> Do we have more queues/lists etc etc facilites in Kernel land?

Yes, just have a look at the above mentioned directory. It's just that 
most of these are not public; you may freely use the templatized list 
code without having to worry, though.

> And now something harder... could the net_buffer kernel module be 
> used
> separately in R5?
> or without replacing the whole network Stack?

Sure, the net_buffer module has no dependencies in the rest of the 
stack. However, it currently uses the slab allocator directly, so you 
would either have to revert to an older version of it (that just used 
malloc(), but was therefore slower), or compile the slab stuff into the 
module.

Bye,
   Axel.


Other related posts: