Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

Network Buffer

Network buffer support. More...

Data Structures

struct  _NBDATA
 Data part of a network buffer structure. More...

struct  _NBDATA
 Data part of a network buffer structure. More...

struct  _NETBUF
 Network buffer structure. More...

struct  _NETBUF
 Network buffer structure. More...


Defines

#define NBAF_DATALINK
 Datalink buffer allocated flag.

#define NBAF_NETWORK
 Network buffer allocated flag.

#define NBAF_TRANSPORT
 Transport buffer allocated flag.

#define NBAF_APPLICATION
 Application buffer allocated flag.

#define NBAF_ALL
 Masks allocated buffer flags flag.


Typedefs

typedef struct _NETBUF NETBUF
 Network buffer type.

typedef struct _NBDATA NBDATA
 Network buffer data type.


Functions

NETBUFNutNetBufAlloc (NETBUF *nb, u_char type, u_short size)
 Allocate or re-allocate a network buffer part. More...

NETBUFNutNetBufClone (NETBUF *nb)
 Create a copy of an existing network buffer structure. More...

int NutNetBufFree (NETBUF *nb)
 Release a network buffer structure. More...


Detailed Description

Network buffer support.

The network buffer handling is designed to make life easy when it comes to handling ISO-layered communications. By this we're thinking about communications structures that are hierarchically organized.

The idea is that network buffer structures are allocated every time a new packet is either received or ready for sending. The various fields of the network buffer are then handled by matching layers within the appropriate protocol stack.

Version:
2.0.4
Author:
Harald Kipp, egnite Software GmbH

Function Documentation

NETBUF * NutNetBufAlloc ( NETBUF * nb,
u_char type,
u_short size )
 

Allocate or re-allocate a network buffer part.

Parameters:
nb   Points to an existing network buffer structure or NULL, if a new structure should be created.
type   Part of the buffer to be allocated.
size   Size of the part to be allocated.

Returns:
Pointer to the allocated network buffer structure.

NETBUF * NutNetBufClone ( NETBUF * nb )
 

Create a copy of an existing network buffer structure.

Parameters:
nb   Points to an existing network buffer structure, previously allocated by NutNetBufAlloc().

Returns:
Pointer to a newly allocated copy.

int NutNetBufFree ( NETBUF * nb )
 

Release a network buffer structure.

Returns all memory previously allocated by a network buffer to the available heap space.

Parameters:
nb   Points to an existing network buffer structure, previously allocated by NutNetBufAlloc().

Returns:
0 if successfull or -1 if the structure contains previously released memory space.


© 2000-2001 by egnite Software GmbH - visit http://www.ethernut.de/