forked from circonus-labs/reconnoiter
/
bundle.pb-c.h
190 lines (164 loc) · 5.28 KB
/
bundle.pb-c.h
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
#ifndef PROTOBUF_C_bundle_2eproto__INCLUDED
#define PROTOBUF_C_bundle_2eproto__INCLUDED
#include <google/protobuf-c/protobuf-c.h>
PROTOBUF_C_BEGIN_DECLS
typedef struct _Metric Metric;
typedef struct _Status Status;
typedef struct _Metadata Metadata;
typedef struct _Bundle Bundle;
/* --- enums --- */
/* --- messages --- */
struct _Metric
{
ProtobufCMessage base;
char *name;
int32_t metrictype;
protobuf_c_boolean has_valuedbl;
double valuedbl;
protobuf_c_boolean has_valuei64;
int64_t valuei64;
protobuf_c_boolean has_valueui64;
uint64_t valueui64;
protobuf_c_boolean has_valuei32;
int32_t valuei32;
protobuf_c_boolean has_valueui32;
uint32_t valueui32;
char *valuestr;
};
#define METRIC__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&metric__descriptor) \
, NULL, 0, 0,0, 0,0, 0,0, 0,0, 0,0, NULL }
struct _Status
{
ProtobufCMessage base;
int32_t available;
int32_t state;
int32_t duration;
char *status;
};
#define STATUS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&status__descriptor) \
, 0, 0, 0, NULL }
struct _Metadata
{
ProtobufCMessage base;
char *key;
char *value;
};
#define METADATA__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&metadata__descriptor) \
, NULL, NULL }
struct _Bundle
{
ProtobufCMessage base;
Status *status;
size_t n_metrics;
Metric **metrics;
size_t n_metadata;
Metadata **metadata;
protobuf_c_boolean has_period;
uint32_t period;
protobuf_c_boolean has_timeout;
uint32_t timeout;
};
#define BUNDLE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&bundle__descriptor) \
, NULL, 0,NULL, 0,NULL, 0,0, 0,0 }
/* Metric methods */
void metric__init
(Metric *message);
size_t metric__get_packed_size
(const Metric *message);
size_t metric__pack
(const Metric *message,
uint8_t *out);
size_t metric__pack_to_buffer
(const Metric *message,
ProtobufCBuffer *buffer);
Metric *
metric__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void metric__free_unpacked
(Metric *message,
ProtobufCAllocator *allocator);
/* Status methods */
void status__init
(Status *message);
size_t status__get_packed_size
(const Status *message);
size_t status__pack
(const Status *message,
uint8_t *out);
size_t status__pack_to_buffer
(const Status *message,
ProtobufCBuffer *buffer);
Status *
status__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void status__free_unpacked
(Status *message,
ProtobufCAllocator *allocator);
/* Metadata methods */
void metadata__init
(Metadata *message);
size_t metadata__get_packed_size
(const Metadata *message);
size_t metadata__pack
(const Metadata *message,
uint8_t *out);
size_t metadata__pack_to_buffer
(const Metadata *message,
ProtobufCBuffer *buffer);
Metadata *
metadata__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void metadata__free_unpacked
(Metadata *message,
ProtobufCAllocator *allocator);
/* Bundle methods */
void bundle__init
(Bundle *message);
size_t bundle__get_packed_size
(const Bundle *message);
size_t bundle__pack
(const Bundle *message,
uint8_t *out);
size_t bundle__pack_to_buffer
(const Bundle *message,
ProtobufCBuffer *buffer);
Bundle *
bundle__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void bundle__free_unpacked
(Bundle *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Metric_Closure)
(const Metric *message,
void *closure_data);
typedef void (*Status_Closure)
(const Status *message,
void *closure_data);
typedef void (*Metadata_Closure)
(const Metadata *message,
void *closure_data);
typedef void (*Bundle_Closure)
(const Bundle *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor metric__descriptor;
extern const ProtobufCMessageDescriptor status__descriptor;
extern const ProtobufCMessageDescriptor metadata__descriptor;
extern const ProtobufCMessageDescriptor bundle__descriptor;
PROTOBUF_C_END_DECLS
#endif /* PROTOBUF_bundle_2eproto__INCLUDED */