Moved the container management for ancillary data from the net_buffer

module to the stack module. There's a dedicated struct
ancillary_data_container, now. One can just set the container on a
net_buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25292 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-05-02 14:37:16 +00:00
parent 110d4031fb
commit 49e00d1f99
10 changed files with 332 additions and 185 deletions
+23
View File
@@ -24,6 +24,8 @@ struct net_domain;
struct net_socket;
struct net_timer;
typedef struct ancillary_data_container ancillary_data_container;
struct net_fifo {
benaphore lock;
sem_id notify;
@@ -64,6 +66,12 @@ struct net_device_monitor {
void (*event)(struct net_device_monitor *monitor, int32 event);
};
typedef struct ancillary_data_header {
int level;
int type;
size_t len;
} ancillary_data_header;
struct net_stack_module_info {
module_info info;
@@ -139,6 +147,21 @@ struct net_stack_module_info {
bool (*is_restarted_syscall)(void);
void (*store_syscall_restart_timeout)(bigtime_t timeout);
bigtime_t (*restore_syscall_restart_timeout)(void);
// ancillary data
ancillary_data_container* (*create_ancillary_data_container)();
void (*delete_ancillary_data_container)(
ancillary_data_container* container);
status_t (*add_ancillary_data)(ancillary_data_container *container,
const ancillary_data_header *header, const void *data,
void (*destructor)(const ancillary_data_header*, void*),
void **_allocatedData);
status_t (*remove_ancillary_data)(ancillary_data_container *container,
void *data, bool destroy);
void* (*move_ancillary_data)(ancillary_data_container *from,
ancillary_data_container *to);
void* (*next_ancillary_data)(ancillary_data_container *container,
void *previousData, ancillary_data_header *_header);
};
#endif // NET_STACK_H