11 #ifndef __SANDESHC_H__
12 #define __SANDESHC_H__
20 #if defined(__linux__)
21 #include <linux/kernel.h>
22 #include <linux/slab.h>
24 #include <linux/types.h>
26 #include <linux/in6.h>
28 #define OS_LOG_ERR KERN_ERR
29 #define OS_LOG_DEBUG KERN_DEBUG
31 #define os_malloc(size) kmalloc(size, GFP_KERNEL)
32 #define os_zalloc(size) kzalloc(size, GFP_KERNEL)
33 #define os_realloc(ptr, size) krealloc(ptr, size, GFP_KERNEL)
34 #define os_free(ptr) kfree(ptr)
35 #define os_log(level, format, arg...) printk(level format, ##arg)
38 extern int vrouter_dbg;
43 #include <sys/types.h>
44 #include <arpa/inet.h>
47 #include <sys/errno.h>
49 #define OS_LOG_ERR LOG_ERR
50 #define OS_LOG_DEBUG LOG_DEBUG
52 #define os_malloc(size) malloc(size)
53 #define os_zalloc(size) calloc(1, size)
54 #define os_realloc(ptr, size) realloc(ptr, size)
55 #define os_free(ptr) free(ptr)
56 #define os_log(level, format, arg...) syslog(level, format, ##arg)
84 offset = (8 - (i + 1)) * 8;
85 *data++ = ((value >> offset) & 0xff);
116 u_int32_t buf_len,
int *error);
struct sandesh_info_s sandesh_info_t
int32_t(* write_binary_to_buffer)(void *, uint8_t *, const size_t, int *)
unsigned char ct_uuid_t[16]
int32_t(* read)(void *, ThriftProtocol *, int *)
int32_t(* read_binary_from_buffer)(void *, uint8_t *, const size_t, int *)
sandesh_info_t * sandesh_find_info(sandesh_info_t *infos, const char *name)
int32_t sandesh_decode(u_int8_t *buf, u_int32_t buf_len, sandesh_find_info_fn sinfo_find_fn, int *error)
Abstract class for Thrift protocol implementations.
Implementation of a Thrift FAKE transport.
int32_t(* write)(void *, ThriftProtocol *, int *)
int32_t sandesh_encode(void *sandesh, const char *sname, sandesh_find_info_fn sinfo_find_fn, u_int8_t *buf, u_int32_t buf_len, int *error)
static void os_put_value64(uint8_t *data, uint64_t value)
int32_t sandesh_get_encoded_length(void *sandesh, const char *sname, sandesh_find_info_fn sinfo_find_fn, int *error)
static uint64_t os_get_value64(const uint8_t *data)
Implementation of a Thrift memory buffer transport.
Implementation of a file based thrift transport.
sandesh_info_t *(* sandesh_find_info_fn)(const char *name)