Initial commit
[com/gs-lite.git] / src / lib / gscphost / include / ipcencoding.h
1 /* ------------------------------------------------
2  Copyright 2014 AT&T Intellectual Property
3  Licensed under the Apache License, Version 2.0 (the "License");
4  you may not use this file except in compliance with the License.
5  You may obtain a copy of the License at
6  
7  http://www.apache.org/licenses/LICENSE-2.0
8  
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14  ------------------------------------------- */
15 #ifndef IPCENCODING_H
16 #define IPCENCODING_H
17 #include "gsconfig.h"
18 #include "gstypes.h"
19
20 #include <fta.h>
21 #include <systat.h>
22 #include <gscpipc.h>
23 #include <fta_stat.h>
24
25
26 #define FTA_LOOKUP 1
27 #define FTA_ALLOC_INSTANCE 2
28 #define FTA_ALLOC_PRINT_INSTANCE 3
29 #define FTA_FREE_INSTANCE 4
30 #define FTA_CONTROL 5
31 #define FTA_PRODUCER_FAILURE 6
32 #define FTA_HEARTBEAT 7
33
34 #define GSCP_GET_BUFFER 8
35
36 #define FTA_REGISTER 9
37 #define FTA_UNREGISTER 10
38
39 #define PROCESS_CONTROL 11
40
41 #define RESULT_OPCODE_BASE 128
42 #define STANDARD_RESULT 129
43 #define FTAFIND_RESULT 130
44 #define FTA_RESULT 131
45
46 /* the following result codes are ignored in standard
47  * processing they are only used when blocking for them
48  * directly
49  */
50
51 #define RESULT_OPCODE_IGNORE 256
52 #define WAKEUP  266
53 #define TIMEOUT 267
54
55 struct processtate {
56     gs_int32_t active;
57     gs_int32_t type;
58     gs_int32_t buffersize;
59     gs_int32_t deviceid;
60     gs_int32_t mapcnt;
61     gs_sp_t *map;
62 };
63
64 extern struct processtate curprocess;
65
66 struct hostcall {
67     gs_int32_t callid;
68     gs_int32_t size;
69 };
70
71
72 struct fta_find_arg {
73     struct hostcall h;
74     gs_int8_t  name[MAXFTANAME];
75     gs_uint32_t reuse;
76 };
77
78 struct fta_alloc_instance_arg {
79     struct hostcall h;
80     FTAID subscriber;
81     FTAID f;
82     gs_int8_t  name[MAXFTANAME];
83     gs_int8_t  schema[MAXSCHEMASZ];
84     gs_uint32_t reusable;
85     gs_int32_t command;
86     gs_int32_t sz;
87     gs_int8_t  path[MAXPRINTSTRING];
88     gs_int8_t  basename[MAXPRINTSTRING];
89     gs_int8_t  temporal_field[MAXPRINTSTRING];
90         gs_int8_t  split_field[MAXPRINTSTRING];
91         gs_uint32_t split;
92     gs_uint32_t delta;
93     gs_int8_t  data[1];
94 };
95
96 struct fta_free_instance_arg {
97     struct hostcall h;
98     FTAID subscriber;
99     FTAID f;
100     gs_uint32_t recursive;
101 };
102
103 struct fta_control_arg {
104     struct hostcall h;
105     FTAID subscriber;
106     FTAID f;
107     gs_int32_t command;
108     gs_int32_t sz;
109     gs_int8_t  data[1];
110 };
111
112
113 struct fta_notify_producer_failure_arg {
114     struct hostcall h;
115     FTAID sender;
116     FTAID producer;
117 };
118
119 struct fta_heartbeat_arg {
120     struct hostcall h;
121     FTAID sender;
122     gs_uint64_t trace_id;
123     gs_int32_t sz;
124     fta_stat data[1];
125 };
126
127 struct gscp_get_buffer_arg {
128     struct hostcall h;
129     gs_int32_t timeout;
130 };
131
132 struct fta_register_arg {
133     struct hostcall h;
134     gs_uint32_t reusable;
135     gs_int8_t  name[MAXFTANAME];
136     gs_int8_t  schema[MAXSCHEMASZ];
137     FTAID f;
138     FTAID subscriber;
139 };
140
141 struct fta_unregister_arg {
142     struct hostcall h;
143     FTAID f;
144     FTAID subscriber;
145 };
146
147 struct tuple_post_arg {
148     struct hostcall h;
149     gs_int32_t stream_id;
150     gs_int32_t sz;
151     void * tuple;
152 };
153
154 struct process_control_arg {
155     struct hostcall h;
156     gs_int32_t command;
157     gs_int32_t sz;
158     gs_int8_t  data[1];
159 };
160
161 struct standard_result {
162     struct hostcall h;
163     gs_int32_t result;
164 };
165
166 struct wakeup_result {
167     struct hostcall h;
168 };
169
170 struct timeout_result {
171     struct hostcall h;
172 };
173
174
175 struct fta_result {
176     struct hostcall h;
177     gs_int32_t result;
178     FTAID f;
179 };
180
181 struct ftafind_result {
182     struct hostcall h;
183     gs_int32_t result;
184     FTAID f;
185     gs_int8_t  schema[MAXSCHEMASZ];
186 };
187
188 #endif