Add new udafs and RMR support to gsprintconsole_ves
[com/gs-lite.git] / include / packet.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 PACKET_H
16 #define PACKET_H
17
18 #include "gsconfig.h"
19 #include "gstypes.h"
20
21 #ifndef IPV6_STR
22 #define IPV6_STR
23 struct ipv6_str{
24     gs_uint32_t v[4];
25 };
26 #endif
27
28 #define PTYPE_CSV 1
29 #define PTYPE_GDAT 2
30 #define PTYPE_STRUCT 3
31
32 #define CSVELEMENTS 1000
33 #define GDATELEMENTS 1000
34
35 struct csv {
36     gs_uint32_t numberfields;
37     gs_sp_t fields[CSVELEMENTS];
38     gs_uint32_t field_lens[CSVELEMENTS];    
39 };
40
41 struct gdat {
42     gs_schemahandle_t schema;
43     gs_uint32_t numfields;
44     gs_uint32_t datasz;
45     gs_uint8_t data[MAXTUPLESZ];
46 };
47
48 struct packed {
49         void *values;
50         gs_sp_t *existence_bitmap;
51 };
52
53 struct packet {
54     gs_uint32_t systemTime;
55     gs_uint32_t ptype; /* type of record e.g. PTYPE_CSV */
56         gs_schemahandle_t schema;
57     union {
58         struct csv csv; /* content of CSV record being processed */
59         struct gdat gdat;
60                 struct packed packed;
61         } record;
62     
63 };
64
65
66 #endif