aboutsummaryrefslogtreecommitdiffstats
path: root/src/ipc.h
blob: 91589edd4ce0834359b1932df330807f834775fb (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
 * ipc.h:
 *
 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
 * All rights reserved.
 *
 */

/*
 * $Id$
 */

/*
 * $Log$
 * Revision 1.5  2008/02/23 11:48:37  james
 * *** empty log message ***
 *
 * Revision 1.4  2008/02/22 17:07:00  james
 * *** empty log message ***
 *
 * Revision 1.3  2008/02/15 23:52:12  james
 * *** empty log message ***
 *
 * Revision 1.2  2008/02/15 03:32:07  james
 * *** empty log message ***
 *
 * Revision 1.1  2008/02/14 12:17:42  james
 * *** empty log message ***
 *
 */

#ifndef __IPC_H__
#define __IPC_H__

#define IPC_MAX_BUF 1024

#define IPC_MSG_TYPE_NOOP  0
#define IPC_MSG_TYPE_DEBUG 1
#define IPC_MSG_TYPE_VT102 2
#define IPC_MSG_TYPE_HISTORY 3
#define IPC_MSG_TYPE_KEY 4
#define IPC_MSG_TYPE_TERM 5
#define IPC_MSG_TYPE_STATUS 6
#define IPC_MSG_TYPE_SETBAUD 7
#define IPC_MSG_TYPE_SENDBREAK 8
#define IPC_MSG_TYPE_SETFLOW 9
#define IPC_MSG_TYPE_SETANSI 10
#define IPC_MSG_TYPE_HANGUP 11

typedef struct
{
  int32_t size;
  int32_t type;
  uint8_t payload[0];
} IPC_Msg_hdr;


typedef struct
{
  int32_t size;
  int32_t type;
} IPC_Msg_noop;


typedef struct
{
  int32_t size;
  int32_t type;
  char msg[0];
} IPC_Msg_debug;

typedef struct
{
  int32_t size;
  int32_t type;
  History_ent history;
} IPC_Msg_history;

typedef struct
{
  int32_t size;
  int32_t type;
  int32_t len;
  VT102 vt102;
} IPC_Msg_VT102;


typedef struct
{
  int32_t size;
  int32_t type;
  int32_t key;
} IPC_Msg_key;

typedef struct
{
  int32_t size;
  int32_t type;
  int32_t len;
  uint8_t term[0];
} IPC_Msg_term;


typedef struct
{
  int32_t size;
  int32_t type;
  char status[0];
} IPC_Msg_status;

typedef struct
{
  int32_t size;
  int32_t type;
  int32_t baud;
} IPC_Msg_setbaud;


typedef struct
{
  int32_t size;
  int32_t type;
} IPC_Msg_sendbreak;


typedef struct
{
  int32_t size;
  int32_t type;
  int32_t flow;
} IPC_Msg_setflow;


typedef struct
{
  int32_t size;
  int32_t type;
  int32_t ansi;
} IPC_Msg_setansi;


typedef struct
{
  int32_t size;
  int32_t type;
} IPC_Msg_hangup;



typedef union
{
  IPC_Msg_hdr hdr;
  IPC_Msg_noop noop;
  IPC_Msg_debug debug;
  IPC_Msg_history history;
  IPC_Msg_VT102 vt102;
  IPC_Msg_key key;
  IPC_Msg_term term;
  IPC_Msg_status status;
  IPC_Msg_setbaud setbaud;
  IPC_Msg_sendbreak sendbreak;
  IPC_Msg_setflow setflow;
  IPC_Msg_setansi setansi;
  IPC_Msg_hangup hangup;
} IPC_Msg;



#endif /* __IPC_H__ */