FD.io VPP  v16.06
Vector Packet Processing
serialize.h File Reference
+ Include dependency graph for serialize.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  serialize_stream_t
 
struct  serialize_main_header_t
 
struct  serialize_main_t
 
struct  serialize_multiple_main_t
 

Macros

#define SERIALIZE_END_OF_STREAM   (1 << 0)
 
#define serialize_error_return(m, args...)   serialize_error (&(m)->header, clib_error_return (0, args))
 
#define SERIALIZE_FLAG_IS_READ   (1 << 0)
 
#define SERIALIZE_FLAG_IS_WRITE   (1 << 1)
 
#define vec_serialize(m, v, f)   serialize ((m), serialize_vector, (v), sizeof ((v)[0]), (f))
 
#define vec_unserialize(m, v, f)   unserialize ((m), unserialize_vector, (v), sizeof ((*(v))[0]), (f))
 
#define vec_unserialize_aligned(m, v, f)   unserialize ((m), unserialize_aligned_vector, (v), sizeof ((*(v))[0]), (f))
 
#define pool_serialize(m, v, f)   serialize ((m), serialize_pool, (v), sizeof ((v)[0]), (f))
 
#define pool_unserialize(m, v, f)   unserialize ((m), unserialize_pool, (v), sizeof ((*(v))[0]), (f))
 
#define pool_unserialize_aligned(m, v, a, f)   unserialize ((m), unserialize_aligned_pool, (v), sizeof ((*(v))[0]), (a), (f))
 

Typedefs

typedef voidserialize_data_function_t) (struct serialize_main_header_t *h, struct serialize_stream_t *s)
 
typedef struct serialize_stream_t serialize_stream_t
 
typedef struct serialize_main_header_t serialize_main_header_t
 
typedef voidserialize_function_t) (serialize_main_t *m, va_list *va)
 

Functions

always_inline void serialize_stream_set_end_of_stream (serialize_stream_t *s)
 
always_inline uword serialize_stream_is_end_of_stream (serialize_stream_t *s)
 
always_inline void serialize_error (serialize_main_header_t *m, clib_error_t *error)
 
voidserialize_read_write_not_inline (serialize_main_header_t *m, serialize_stream_t *s, uword n_bytes, uword flags)
 
always_inline voidserialize_stream_read_write (serialize_main_header_t *header, serialize_stream_t *s, uword n_bytes, uword flags)
 
always_inline void serialize_set_end_of_stream (serialize_main_t *m)
 
always_inline uword serialize_is_end_of_stream (serialize_main_t *m)
 
always_inline voidunserialize_get (serialize_main_t *m, uword n_bytes)
 
always_inline voidserialize_get (serialize_main_t *m, uword n_bytes)
 
always_inline void serialize_integer (serialize_main_t *m, u64 x, u32 n_bytes)
 
always_inline void unserialize_integer (serialize_main_t *m, void *x, u32 n_bytes)
 
always_inline void serialize_likely_small_unsigned_integer (serialize_main_t *m, u64 x)
 
always_inline u64 unserialize_likely_small_unsigned_integer (serialize_main_t *m)
 
always_inline void serialize_likely_small_signed_integer (serialize_main_t *m, i64 s)
 
always_inline i64 unserialize_likely_small_signed_integer (serialize_main_t *m)
 
void serialize_multiple_1 (serialize_main_t *m, void *data, uword data_stride, uword n_data)
 
void serialize_multiple_2 (serialize_main_t *m, void *data, uword data_stride, uword n_data)
 
void serialize_multiple_4 (serialize_main_t *m, void *data, uword data_stride, uword n_data)
 
void unserialize_multiple_1 (serialize_main_t *m, void *data, uword data_stride, uword n_data)
 
void unserialize_multiple_2 (serialize_main_t *m, void *data, uword data_stride, uword n_data)
 
void unserialize_multiple_4 (serialize_main_t *m, void *data, uword data_stride, uword n_data)
 
always_inline void serialize_multiple (serialize_main_t *m, void *data, uword n_data_bytes, uword data_stride, uword n_data)
 
always_inline void unserialize_multiple (serialize_main_t *m, void *data, uword n_data_bytes, uword data_stride, uword n_data)
 
