summaryrefslogtreecommitdiff
path: root/accel-dp/if_dp.h
blob: 5c209a79ee5464ed6db153594a3737ac08bcec09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef __IF_DP_H
#define __IF_DP_H

#include <stdint.h>

enum {
	MSG_SOCKET,
	MSG_CONNECT,
	MSG_BIND,
	MSG_LISTEN,
	MSG_RECV,
	MSG_SEND,
	MSG_IOCTL,
	MSG_PPP_OPEN,
	MSG_SOCK_IOCTL,
	__MSG_MAX_ID
};

#define MSG_MAX_ID (__MSG_MAX_ID - 1)

struct msg_hdr {
	uint8_t id;
};

struct msg_socket {
	uint8_t id;
	int domain;
	int type;
	int proto;
};

struct msg_connect {
	uint8_t id;
	socklen_t addrlen;
	char addr[0];
};

struct msg_bind {
	uint8_t id;
	socklen_t addrlen;
	char addr[0];
};

struct msg_listen {
	uint8_t id;
	int backlog;
};

struct msg_recv {
	uint8_t id;
	size_t len;
	int flags;
	socklen_t addrlen;
};

struct msg_send {
	uint8_t id;
	size_t len;
	int flags;
	socklen_t addrlen;
};

struct msg_ioctl {
	uint8_t id;
	unsigned long request;
	char arg[0];
};

struct msg_result {
	int err;
	ssize_t len;
	socklen_t addrlen;
	struct sockaddr_storage ss;
};

#endif