OpenSDN source code
thrift_protocol.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  * Copyright 2006-2017 The Apache Software Foundation.
20  * https://github.com/apache/thrift
21  *
22  * Modifications Copyright (c) Juniper Networks, Inc.
23  * Copyright Contributors to the OpenSDN project
24  */
25 
26 #ifndef _THRIFT_PROTOCOL_H
27 #define _THRIFT_PROTOCOL_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
42 typedef enum {
43  T_STOP = 0,
44  T_VOID = 1,
45  T_BOOL = 2,
46  T_BYTE = 3,
47  T_I08 = 3,
48  T_I16 = 6,
49  T_I32 = 8,
50  T_U64 = 9,
51  T_I64 = 10,
52  T_DOUBLE = 4,
53  T_STRING = 11,
54  T_UTF7 = 11,
55  T_STRUCT = 12,
56  T_MAP = 13,
57  T_SET = 14,
58  T_LIST = 15,
59  T_UTF8 = 16,
60  T_UTF16 = 17,
61  T_U16 = 19,
62  T_U32 = 20,
63  T_XML = 21,
64  T_IPV4 = 22,
65  T_UUID = 23,
66  T_IPADDR = 24
68 
73 typedef enum {
74  T_CALL = 1,
75  T_REPLY = 2,
77  T_ONEWAY = 4
79 
83 typedef enum {
87 
88 /*
89  * Thrift Protocol
90  */
92 {
95  int32_t (*write_sandesh_begin) (struct _ThriftProtocol *protocol, const char *name,
96  int *error);
97  int32_t (*write_sandesh_end) (struct _ThriftProtocol *protocol, int *error);
98  int32_t (*write_struct_begin) (struct _ThriftProtocol *protocol, const char *name,
99  int *error);
100  int32_t (*write_struct_end) (struct _ThriftProtocol *protocol, int *error);
101  int32_t (*write_field_begin) (struct _ThriftProtocol *protocol, const char *name,
102  const ThriftType field_type,
103  const int16_t field_id, int *error);
104  int32_t (*write_field_end) (struct _ThriftProtocol *protocol, int *error);
105  int32_t (*write_field_stop) (struct _ThriftProtocol *protocol, int *error);
106  int32_t (*write_list_begin) (struct _ThriftProtocol *protocol,
107  const ThriftType element_type,
108  const u_int32_t size, int *error);
109  int32_t (*write_list_end) (struct _ThriftProtocol *protocol, int *error);
110  int32_t (*write_bool) (struct _ThriftProtocol *protocol, const u_int8_t value,
111  int *error);
112  int32_t (*write_byte) (struct _ThriftProtocol *protocol, const int8_t value,
113  int *error);
114  int32_t (*write_i16) (struct _ThriftProtocol *protocol, const int16_t value,
115  int *error);
116  int32_t (*write_i32) (struct _ThriftProtocol *protocol, const int32_t value,
117  int *error);
118  int32_t (*write_i64) (struct _ThriftProtocol *protocol, const int64_t value,
119  int *error);
120  int32_t (*write_u16) (struct _ThriftProtocol *protocol, const u_int16_t value,
121  int *error);
122  int32_t (*write_u32) (struct _ThriftProtocol *protocol, const u_int32_t value,
123  int *error);
124  int32_t (*write_u64) (struct _ThriftProtocol *protocol, const u_int64_t value,
125  int *error);
126  int32_t (*write_ipv4) (struct _ThriftProtocol *protocol, const u_int32_t value,
127  int *error);
128  int32_t (*write_ipaddr) (struct _ThriftProtocol *protocol, const ipaddr_t *value,
129  int *error);
130  int32_t (*write_double) (struct _ThriftProtocol *protocol, const double value,
131  int *error);
132  int32_t (*write_string) (struct _ThriftProtocol *protocol, const char *str,
133  int *error);
134  int32_t (*write_binary) (struct _ThriftProtocol *protocol, const void *buf,
135  const u_int32_t len, int *error);
136  int32_t (*write_xml) (struct _ThriftProtocol *protocol, const char *str,
137  int *error);
138  int32_t (*write_uuid_t) (struct _ThriftProtocol *protocol, const ct_uuid_t value,
139  int *error);
140 
141  int32_t (*read_sandesh_begin) (struct _ThriftProtocol *protocol, char **name,
142  int *error);
143  int32_t (*read_sandesh_end) (struct _ThriftProtocol *protocol, int *error);
144  int32_t (*read_struct_begin) (struct _ThriftProtocol *protocol, char **name,
145  int *error);
146  int32_t (*read_struct_end) (struct _ThriftProtocol *protocol, int *error);
147  int32_t (*read_field_begin) (struct _ThriftProtocol *protocol, char **name,
148  ThriftType *field_type, int16_t *field_id,
149  int *error);
150  int32_t (*read_field_end) (struct _ThriftProtocol *protocol, int *error);
151  int32_t (*read_list_begin) (struct _ThriftProtocol *protocol, ThriftType *element_type,
152  u_int32_t *size, int *error);
153  int32_t (*read_list_end) (struct _ThriftProtocol *protocol, int *error);
154  int32_t (*read_bool) (struct _ThriftProtocol *protocol, u_int8_t *value,
155  int *error);
156  int32_t (*read_byte) (struct _ThriftProtocol *protocol, int8_t *value, int *error);
157  int32_t (*read_i16) (struct _ThriftProtocol *protocol, int16_t *value, int *error);
158  int32_t (*read_i32) (struct _ThriftProtocol *protocol, int32_t *value, int *error);
159  int32_t (*read_i64) (struct _ThriftProtocol *protocol, int64_t *value, int *error);
160  int32_t (*read_u16) (struct _ThriftProtocol *protocol, u_int16_t *value, int *error);
161  int32_t (*read_u32) (struct _ThriftProtocol *protocol, u_int32_t *value, int *error);
162  int32_t (*read_u64) (struct _ThriftProtocol *protocol, u_int64_t *value, int *error);
163  int32_t (*read_ipv4) (struct _ThriftProtocol *protocol, u_int32_t *value, int *error);
164  int32_t (*read_ipaddr) (struct _ThriftProtocol *protocol, ipaddr_t *value, int *error);
165  int32_t (*read_double) (struct _ThriftProtocol *protocol, double *value,
166  int *error);
167  int32_t (*read_string) (struct _ThriftProtocol *protocol, char **str, int *error);
168  int32_t (*read_binary) (struct _ThriftProtocol *protocol, void **buf,
169  u_int32_t *len, int *error);
170  int32_t (*read_xml) (struct _ThriftProtocol *protocol, char **str, int *error);
171  int32_t (*read_uuid_t) (struct _ThriftProtocol *protocol, ct_uuid_t *value, int *error);
172 };
173 typedef struct _ThriftProtocol ThriftProtocol;
174 
175 /* used by THRIFT_TYPE_PROTOCOL */
177  ThriftProtocol *protocol)
178 {
179  return protocol->ptype;
180 }
181 
182 /* virtual public methods */
183 static inline int32_t thrift_protocol_write_sandesh_begin (
184  ThriftProtocol *protocol,
185  const char *name, int *error)
186 {
187  return protocol->write_sandesh_begin (protocol, name, error);
188 }
189 
190 static inline int32_t thrift_protocol_write_sandesh_end (
191  ThriftProtocol *protocol,
192  int *error)
193 {
194  return protocol->write_sandesh_end (protocol, error);
195 }
196 
197 static inline int32_t thrift_protocol_write_struct_begin (
198  ThriftProtocol *protocol,
199  const char *name,
200  int *error)
201 {
202  return protocol->write_struct_begin (protocol, name, error);
203 }
204 
205 static inline int32_t thrift_protocol_write_struct_end (
206  ThriftProtocol *protocol,
207  int *error)
208 {
209  return protocol->write_struct_end (protocol, error);
210 }
211 
212 static inline int32_t thrift_protocol_write_field_begin (
213  ThriftProtocol *protocol,
214  const char *name,
215  const ThriftType field_type,
216  const int16_t field_id,
217  int *error)
218 {
219  return protocol->write_field_begin (protocol, name, field_type, field_id,
220  error);
221 }
222 
223 static inline int32_t thrift_protocol_write_field_end (
224  ThriftProtocol *protocol,
225  int *error)
226 {
227  return protocol->write_field_end (protocol, error);
228 }
229 
230 static inline int32_t thrift_protocol_write_field_stop (
231  ThriftProtocol *protocol,
232  int *error)
233 {
234  return protocol->write_field_stop (protocol, error);
235 }
236 
237 static inline int32_t thrift_protocol_write_list_begin (
238  ThriftProtocol *protocol,
239  const ThriftType element_type,
240  const u_int32_t size, int *error)
241 {
242  return protocol->write_list_begin (protocol, element_type, size, error);
243 }
244 
245 static inline int32_t thrift_protocol_write_list_end (ThriftProtocol *protocol,
246  int *error)
247 {
248  return protocol->write_list_end (protocol, error);
249 }
250 
251 static inline int32_t thrift_protocol_write_bool (ThriftProtocol *protocol,
252  const u_int8_t value,
253  int *error)
254 {
255  return protocol->write_bool (protocol, value, error);
256 }
257 
258 static inline int32_t thrift_protocol_write_byte (ThriftProtocol *protocol,
259  const int8_t value,
260  int *error)
261 {
262  return protocol->write_byte (protocol, value, error);
263 }
264 
265 static inline int32_t thrift_protocol_write_i16 (ThriftProtocol *protocol,
266  const int16_t value,
267  int *error)
268 {
269  return protocol->write_i16 (protocol, value, error);
270 }
271 
272 static inline int32_t thrift_protocol_write_i32 (ThriftProtocol *protocol,
273  const int32_t value,
274  int *error)
275 {
276  return protocol->write_i32 (protocol, value, error);
277 }
278 
279 static inline int32_t thrift_protocol_write_i64 (ThriftProtocol *protocol,
280  const int64_t value,
281  int *error)
282 {
283  return protocol->write_i64 (protocol, value, error);
284 }
285 
286 static inline int32_t thrift_protocol_write_u16 (ThriftProtocol *protocol,
287  const u_int16_t value,
288  int *error)
289 {
290  return protocol->write_u16 (protocol, value, error);
291 }
292 
293 static inline int32_t thrift_protocol_write_u32 (ThriftProtocol *protocol,
294  const u_int32_t value,
295  int *error)
296 {
297  return protocol->write_u32 (protocol, value, error);
298 }
299 
300 static inline int32_t thrift_protocol_write_u64 (ThriftProtocol *protocol,
301  const u_int64_t value,
302  int *error)
303 {
304  return protocol->write_u64 (protocol, value, error);
305 }
306 
307 static inline int32_t thrift_protocol_write_ipv4 (ThriftProtocol *protocol,
308  const u_int32_t value,
309  int *error)
310 {
311  return protocol->write_ipv4 (protocol, value, error);
312 }
313 
314 static inline int32_t thrift_protocol_write_ipaddr (ThriftProtocol *protocol,
315  const ipaddr_t *value,
316  int *error)
317 {
318  return protocol->write_ipaddr (protocol, value, error);
319 }
320 
321 static inline int32_t thrift_protocol_write_double (ThriftProtocol *protocol,
322  const double value,
323  int *error)
324 {
325  return protocol->write_double (protocol, value, error);
326 }
327 
328 static inline int32_t thrift_protocol_write_string (ThriftProtocol *protocol,
329  const char *str,
330  int *error)
331 {
332  return protocol->write_string (protocol, str, error);
333 }
334 
335 static inline int32_t thrift_protocol_write_binary (ThriftProtocol *protocol,
336  const void *buf,
337  const u_int32_t len,
338  int *error)
339 {
340  return protocol->write_binary (protocol, buf, len, error);
341 }
342 
343 static inline int32_t thrift_protocol_write_xml (ThriftProtocol *protocol,
344  const char *str,
345  int *error)
346 {
347  return protocol->write_xml (protocol, str, error);
348 }
349 
350 static inline int32_t thrift_protocol_write_uuid_t (ThriftProtocol *protocol,
351  const ct_uuid_t value,
352  int *error)
353 {
354  return protocol->write_uuid_t (protocol, value, error);
355 }
356 
357 static inline int32_t thrift_protocol_read_sandesh_begin (
358  ThriftProtocol *protocol,
359  char **name,
360  int *error)
361 {
362  return protocol->read_sandesh_begin (protocol, name, error);
363 }
364 
365 static inline int32_t thrift_protocol_read_sandesh_end (
366  ThriftProtocol *protocol,
367  int *error)
368 {
369  return protocol->read_sandesh_end (protocol, error);
370 }
371 
372 static inline int32_t thrift_protocol_read_struct_begin (
373  ThriftProtocol *protocol,
374  char **name,
375  int *error)
376 {
377  return protocol->read_struct_begin (protocol, name, error);
378 }
379 
380 static inline int32_t thrift_protocol_read_struct_end (
381  ThriftProtocol *protocol,
382  int *error)
383 {
384  return protocol->read_struct_end (protocol, error);
385 }
386 
387 static inline int32_t thrift_protocol_read_field_begin (
388  ThriftProtocol *protocol,
389  char **name,
390  ThriftType *field_type,
391  int16_t *field_id,
392  int *error)
393 {
394  return protocol->read_field_begin (protocol, name, field_type, field_id,
395  error);
396 }
397 
398 static inline int32_t thrift_protocol_read_field_end (ThriftProtocol *protocol,
399  int *error)
400 {
401  return protocol->read_field_end (protocol, error);
402 }
403 
404 static inline int32_t thrift_protocol_read_list_begin (
405  ThriftProtocol *protocol,
406  ThriftType *element_type,
407  u_int32_t *size, int *error)
408 {
409  return protocol->read_list_begin (protocol, element_type, size, error);
410 }
411 
412 static inline int32_t thrift_protocol_read_list_end (ThriftProtocol *protocol,
413  int *error)
414 {
415  return protocol->read_list_end (protocol, error);
416 }
417 
418 static inline int32_t thrift_protocol_read_bool (ThriftProtocol *protocol,
419  u_int8_t *value,
420  int *error)
421 {
422  return protocol->read_bool (protocol, value, error);
423 }
424 
425 static inline int32_t thrift_protocol_read_byte (ThriftProtocol *protocol,
426  int8_t *value,
427  int *error)
428 {
429  return protocol->read_byte (protocol, value, error);
430 }
431 
432 static inline int32_t thrift_protocol_read_i16 (ThriftProtocol *protocol,
433  int16_t *value,
434  int *error)
435 {
436  return protocol->read_i16 (protocol, value, error);
437 }
438 
439 static inline int32_t thrift_protocol_read_i32 (ThriftProtocol *protocol,
440  int32_t *value,
441  int *error)
442 {
443  return protocol->read_i32 (protocol, value, error);
444 }
445 
446 static inline int32_t thrift_protocol_read_i64 (ThriftProtocol *protocol,
447  int64_t *value,
448  int *error)
449 {
450  return protocol->read_i64 (protocol, value, error);
451 }
452 
453 static inline int32_t thrift_protocol_read_u16 (ThriftProtocol *protocol,
454  u_int16_t *value,
455  int *error)
456 {
457  return protocol->read_u16 (protocol, value, error);
458 }
459 
460 static inline int32_t thrift_protocol_read_u32 (ThriftProtocol *protocol,
461  u_int32_t *value,
462  int *error)
463 {
464  return protocol->read_u32 (protocol, value, error);
465 }
466 
467 
468 static inline int32_t thrift_protocol_read_u64 (ThriftProtocol *protocol,
469  u_int64_t *value,
470  int *error)
471 {
472  return protocol->read_u64 (protocol, value, error);
473 }
474 
475 static inline int32_t thrift_protocol_read_ipv4 (ThriftProtocol *protocol,
476  u_int32_t *value,
477  int *error)
478 {
479  return protocol->read_ipv4 (protocol, value, error);
480 }
481 
482 static inline int32_t thrift_protocol_read_ipaddr (ThriftProtocol *protocol,
483  ipaddr_t *value,
484  int *error)
485 {
486  return protocol->read_ipaddr (protocol, value, error);
487 }
488 
489 static inline int32_t thrift_protocol_read_double (ThriftProtocol *protocol,
490  double *value, int *error)
491 {
492  return protocol->read_double (protocol, value, error);
493 }
494 
495 static inline int32_t thrift_protocol_read_string (ThriftProtocol *protocol,
496  char **str, int *error)
497 {
498  return protocol->read_string (protocol, str, error);
499 }
500 
501 static inline int32_t thrift_protocol_read_binary (ThriftProtocol *protocol,
502  void **buf, u_int32_t *len,
503  int *error)
504 {
505  return protocol->read_binary (protocol, buf, len, error);
506 }
507 
508 static inline int32_t thrift_protocol_read_xml (ThriftProtocol *protocol,
509  char **str, int *error)
510 {
511  return protocol->read_xml (protocol, str, error);
512 }
513 
514 static inline int32_t thrift_protocol_read_uuid_t (ThriftProtocol *protocol,
515  ct_uuid_t *value, int *error)
516 {
517  return protocol->read_uuid_t (protocol, value, error);
518 }
519 
521  int *error);
522 
526 
527 /* define error types */
528 typedef enum
529 {
537 
538 #ifdef __cplusplus
539 }
540 #endif
541 
542 #endif /* _THRIFT_PROTOCOL_H */
unsigned char ct_uuid_t[16]
Definition: c/sandesh.h:62
uint8_t type
Definition: load_balance.h:2
int32_t(* write_xml)(struct _ThriftProtocol *protocol, const char *str, int *error)
int32_t(* read_struct_end)(struct _ThriftProtocol *protocol, int *error)
int32_t(* read_sandesh_begin)(struct _ThriftProtocol *protocol, char **name, int *error)
int32_t(* read_list_begin)(struct _ThriftProtocol *protocol, ThriftType *element_type, u_int32_t *size, int *error)
int32_t(* read_ipaddr)(struct _ThriftProtocol *protocol, ipaddr_t *value, int *error)
int32_t(* write_sandesh_begin)(struct _ThriftProtocol *protocol, const char *name, int *error)
int32_t(* read_u16)(struct _ThriftProtocol *protocol, u_int16_t *value, int *error)
int32_t(* write_struct_end)(struct _ThriftProtocol *protocol, int *error)
int32_t(* read_byte)(struct _ThriftProtocol *protocol, int8_t *value, int *error)
int32_t(* write_i32)(struct _ThriftProtocol *protocol, const int32_t value, int *error)
int32_t(* read_field_begin)(struct _ThriftProtocol *protocol, char **name, ThriftType *field_type, int16_t *field_id, int *error)
int32_t(* read_u64)(struct _ThriftProtocol *protocol, u_int64_t *value, int *error)
int32_t(* read_i32)(struct _ThriftProtocol *protocol, int32_t *value, int *error)
int32_t(* write_i64)(struct _ThriftProtocol *protocol, const int64_t value, int *error)
int32_t(* read_double)(struct _ThriftProtocol *protocol, double *value, int *error)
int32_t(* write_sandesh_end)(struct _ThriftProtocol *protocol, int *error)
int32_t(* write_binary)(struct _ThriftProtocol *protocol, const void *buf, const u_int32_t len, int *error)
int32_t(* read_sandesh_end)(struct _ThriftProtocol *protocol, int *error)
int32_t(* write_byte)(struct _ThriftProtocol *protocol, const int8_t value, int *error)
int32_t(* read_i16)(struct _ThriftProtocol *protocol, int16_t *value, int *error)
int32_t(* write_u16)(struct _ThriftProtocol *protocol, const u_int16_t value, int *error)
int32_t(* read_string)(struct _ThriftProtocol *protocol, char **str, int *error)
int32_t(* read_ipv4)(struct _ThriftProtocol *protocol, u_int32_t *value, int *error)
int32_t(* write_uuid_t)(struct _ThriftProtocol *protocol, const ct_uuid_t value, int *error)
int32_t(* read_binary)(struct _ThriftProtocol *protocol, void **buf, u_int32_t *len, int *error)
ThriftTransport * transport
int32_t(* write_string)(struct _ThriftProtocol *protocol, const char *str, int *error)
int32_t(* write_list_begin)(struct _ThriftProtocol *protocol, const ThriftType element_type, const u_int32_t size, int *error)
int32_t(* write_ipv4)(struct _ThriftProtocol *protocol, const u_int32_t value, int *error)
int32_t(* write_struct_begin)(struct _ThriftProtocol *protocol, const char *name, int *error)
int32_t(* write_field_stop)(struct _ThriftProtocol *protocol, int *error)
int32_t(* read_bool)(struct _ThriftProtocol *protocol, u_int8_t *value, int *error)
int32_t(* read_field_end)(struct _ThriftProtocol *protocol, int *error)
int32_t(* write_i16)(struct _ThriftProtocol *protocol, const int16_t value, int *error)
int32_t(* read_list_end)(struct _ThriftProtocol *protocol, int *error)
int32_t(* read_i64)(struct _ThriftProtocol *protocol, int64_t *value, int *error)
int32_t(* read_struct_begin)(struct _ThriftProtocol *protocol, char **name, int *error)
int32_t(* read_xml)(struct _ThriftProtocol *protocol, char **str, int *error)
int32_t(* write_u64)(struct _ThriftProtocol *protocol, const u_int64_t value, int *error)
int32_t(* write_list_end)(struct _ThriftProtocol *protocol, int *error)
int32_t(* write_double)(struct _ThriftProtocol *protocol, const double value, int *error)
int32_t(* write_ipaddr)(struct _ThriftProtocol *protocol, const ipaddr_t *value, int *error)
int32_t(* read_u32)(struct _ThriftProtocol *protocol, u_int32_t *value, int *error)
int32_t(* read_uuid_t)(struct _ThriftProtocol *protocol, ct_uuid_t *value, int *error)
int32_t(* write_u32)(struct _ThriftProtocol *protocol, const u_int32_t value, int *error)
int32_t(* write_bool)(struct _ThriftProtocol *protocol, const u_int8_t value, int *error)
int32_t(* write_field_end)(struct _ThriftProtocol *protocol, int *error)
ThriftProtocolType ptype
int32_t(* write_field_begin)(struct _ThriftProtocol *protocol, const char *name, const ThriftType field_type, const int16_t field_id, int *error)
static int32_t thrift_protocol_read_struct_end(ThriftProtocol *protocol, int *error)
static int32_t thrift_protocol_write_string(ThriftProtocol *protocol, const char *str, int *error)
static int32_t thrift_protocol_write_field_begin(ThriftProtocol *protocol, const char *name, const ThriftType field_type, const int16_t field_id, int *error)
static int32_t thrift_protocol_read_double(ThriftProtocol *protocol, double *value, int *error)
static int32_t thrift_protocol_write_list_begin(ThriftProtocol *protocol, const ThriftType element_type, const u_int32_t size, int *error)
static int32_t thrift_protocol_write_list_end(ThriftProtocol *protocol, int *error)
static int32_t thrift_protocol_read_sandesh_begin(ThriftProtocol *protocol, char **name, int *error)
static int32_t thrift_protocol_write_field_end(ThriftProtocol *protocol, int *error)
static int32_t thrift_protocol_write_struct_end(ThriftProtocol *protocol, int *error)
static int32_t thrift_protocol_write_i32(ThriftProtocol *protocol, const int32_t value, int *error)
static int32_t thrift_protocol_read_list_end(ThriftProtocol *protocol, int *error)
static int32_t thrift_protocol_read_field_begin(ThriftProtocol *protocol, char **name, ThriftType *field_type, int16_t *field_id, int *error)
static int32_t thrift_protocol_write_field_stop(ThriftProtocol *protocol, int *error)
int32_t thrift_protocol_skip(ThriftProtocol *protocol, ThriftType type, int *error)
static int32_t thrift_protocol_write_i16(ThriftProtocol *protocol, const int16_t value, int *error)
static int32_t thrift_protocol_read_ipaddr(ThriftProtocol *protocol, ipaddr_t *value, int *error)
static int32_t thrift_protocol_read_field_end(ThriftProtocol *protocol, int *error)
static int32_t thrift_protocol_read_u16(ThriftProtocol *protocol, u_int16_t *value, int *error)
static int32_t thrift_protocol_write_xml(ThriftProtocol *protocol, const char *str, int *error)
static int32_t thrift_protocol_read_i16(ThriftProtocol *protocol, int16_t *value, int *error)
static ThriftProtocolType thrift_protocol_get_type(ThriftProtocol *protocol)
ThriftMessageType
@ T_REPLY
@ T_CALL
@ T_EXCEPTION
@ T_ONEWAY
static int32_t thrift_protocol_write_struct_begin(ThriftProtocol *protocol, const char *name, int *error)
static int32_t thrift_protocol_write_double(ThriftProtocol *protocol, const double value, int *error)
static int32_t thrift_protocol_write_u32(ThriftProtocol *protocol, const u_int32_t value, int *error)
static int32_t thrift_protocol_write_u64(ThriftProtocol *protocol, const u_int64_t value, int *error)
static int32_t thrift_protocol_read_string(ThriftProtocol *protocol, char **str, int *error)
static int32_t thrift_protocol_read_struct_begin(ThriftProtocol *protocol, char **name, int *error)
void thrift_protocol_init(ThriftProtocol *protocol, ThriftProtocolType ptype, ThriftTransport *transport)
static int32_t thrift_protocol_write_binary(ThriftProtocol *protocol, const void *buf, const u_int32_t len, int *error)
static int32_t thrift_protocol_read_ipv4(ThriftProtocol *protocol, u_int32_t *value, int *error)
static int32_t thrift_protocol_read_sandesh_end(ThriftProtocol *protocol, int *error)
static int32_t thrift_protocol_write_ipv4(ThriftProtocol *protocol, const u_int32_t value, int *error)
static int32_t thrift_protocol_write_sandesh_end(ThriftProtocol *protocol, int *error)
ThriftProtocolType
@ T_PROTOCOL_XML
@ T_PROTOCOL_BINARY
static int32_t thrift_protocol_read_bool(ThriftProtocol *protocol, u_int8_t *value, int *error)
static int32_t thrift_protocol_write_uuid_t(ThriftProtocol *protocol, const ct_uuid_t value, int *error)
static int32_t thrift_protocol_read_binary(ThriftProtocol *protocol, void **buf, u_int32_t *len, int *error)
static int32_t thrift_protocol_write_byte(ThriftProtocol *protocol, const int8_t value, int *error)
static int32_t thrift_protocol_write_u16(ThriftProtocol *protocol, const u_int16_t value, int *error)
static int32_t thrift_protocol_read_list_begin(ThriftProtocol *protocol, ThriftType *element_type, u_int32_t *size, int *error)
static int32_t thrift_protocol_write_i64(ThriftProtocol *protocol, const int64_t value, int *error)
ThriftProtocolError
@ THRIFT_PROTOCOL_ERROR_NOT_IMPLEMENTED
@ THRIFT_PROTOCOL_ERROR_INVALID_DATA
@ THRIFT_PROTOCOL_ERROR_SIZE_LIMIT
@ THRIFT_PROTOCOL_ERROR_UNKNOWN
@ THRIFT_PROTOCOL_ERROR_NEGATIVE_SIZE
@ THRIFT_PROTOCOL_ERROR_BAD_VERSION
static int32_t thrift_protocol_write_bool(ThriftProtocol *protocol, const u_int8_t value, int *error)
static int32_t thrift_protocol_read_i32(ThriftProtocol *protocol, int32_t *value, int *error)
static int32_t thrift_protocol_write_ipaddr(ThriftProtocol *protocol, const ipaddr_t *value, int *error)
static int32_t thrift_protocol_read_uuid_t(ThriftProtocol *protocol, ct_uuid_t *value, int *error)
static int32_t thrift_protocol_read_u32(ThriftProtocol *protocol, u_int32_t *value, int *error)
static int32_t thrift_protocol_read_i64(ThriftProtocol *protocol, int64_t *value, int *error)
static int32_t thrift_protocol_read_xml(ThriftProtocol *protocol, char **str, int *error)
static int32_t thrift_protocol_read_byte(ThriftProtocol *protocol, int8_t *value, int *error)
static int32_t thrift_protocol_write_sandesh_begin(ThriftProtocol *protocol, const char *name, int *error)
static int32_t thrift_protocol_read_u64(ThriftProtocol *protocol, u_int64_t *value, int *error)
ThriftType
@ T_STOP
@ T_IPADDR
@ T_STRING
@ T_I08
@ T_UTF7
@ T_VOID
@ T_MAP
@ T_UTF16
@ T_BYTE
@ T_U32
@ T_IPV4
@ T_I16
@ T_BOOL
@ T_LIST
@ T_DOUBLE
@ T_U64
@ T_UTF8
@ T_STRUCT
@ T_I64
@ T_SET
@ T_U16
@ T_UUID
@ T_I32
@ T_XML