haiku/headers/private/net/userland_ipc.h
Philippe Houdoin a60e1f4f7f Moved from headers/posix to private/net, as they're not POSIX headers.
Expand the max numbers of area for IPC, as net_stack_control_module can
target to more than 5 structs by adresses...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-04-25 22:53:41 +00:00

66 lines
1.1 KiB
C

#ifndef USERLAND_IPC_H
#define USERLAND_IPC_H
/* userland_ipc - Communication between the network driver
** and the userland stack.
**
** Initial version by Axel Dörfler, axeld@pinc-software.de
** This file may be used under the terms of the OpenBeOS License.
*/
#include <OS.h>
#include <Drivers.h>
#include "net_stack_driver.h"
#ifdef __cplusplus
extern "C" {
#endif
#define NET_STACK_PORTNAME "net_server connection"
enum {
NET_STACK_OPEN = NET_STACK_IOCTL_MAX,
NET_STACK_CLOSE,
NET_STACK_NEW_CONNECTION,
};
#define MAX_NET_AREAS 16
typedef struct {
area_id id;
uint8 *offset;
} net_area_info;
typedef struct {
int32 op;
// int32 buffer;
uint8 *data;
int32 length;
int32 result;
net_area_info area[MAX_NET_AREAS];
} net_command;
#define CONNECTION_QUEUE_LENGTH 128
#define CONNECTION_COMMAND_SIZE 2048
typedef struct {
port_id port;
area_id area;
thread_id socket_thread;
sem_id commandSemaphore; // command queue
uint32 numCommands,bufferSize;
} net_connection;
extern status_t init_userland_ipc(void);
extern void shutdown_userland_ipc(void);
#ifdef __cplusplus
} // end of extern "C"
#endif
#endif /* USERLAND_IPC_H */