Added support for attaching ancillary data to a net_buffer. It's a naive

implementation ATM, since it malloc()s the required memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24940 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-04-12 09:19:44 +00:00
parent 5f2d64a25e
commit 62d7da1f45
2 changed files with 207 additions and 2 deletions
+17
View File
@@ -37,6 +37,12 @@ typedef struct net_buffer {
uint8 protocol;
} net_buffer;
typedef struct ancillary_data_header {
int level;
int type;
size_t len;
} ancillary_data_header;
struct net_buffer_module_info {
module_info info;
@@ -68,6 +74,17 @@ struct net_buffer_module_info {
status_t (*associate_data)(net_buffer *buffer, void *data);
status_t (*attach_ancillary_data)(net_buffer *buffer,
const ancillary_data_header *header, const void *data,
void (*destructor)(const ancillary_data_header*, void*),
void **_allocatedData);
status_t (*detach_ancillary_data)(net_buffer *buffer, void *data,
bool destroy);
void * (*transfer_ancillary_data)(net_buffer *from,
net_buffer *to);
void * (*next_ancillary_data)(net_buffer *buffer,
void *previousData, ancillary_data_header *_header);
status_t (*direct_access)(net_buffer *buffer, uint32 offset,
size_t bytes, void **_data);
status_t (*read)(net_buffer *buffer, uint32 offset, void *data,