FD.io VPP  v19.04.4-rc0-5-ge88582fac
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_clib_file (serialize_main_t *m, char *file)
 
clib_error_tunserialize_open_clib_file (serialize_main_t *m, char *file)
 
void serialize_open_clib_file_descriptor (serialize_main_t *m, int fd)
 
void unserialize_open_clib_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

◆ pool_serialize

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

Definition at line 384 of file serialize.h.

◆ pool_unserialize

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

Definition at line 387 of file serialize.h.

◆ pool_unserialize_aligned

#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.

◆ SERIALIZE_END_OF_STREAM

#define SERIALIZE_END_OF_STREAM   (1 << 0)

Definition at line 72 of file serialize.h.

◆ serialize_error_return

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

Definition at line 112 of file serialize.h.

◆ SERIALIZE_FLAG_IS_READ

#define SERIALIZE_FLAG_IS_READ   (1 << 0)

Definition at line 119 of file serialize.h.

◆ SERIALIZE_FLAG_IS_WRITE

#define SERIALIZE_FLAG_IS_WRITE   (1 << 1)

Definition at line 120 of file serialize.h.

◆ vec_serialize

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

Definition at line 371 of file serialize.h.

◆ vec_unserialize

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

Definition at line 374 of file serialize.h.

◆ vec_unserialize_aligned

#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

◆ serialize_data_function_t

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.

◆ serialize_function_t

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

Definition at line 168 of file serialize.h.

◆ serialize_main_header_t

◆ serialize_stream_t

Function Documentation

◆ serialize()

clib_error_t* serialize ( serialize_main_t m,
  ... 
)

Definition at line 672 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_bitmap()

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:

◆ serialize_close()

void serialize_close ( serialize_main_t m)

Definition at line 870 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_close_vector()

void* serialize_close_vector ( serialize_main_t m)

Definition at line 919 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_cstring()

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:

◆ serialize_error()

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:

◆ serialize_get()

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:

◆ serialize_integer()

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:

◆ serialize_is_end_of_stream()

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:

◆ serialize_likely_small_signed_integer()

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:

◆ serialize_likely_small_unsigned_integer()

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:

◆ serialize_magic()

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

Definition at line 625 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multiple()

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:

◆ serialize_multiple_1()

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

Definition at line 934 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multiple_2()

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

Definition at line 966 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_multiple_4()

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

Definition at line 1003 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_open_clib_file()

clib_error_t* serialize_open_clib_file ( serialize_main_t m,
char *  file 
)

Definition at line 1236 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_open_clib_file_descriptor()

void serialize_open_clib_file_descriptor ( serialize_main_t m,
int  fd 
)

Definition at line 1209 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_open_data()

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

Definition at line 883 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_open_vector()

void serialize_open_vector ( serialize_main_t m,
u8 vector 
)

Definition at line 909 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_read_write_not_inline()

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

Definition at line 842 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize_set_end_of_stream()

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:

◆ serialize_stream_is_end_of_stream()

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:

◆ serialize_stream_read_write()

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:

◆ serialize_stream_set_end_of_stream()

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:

◆ unserialize()

clib_error_t* unserialize ( serialize_main_t m,
  ... 
)

Definition at line 684 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_bitmap()

uword* unserialize_bitmap ( serialize_main_t m)

Definition at line 377 of file serialize.c.

+ Here is the call graph for this function:

◆ unserialize_check_magic()

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

Definition at line 634 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_close()

void unserialize_close ( serialize_main_t m)

Definition at line 877 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_cstring()

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:

◆ unserialize_get()

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:

◆ unserialize_integer()

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:

◆ unserialize_likely_small_signed_integer()

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:

◆ unserialize_likely_small_unsigned_integer()

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:

◆ unserialize_multiple()

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:

◆ unserialize_multiple_1()

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

Definition at line 1040 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_multiple_2()

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

Definition at line 1072 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_multiple_4()

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

Definition at line 1109 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_open_clib_file()

clib_error_t* unserialize_open_clib_file ( serialize_main_t m,
char *  file 
)

Definition at line 1242 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_open_clib_file_descriptor()

void unserialize_open_clib_file_descriptor ( serialize_main_t m,
int  fd 
)

Definition at line 1215 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_open_data()

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

Definition at line 891 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unserialize_open_vector()

void unserialize_open_vector ( serialize_main_t m,
u8 vector 
)

◆ va_serialize()

clib_error_t* va_serialize ( serialize_main_t m,
va_list *  va 
)

Definition at line 651 of file serialize.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ serialize_16

serialize_function_t serialize_16

Definition at line 356 of file serialize.h.

◆ serialize_32

serialize_function_t serialize_32

Definition at line 355 of file serialize.h.

◆ serialize_64

serialize_function_t serialize_64

Definition at line 354 of file serialize.h.

◆ serialize_8

serialize_function_t serialize_8

Definition at line 357 of file serialize.h.

◆ serialize_f32

serialize_function_t serialize_f32

Definition at line 359 of file serialize.h.

◆ serialize_f64

serialize_function_t serialize_f64

Definition at line 358 of file serialize.h.

◆ serialize_heap

serialize_function_t serialize_heap

Definition at line 394 of file serialize.h.

◆ serialize_pool

serialize_function_t serialize_pool

Definition at line 381 of file serialize.h.

◆ serialize_vec_16

serialize_function_t serialize_vec_16

Definition at line 363 of file serialize.h.

◆ serialize_vec_32

serialize_function_t serialize_vec_32

Definition at line 364 of file serialize.h.

◆ serialize_vec_64

serialize_function_t serialize_vec_64

Definition at line 365 of file serialize.h.

◆ serialize_vec_8

serialize_function_t serialize_vec_8

Definition at line 362 of file serialize.h.

◆ serialize_vector

serialize_function_t serialize_vector

Definition at line 368 of file serialize.h.

◆ unserialize_16

serialize_function_t unserialize_16

Definition at line 356 of file serialize.h.

◆ unserialize_32

serialize_function_t unserialize_32

Definition at line 355 of file serialize.h.

◆ unserialize_64

serialize_function_t unserialize_64

Definition at line 354 of file serialize.h.

◆ unserialize_8

serialize_function_t unserialize_8

Definition at line 357 of file serialize.h.

◆ unserialize_aligned_pool

serialize_function_t unserialize_aligned_pool

Definition at line 381 of file serialize.h.

◆ unserialize_aligned_vector

serialize_function_t unserialize_aligned_vector

Definition at line 368 of file serialize.h.

◆ unserialize_f32

serialize_function_t unserialize_f32

Definition at line 359 of file serialize.h.

◆ unserialize_f64

serialize_function_t unserialize_f64

Definition at line 358 of file serialize.h.

◆ unserialize_heap

serialize_function_t unserialize_heap

Definition at line 394 of file serialize.h.

◆ unserialize_pool

serialize_function_t unserialize_pool

Definition at line 381 of file serialize.h.

◆ unserialize_vec_16

serialize_function_t unserialize_vec_16

Definition at line 363 of file serialize.h.

◆ unserialize_vec_32

serialize_function_t unserialize_vec_32

Definition at line 364 of file serialize.h.

◆ unserialize_vec_64

serialize_function_t unserialize_vec_64

Definition at line 365 of file serialize.h.

◆ unserialize_vec_8

serialize_function_t unserialize_vec_8

Definition at line 362 of file serialize.h.

◆ unserialize_vector

serialize_function_t unserialize_vector

Definition at line 368 of file serialize.h.