FD.io VPP  v17.01.1-3-gc6833f8
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 void( serialize_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 void( serialize_function_t) (serialize_main_t *m, va_list *va)
 

Functions

static void serialize_stream_set_end_of_stream (serialize_stream_t *s)
 
static uword serialize_stream_is_end_of_stream (serialize_stream_t *s)
 
static void serialize_error (serialize_main_header_t *m, clib_error_t *error)
 
void * serialize_read_write_not_inline (serialize_main_header_t *m, serialize_stream_t *s, uword n_bytes, uword flags)
 
static void * serialize_stream_read_write (serialize_main_header_t *header, serialize_stream_t *s, uword n_bytes, uword flags)
 
static void serialize_set_end_of_stream (serialize_main_t *m)
 
static uword serialize_is_end_of_stream (serialize_main_t *m)
 
static void * unserialize_get (serialize_main_t *m, uword n_bytes)
 
static void * serialize_get (serialize_main_t *m, uword n_bytes)
 
static void serialize_integer (serialize_main_t *m, u64 x, u32 n_bytes)
 
static void unserialize_integer (serialize_main_t *m, void *x, u32 n_bytes)
 
static void serialize_likely_small_unsigned_integer (serialize_main_t *m, u64 x)
 
static u64 unserialize_likely_small_unsigned_integer (serialize_main_t *m)
 
static void serialize_likely_small_signed_integer (serialize_main_t *m, i64 s)
 
static 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)
 
static void serialize_multiple (serialize_main_t *m, void *data, uword n_data_bytes, uword data_stride, uword n_data)
 
static 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)
 
void * serialize_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 384 of file serialize.h.

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

Definition at line 387 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 390 of file serialize.h.

#define SERIALIZE_END_OF_STREAM   (1 << 0)

Definition at line 72 of file serialize.h.

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

Definition at line 112 of file serialize.h.

#define SERIALIZE_FLAG_IS_READ   (1 << 0)

Definition at line 119 of file serialize.h.

#define SERIALIZE_FLAG_IS_WRITE   (1 << 1)

Definition at line 120 of file serialize.h.

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

Definition at line 371 of file serialize.h.

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

Definition at line 374 of file serialize.h.

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

Definition at line 377 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 168 of file serialize.h.

Function Documentation

clib_error_t* serialize ( serialize_main_t m,
  ... 
)

Definition at line 671 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 359 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 869 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 918 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 164 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serialize_error ( serialize_main_header_t m,
clib_error_t error 
)
inlinestatic

Definition at line 107 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* serialize_get ( serialize_main_t m,
uword  n_bytes 
)
inlinestatic

Definition at line 178 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serialize_integer ( serialize_main_t m,
u64  x,
u32  n_bytes 
)
inlinestatic

Definition at line 185 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword serialize_is_end_of_stream ( serialize_main_t m)
inlinestatic

Definition at line 157 of file serialize.h.

+ Here is the call graph for this function:

static void serialize_likely_small_signed_integer ( serialize_main_t m,
i64  s 
)
inlinestatic

Definition at line 289 of file serialize.h.

+ Here is the call graph for this function:

static void serialize_likely_small_unsigned_integer ( serialize_main_t m,
u64  x 
)
inlinestatic

Definition at line 218 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 624 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serialize_multiple ( serialize_main_t m,
void *  data,
uword  n_data_bytes,
uword  data_stride,
uword  n_data 
)
inlinestatic

Definition at line 324 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 933 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 965 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 1002 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 882 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 1235 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 1208 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void serialize_open_vector ( serialize_main_t m,
u8 vector 
)

Definition at line 908 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 841 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serialize_set_end_of_stream ( serialize_main_t m)
inlinestatic

Definition at line 151 of file serialize.h.

+ Here is the call graph for this function:

static uword serialize_stream_is_end_of_stream ( serialize_stream_t s)
inlinestatic

Definition at line 87 of file serialize.h.

+ Here is the caller graph for this function:

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

Definition at line 123 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serialize_stream_set_end_of_stream ( serialize_stream_t s)
inlinestatic

Definition at line 81 of file serialize.h.

+ Here is the caller graph for this function:

clib_error_t* unserialize ( serialize_main_t m,
  ... 
)

Definition at line 683 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 377 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 633 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 876 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 178 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* unserialize_get ( serialize_main_t m,
uword  n_bytes 
)
inlinestatic

Definition at line 171 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void unserialize_integer ( serialize_main_t m,
void *  x,
u32  n_bytes 
)
inlinestatic

Definition at line 201 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static i64 unserialize_likely_small_signed_integer ( serialize_main_t m)
inlinestatic

Definition at line 296 of file serialize.h.

+ Here is the call graph for this function:

static u64 unserialize_likely_small_unsigned_integer ( serialize_main_t m)
inlinestatic

Definition at line 254 of file serialize.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void unserialize_multiple ( serialize_main_t m,
void *  data,
uword  n_data_bytes,
uword  data_stride,
uword  n_data 
)
inlinestatic

Definition at line 339 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 1039 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 1071 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 1108 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 890 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 1241 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 1214 of file serialize.c.

+ Here is the call graph for this function:

+ Here is the caller 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 650 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 356 of file serialize.h.

serialize_function_t serialize_32

Definition at line 355 of file serialize.h.

serialize_function_t serialize_64

Definition at line 354 of file serialize.h.

serialize_function_t serialize_8

Definition at line 357 of file serialize.h.

serialize_function_t serialize_f32

Definition at line 359 of file serialize.h.

serialize_function_t serialize_f64

Definition at line 358 of file serialize.h.

serialize_function_t serialize_heap

Definition at line 394 of file serialize.h.

serialize_function_t serialize_pool

Definition at line 381 of file serialize.h.

serialize_function_t serialize_vec_16

Definition at line 363 of file serialize.h.

serialize_function_t serialize_vec_32

Definition at line 364 of file serialize.h.

serialize_function_t serialize_vec_64

Definition at line 365 of file serialize.h.

serialize_function_t serialize_vec_8

Definition at line 362 of file serialize.h.

serialize_function_t serialize_vector

Definition at line 368 of file serialize.h.

serialize_function_t unserialize_16

Definition at line 356 of file serialize.h.

serialize_function_t unserialize_32

Definition at line 355 of file serialize.h.

serialize_function_t unserialize_64

Definition at line 354 of file serialize.h.

serialize_function_t unserialize_8

Definition at line 357 of file serialize.h.

serialize_function_t unserialize_aligned_pool

Definition at line 381 of file serialize.h.

serialize_function_t unserialize_aligned_vector

Definition at line 368 of file serialize.h.

serialize_function_t unserialize_f32

Definition at line 359 of file serialize.h.

serialize_function_t unserialize_f64

Definition at line 358 of file serialize.h.

serialize_function_t unserialize_heap

Definition at line 394 of file serialize.h.

serialize_function_t unserialize_pool

Definition at line 381 of file serialize.h.

serialize_function_t unserialize_vec_16

Definition at line 363 of file serialize.h.

serialize_function_t unserialize_vec_32

Definition at line 364 of file serialize.h.

serialize_function_t unserialize_vec_64

Definition at line 365 of file serialize.h.

serialize_function_t unserialize_vec_8

Definition at line 362 of file serialize.h.

serialize_function_t unserialize_vector

Definition at line 368 of file serialize.h.