btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / net / userland_ipc.h
blob8fc7ae673fd9f87ccce4a2f77fff4728f9d0fb34
1 /*
2 * Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
3 * This file may be used under the terms of the MIT License.
4 */
5 #ifndef USERLAND_IPC_H
6 #define USERLAND_IPC_H
8 /*! userland_ipc - Communication between the network driver
9 and the userland stack.
12 #include <OS.h>
13 #include <Drivers.h>
15 #include "net_stack_driver.h"
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 #define NET_STACK_PORTNAME "net_server connection"
23 enum {
24 NET_STACK_OPEN = NET_STACK_IOCTL_MAX,
25 NET_STACK_CLOSE,
26 NET_STACK_NEW_CONNECTION,
29 #define MAX_NET_AREAS 16
31 typedef struct {
32 area_id id;
33 uint8 *offset;
34 } net_area_info;
36 typedef struct {
37 int32 op;
38 // int32 buffer;
39 uint8 *data;
40 int32 length;
41 int32 result;
42 net_area_info area[MAX_NET_AREAS];
43 } net_command;
45 #define CONNECTION_QUEUE_LENGTH 128
46 #define CONNECTION_COMMAND_SIZE 2048
48 typedef struct {
49 port_id port;
50 area_id area;
51 thread_id socket_thread;
53 sem_id commandSemaphore; // command queue
54 uint32 numCommands,bufferSize;
55 } net_connection;
58 extern status_t init_userland_ipc(void);
59 extern void shutdown_userland_ipc(void);
62 #ifdef __cplusplus
63 } // end of extern "C"
64 #endif
66 #endif /* USERLAND_IPC_H */