void serialize_bitmap (serialize_main_t *m, uword *b)
 
uwordunserialize_bitmap (serialize_main_t *m)
 
void serialize_cstring (serialize_main_t *m, char *string)
 
void unserialize_cstring (serialize_main_t *m, char **string)
 
void serialize_close (serialize_main_t *m)
 
void unserialize_close (serialize_main_t *m)
 
void serialize_open_data (serialize_main_t *m, u8 *data, uword n_data_bytes)
 
void unserialize_open_data (serialize_main_t *m, u8 *data, uword n_data_bytes)
 
void serialize_open_vector (serialize_main_t *m, u8 *vector)
 
voidserialize_close_vector (serialize_main_t *m)
 
void unserialize_open_vector (serialize_main_t *m, u8 *vector)
 
clib_error_tserialize_open_unix_file (serialize_main_t *m, char *file)
 
clib_error_tunserialize_open_unix_file (serialize_main_t *m, char *file)
 
void serialize_open_unix_file_descriptor (serialize_main_t *m, int fd)
 
void unserialize_open_unix_file_descriptor (serialize_main_t *m, int fd)
 
clib_error_tserialize (serialize_main_t *m,...)
 
clib_error_tunserialize (serialize_main_t *m,...)
 
clib_error_tva_serialize (serialize_main_t *m, va_list *va)
 
void serialize_magic (serialize_main_t *m, void *magic, u32 magic_bytes)
 
void unserialize_check_magic (serialize_main_t *m, void *magic, u32 magic_bytes)
 

Variables

serialize_function_t serialize_64
 
serialize_function_t unserialize_64
 
serialize_function_t serialize_32
 
serialize_function_t unserialize_32
 
serialize_function_t serialize_16
 
serialize_function_t unserialize_16
 
serialize_function_t serialize_8
 
serialize_function_t unserialize_8
 
serialize_function_t serialize_f64
 
serialize_function_t unserialize_f64
 
serialize_function_t serialize_f32
 
serialize_function_t unserialize_f32
 
serialize_function_t serialize_vec_8
 
serialize_function_t unserialize_vec_8
 
serialize_function_t serialize_vec_16
 
serialize_function_t unserialize_vec_16
 
serialize_function_t serialize_vec_32
 
serialize_function_t unserialize_vec_32
 
serialize_function_t serialize_vec_64
 
serialize_function_t unserialize_vec_64
 
serialize_function_t serialize_vector
 
serialize_function_t unserialize_vector
 
serialize_function_t unserialize_aligned_vector
 
serialize_function_t serialize_pool
 
serialize_function_t unserialize_pool
 
serialize_function_t unserialize_aligned_pool
 
serialize_function_t serialize_heap
 
serialize_function_t unserialize_heap
 

Macro Definition Documentation

#define pool_serialize (   m,
  v,
 
)    serialize ((m), serialize_pool, (v), sizeof ((v)[0]), (f))

Definition at line 379 of file serialize.h.

#define pool_unserialize (   m,
  v,
 
)    unserialize ((m), unserialize_pool, (v), sizeof ((*(v))[0]), (f))

Definition at line 382 of file serialize.h.

#define pool_unserialize_aligned (   m,
  v,
  a,
 
)    unserialize ((m), unserialize_aligned_pool, (v), sizeof ((*(v))[0]), (a), (f))

Definition at line 385 of file serialize.h.

#define SERIALIZE_END_OF_STREAM   (1 << 0)

Definition at line 71 of file serialize.h.

#define serialize_error_return (   m,
  args... 
)    serialize_error (&(m)->header, clib_error_return (0, args))

Definition at line 103 of file serialize.h.

#define SERIALIZE_FLAG_IS_READ   (1 << 0)

Definition at line 110 of file serialize.h.

#define SERIALIZE_FLAG_IS_WRITE   (1 << 1)

Definition at line 111 of file serialize.h.

#define vec_serialize (   m,
  v,
 
)    serialize ((m), serialize_vector, (v), sizeof ((v)[0]), (f))

Definition at line 367 of file serialize.h.

