47 uword n, n_bytes_to_write;
56 ASSERT (sm->
tx.max_n_data_bytes_per_chain > 0);
58 || sm->
tx.n_total_data_bytes + n_bytes_to_write >
59 sm->
tx.max_n_data_bytes_per_chain)
70 sm->
tx.n_total_data_bytes = 0;
79 sm->
tx.free_list_index);
83 (
"vlib_buffer_alloc_from_free_list fails"));
89 if (n_bytes_to_write > 0)
94 sm->
tx.free_list_index);
98 (
"vlib_buffer_alloc_from_free_list fails"));
99 sm->
tx.n_total_data_bytes += n_bytes_to_write;
146 sm->
rx.ready_one_time_event =
150 sm->
rx.ready_one_time_event);
173 memset (m, 0,
sizeof (m[0]));
183 sm->
tx.n_total_data_bytes = 0;
static void serialize_open_vlib_helper(serialize_main_t *m, vlib_main_t *vm, vlib_serialize_buffer_main_t *sm, uword is_read)
u32 serialize_close_vlib_buffer(serialize_main_t *m)
vlib_node_runtime_t node_runtime
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
static uword clib_fifo_elts(void *v)
static void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
static uword vlib_current_process(vlib_main_t *vm)
serialize_main_header_t header
static void serialize_error(serialize_main_header_t *m, clib_error_t *error)
struct vlib_main_t * vlib_main
static heap_elt_t * last(heap_header_t *h)
static void vlib_serialize_rx(serialize_main_header_t *m, serialize_stream_t *s)
void unserialize_open_vlib_buffer(serialize_main_t *m, vlib_main_t *vm, vlib_serialize_buffer_main_t *sm)
#define VLIB_BUFFER_NEXT_PRESENT
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static uword serialize_stream_is_end_of_stream(serialize_stream_t *s)
void unserialize_close_vlib_buffer(serialize_main_t *m)
#define clib_error_create(args...)
static uword pointer_to_uword(const void *p)
void serialize_open_vlib_buffer(serialize_main_t *m, vlib_main_t *vm, vlib_serialize_buffer_main_t *sm)
struct vlib_serialize_buffer_main_t::@26::@29 rx
#define clib_fifo_sub1(f, e)
u16 current_length
Nbytes between current data and the end of this buffer.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u32 vlib_buffer_free_list_buffer_size(vlib_main_t *vm, u32 free_list_index)
static void clib_fifo_reset(void *v)
#define uword_to_pointer(u, type)
serialize_stream_t stream
static void vlib_serialize_tx(serialize_main_header_t *m, serialize_stream_t *s)
static vlib_process_t * vlib_get_current_process(vlib_main_t *vm)
static uword vlib_process_wait_for_one_time_event(vlib_main_t *vm, uword **data_vector, uword with_type_index)
static uword vlib_process_create_one_time_event(vlib_main_t *vm, uword node_index, uword with_type_opaque)
serialize_data_function_t * data_function
static u32 vlib_buffer_alloc_from_free_list(vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 free_list_index)
Allocate buffers from specific freelist into supplied array.
uword data_function_opaque
u32 next_buffer
Next buffer for this linked-list of buffers.
u32 vlib_buffer_add_data(vlib_main_t *vm, u32 free_list_index, u32 buffer_index, void *data, u32 n_data_bytes)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
struct vlib_serialize_buffer_main_t::@26::@28 tx
static void vlib_buffer_free_one(vlib_main_t *vm, u32 buffer_index)
Free one buffer Shorthand to free a single buffer chain.
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.