-always_inline void
-vlib_buffer_init_two_for_free_list (vlib_buffer_t * dst0,
- vlib_buffer_t * dst1,
- vlib_buffer_free_list_t * fl)
-{
- vlib_buffer_t *src = &fl->buffer_init_template;
-
- /* Make sure buffer template is sane. */
- ASSERT (fl->index == vlib_buffer_get_free_list_index (src));
-
- clib_memcpy (STRUCT_MARK_PTR (dst0, template_start),
- STRUCT_MARK_PTR (src, template_start),
- STRUCT_OFFSET_OF (vlib_buffer_t, template_end) -
- STRUCT_OFFSET_OF (vlib_buffer_t, template_start));
-
- clib_memcpy (STRUCT_MARK_PTR (dst1, template_start),
- STRUCT_MARK_PTR (src, template_start),
- STRUCT_OFFSET_OF (vlib_buffer_t, template_end) -
- STRUCT_OFFSET_OF (vlib_buffer_t, template_start));
-
- /* Not in the first 16 octets. */
- dst0->n_add_refs = src->n_add_refs;
- dst1->n_add_refs = src->n_add_refs;
-
- /* Make sure it really worked. */
-#define _(f) ASSERT (dst0->f == src->f); ASSERT( dst1->f == src->f)
- _(current_data);
- _(current_length);
- _(flags);
-#undef _
-
- ASSERT (dst0->total_length_not_including_first_buffer == 0);
- ASSERT (dst1->total_length_not_including_first_buffer == 0);
- ASSERT (dst0->n_add_refs == 0);
- ASSERT (dst1->n_add_refs == 0);
-}
-