#define vec_unserialize (   m,
  v,
 
)    unserialize ((m), unserialize_vector, (v), sizeof ((*(v))[0]), (f))

Definition at line 370 of file serialize.h.

#define vec_unserialize_aligned (   m,
  v,
 
)    unserialize ((m), unserialize_aligned_vector, (v), sizeof ((*(v))[0]), (f))

Definition at line 373 of file serialize.h.

Typedef Documentation

typedef void( serialize_data_function_t) (struct serialize_main_header_t *h, struct serialize_stream_t *s)

Definition at line 50 of file serialize.h.

typedef void( serialize_function_t) (serialize_main_t *m, va_list *va)

Definition at line 154 of file serialize.h.

Function Documentation

clib_error_t* serialize ( serialize_main_t m,
  ... 
)

Definition at line 627 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_bitmap ( serialize_main_t m,
uword b 
)

Definition at line 323 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_close ( serialize_main_t m)

Definition at line 822 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* serialize_close_vector ( serialize_main_t m)

Definition at line 858 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_cstring ( serialize_main_t m,
char *  string 
)

Definition at line 135 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void serialize_error ( serialize_main_header_t m,
clib_error_t error 
)

Definition at line 100 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* serialize_get ( serialize_main_t m,
uword  n_bytes 
)

Definition at line 161 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void serialize_integer ( serialize_main_t m,
u64  x,
u32  n_bytes 
)

Definition at line 165 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline uword serialize_is_end_of_stream ( serialize_main_t m)

Definition at line 146 of file serialize.h.

+ Here is the call graph for this function:

always_inline void serialize_likely_small_signed_integer ( serialize_main_t m,
i64  s 
)

Definition at line 270 of file serialize.h.

+ Here is the call graph for this function:

always_inline void serialize_likely_small_unsigned_integer ( serialize_main_t m,
u64  x 
)

Definition at line 198 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_magic ( serialize_main_t m,
void magic,
u32  magic_bytes 
)

Definition at line 580 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void serialize_multiple ( serialize_main_t m,
void data,
uword  n_data_bytes,
uword  data_stride,
uword  n_data 
)

Definition at line 317 of file serialize.h.

+ Here is the call graph for this function:

void serialize_multiple_1 ( serialize_main_t m,
void data,
uword  data_stride,
uword  n_data 
)

Definition at line 873 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_multiple_2 ( serialize_main_t m,
void data,
uword  data_stride,
uword  n_data 
)

Definition at line 907 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_multiple_4 ( serialize_main_t m,
void data,
uword  data_stride,
uword  n_data 
)

Definition at line 941 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_open_data ( serialize_main_t m,
u8 data,
uword  n_data_bytes 
)

Definition at line 828 of file serialize.c.

+ Here is the caller graph for this function:

clib_error_t* serialize_open_unix_file ( serialize_main_t m,
char *  file 
)

Definition at line 1157 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_open_unix_file_descriptor ( serialize_main_t m,
int  fd 
)

Definition at line 1136 of file serialize.c.

+ Here is the call graph for this function:

void serialize_open_vector ( serialize_main_t m,
u8 vector 
)

Definition at line 849 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* serialize_read_write_not_inline ( serialize_main_header_t m,
serialize_stream_t s,
uword  n_bytes,
uword  flags 
)

Definition at line 796 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void serialize_set_end_of_stream ( serialize_main_t m)

Definition at line 142 of file serialize.h.

+ Here is the call graph for this function:

always_inline uword serialize_stream_is_end_of_stream ( serialize_stream_t s)

Definition at line 83 of file serialize.h.

+ Here is the caller graph for this function:

always_inline void* serialize_stream_read_write ( serialize_main_header_t header,
serialize_stream_t s,
uword  n_bytes,
uword  flags 
)

Definition at line 114 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void serialize_stream_set_end_of_stream ( serialize_stream_t s)

Definition at line 79 of file serialize.h.

+ Here is the caller graph for this function:

clib_error_t* unserialize ( serialize_main_t m,
  ... 
)

Definition at line 639 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword* unserialize_bitmap ( serialize_main_t m)

Definition at line 340 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_check_magic ( serialize_main_t m,
void magic,
u32  magic_bytes 
)

Definition at line 588 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_close ( serialize_main_t m)

Definition at line 825 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_cstring ( serialize_main_t m,
char **  string 
)

Definition at line 148 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* unserialize_get ( serialize_main_t m,
uword  n_bytes 
)

Definition at line 157 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void unserialize_integer ( serialize_main_t m,
void x,
u32  n_bytes 
)

Definition at line 181 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline i64 unserialize_likely_small_signed_integer ( serialize_main_t m)

Definition at line 277 of file serialize.h.

+ Here is the call graph for this function:

always_inline u64 unserialize_likely_small_unsigned_integer ( serialize_main_t m)

Definition at line 234 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void unserialize_multiple ( serialize_main_t m,
void data,
uword  n_data_bytes,
uword  data_stride,
uword  n_data 
)

Definition at line 334 of file serialize.h.

+ Here is the call graph for this function:

void unserialize_multiple_1 ( serialize_main_t m,
void data,
uword  data_stride,
uword  n_data 
)

Definition at line 975 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_multiple_2 ( serialize_main_t m,
void data,
uword  data_stride,
uword  n_data 
)

Definition at line 1009 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_multiple_4 ( serialize_main_t m,
void data,
uword  data_stride,
uword  n_data 
)

Definition at line 1043 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_open_data ( serialize_main_t m,
u8 data,
uword  n_data_bytes 
)

Definition at line 835 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* unserialize_open_unix_file ( serialize_main_t m,
char *  file 
)

Definition at line 1161 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void unserialize_open_unix_file_descriptor ( serialize_main_t m,
int  fd 
)

Definition at line 1139 of file serialize.c.

+ Here is the call graph for this function:

void unserialize_open_vector ( serialize_main_t m,
u8 vector 
)
clib_error_t* va_serialize ( serialize_main_t m,
va_list *  va 
)

Definition at line 606 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

serialize_function_t serialize_16

Definition at line 353 of file serialize.h.

serialize_function_t serialize_32

Definition at line 352 of file serialize.h.

serialize_function_t serialize_64

Definition at line 351 of file serialize.h.

serialize_function_t serialize_8

Definition at line 354 of file serialize.h.

serialize_function_t serialize_f32

Definition at line 356 of file serialize.h.

serialize_function_t serialize_f64

Definition at line 355 of file serialize.h.

serialize_function_t serialize_heap

Definition at line 389 of file serialize.h.

serialize_function_t serialize_pool

Definition at line 377 of file serialize.h.

serialize_function_t serialize_vec_16

Definition at line 360 of file serialize.h.

serialize_function_t serialize_vec_32

Definition at line 361 of file serialize.h.

serialize_function_t serialize_vec_64

Definition at line 362 of file serialize.h.

serialize_function_t serialize_vec_8

Definition at line 359 of file serialize.h.

serialize_function_t serialize_vector

Definition at line 365 of file serialize.h.

serialize_function_t unserialize_16

Definition at line 353 of file serialize.h.

serialize_function_t unserialize_32

Definition at line 352 of file serialize.h.

serialize_function_t unserialize_64

Definition at line 351 of file serialize.h.

serialize_function_t unserialize_8

Definition at line 354 of file serialize.h.

serialize_function_t unserialize_aligned_pool

Definition at line 377 of file serialize.h.

serialize_function_t unserialize_aligned_vector

Definition at line 365 of file serialize.h.

serialize_function_t unserialize_f32

Definition at line 356 of file serialize.h.

serialize_function_t unserialize_f64

Definition at line 355 of file serialize.h.

serialize_function_t unserialize_heap

Definition at line 389 of file serialize.h.

serialize_function_t unserialize_pool

Definition at line 377 of file serialize.h.

serialize_function_t unserialize_vec_16

Definition at line 360 of file serialize.h.

serialize_function_t unserialize_vec_32

Definition at line 361 of file serialize.h.

serialize_function_t unserialize_vec_64

Definition at line 362 of file serialize.h.

serialize_function_t unserialize_vec_8

Definition at line 359 of file serialize.h.

serialize_function_t unserialize_vector

Definition at line 365 of file serialize.h.