COMPONENT vpp-dev
)
+add_definitions(-fvisibility=hidden)
+
##############################################################################
# vppinfra sources
##############################################################################
#include <vppinfra/asm_mips.h>
-uword
+__clib_export uword
clib_backtrace (uword * callers, uword max_callers, uword n_frames_to_skip)
{
u32 *pc;
/* use glibc backtrace for stack trace */
#include <execinfo.h>
-uword
+__clib_export uword
clib_backtrace (uword * callers, uword max_callers, uword n_frames_to_skip)
{
int size;
#include <vppinfra/mem.h>
/* Vector of all bihashes */
-void **clib_all_bihashes;
+__clib_export void **clib_all_bihashes;
static clib_mem_heap_t *clib_all_bihash_heap;
-clib_mem_heap_t *
+__clib_export clib_mem_heap_t *
clib_all_bihash_set_heap (void)
{
if (PREDICT_FALSE (clib_all_bihash_heap == 0))
* Leave it to Beaver to change the size of a bihash
* by making a clone in a stack local and then copying it...
*/
-void
+__clib_export void
clib_bihash_copied (void *dst, void *src)
{
int i;
#define __clib_aligned(x) __attribute__ ((aligned(x)))
#define __clib_section(s) __attribute__ ((section(s)))
#define __clib_warn_unused_result __attribute__ ((warn_unused_result))
+#define __clib_export __attribute__ ((visibility("default")))
#define never_inline __attribute__ ((__noinline__))
_(0x43, 0x0b1, "Marvell", "OCTEON TX2 CN98XX", 1) \
_(0x43, 0x0b2, "Marvell", "OCTEON TX2 CN96XX", 1)
-u8 *
+__clib_export u8 *
format_cpu_uarch (u8 * s, va_list * args)
{
#if __x86_64__
#endif
}
-u8 *
+__clib_export u8 *
format_cpu_model_name (u8 * s, va_list * args)
{
#if __x86_64__
return flag;
}
-u8 *
+__clib_export u8 *
format_cpu_flags (u8 * s, va_list * args)
{
#if defined(__x86_64__)
*sizep = this_seg->size;
}
-CLIB_NOSANITIZE_ADDR
+CLIB_NOSANITIZE_ADDR __clib_export
int mspace_is_heap_object (mspace msp, void *p)
{
msegment *this_seg;
return 0;
}
-CLIB_NOSANITIZE_ADDR
+CLIB_NOSANITIZE_ADDR __clib_export
void* mspace_get_aligned (mspace msp,
unsigned long n_user_data_bytes,
unsigned long align,
return (void *) searchp;
}
-CLIB_NOSANITIZE_ADDR
+CLIB_NOSANITIZE_ADDR __clib_export
void mspace_put (mspace msp, void *p_arg)
{
char *object_header;
mspace_free (msp, p_arg);
}
-CLIB_NOSANITIZE_ADDR
+CLIB_NOSANITIZE_ADDR __clib_export
size_t mspace_usable_size_with_delta (const void *p)
{
size_t usable_size;
#undef _
}
-clib_error_t *
+__clib_export clib_error_t *
elf_get_section_by_name (elf_main_t * em, char *section_name,
elf_section_t ** result)
{
#include <sys/stat.h>
#include <fcntl.h>
-clib_error_t *
+__clib_export clib_error_t *
elf_read_file (elf_main_t * em, char *file_name)
{
int fd;
static clib_elf_main_t clib_elf_main;
-void
+__clib_export void
clib_elf_main_init (char *exec_path)
{
clib_elf_main_t *cem = &clib_elf_main;
}
}
-u8 *
+__clib_export u8 *
format_clib_elf_symbol_with_address (u8 * s, va_list * args)
{
uword address = va_arg (*args, uword);
}
/* Non-inline version. */
-void *
+__clib_export void *
elog_event_data (elog_main_t * em,
elog_event_type_t * type, elog_track_t * track, u64 cpu_time)
{
return l;
}
-word
+__clib_export word
elog_track_register (elog_main_t * em, elog_track_t * t)
{
word l;
return s;
}
-u8 *
+__clib_export u8 *
format_elog_event (u8 * s, va_list * va)
{
elog_main_t *em = va_arg (*va, elog_main_t *);
return format (s, "%s", t->name);
}
-u8 *
+__clib_export u8 *
format_elog_track (u8 * s, va_list * args)
{
elog_main_t *em = va_arg (*args, elog_main_t *);
&em->init_time));
}
-void
+__clib_export void
elog_alloc (elog_main_t * em, u32 n_events)
{
if (em->event_ring)
vec_resize_aligned (em->event_ring, n_events, CLIB_CACHE_LINE_BYTES);
}
-void
+__clib_export void
elog_init (elog_main_t * em, u32 n_events)
{
clib_memset (em, 0, sizeof (em[0]));
}
}
-elog_event_t *
+__clib_export elog_event_t *
elog_peek_events (elog_main_t * em)
{
elog_event_t *e, *f, *es = 0;
}
/* Add a formatted string to the string table. */
-u32
+__clib_export u32
elog_string (elog_main_t * em, char *fmt, ...)
{
u32 offset;
static char *elog_serialize_magic = "elog v0";
-void
+__clib_export void
serialize_elog_main (serialize_main_t * m, va_list * va)
{
elog_main_t *em = va_arg (*va, elog_main_t *);
static clib_error_handler_t *handlers = 0;
-void
+__clib_export void
clib_error_register_handler (clib_error_handler_func_t func, void *arg)
{
clib_error_handler_t h = {.func = func,.arg = arg, };
return msg;
}
-void
+__clib_export void
_clib_error (int how_to_die,
char *function_name, uword line_number, char *fmt, ...)
{
error_exit (1);
}
-clib_error_t *
+__clib_export clib_error_t *
_clib_error_return (clib_error_t * errors,
any code, uword flags, char *where, char *fmt, ...)
{
return errors;
}
-void *
+__clib_export void *
clib_error_free_vector (clib_error_t * errors)
{
clib_error_t *e;
return 0;
}
-u8 *
+__clib_export u8 *
format_clib_error (u8 * s, va_list * va)
{
clib_error_t *errors = va_arg (*va, clib_error_t *);
return s;
}
-clib_error_t *
+__clib_export clib_error_t *
_clib_error_report (clib_error_t * errors)
{
if (errors)
fifo_free (f) frees fifo.
*/
-void *
+__clib_export void *
_clib_fifo_resize (void *v_old, uword n_new_elts, uword elt_bytes)
{
void *v_new, *end, *head;
return f;
}
-u8 *
+__clib_export u8 *
va_format (u8 * s, const char *fmt, va_list * va)
{
const u8 *f = (u8 *) fmt, *g;
return s;
}
-u8 *
+__clib_export u8 *
format (u8 * s, const char *fmt, ...)
{
va_list va;
return s;
}
-word
+__clib_export word
va_fformat (FILE * f, char *fmt, va_list * va)
{
word ret;
return ret;
}
-word
+__clib_export word
fformat (FILE * f, char *fmt, ...)
{
va_list va;
}
#ifdef CLIB_UNIX
-void
+__clib_export void
fformat_append_cr (FILE * ofp, const char *fmt, ...)
{
va_list va;
fformat (ofp, "\n");
}
-word
+__clib_export word
fdformat (int fd, char *fmt, ...)
{
word ret;
return indent;
}
-#define _(f) u8 * f (u8 * s, va_list * va)
+#define _(f) __clib_export u8 * f (u8 * s, va_list * va)
/* Standard user-defined formats. */
_(format_vec32);
}
#endif
-uword
+__clib_export uword
hash_memory (void *p, word n_bytes, uword state)
{
uword *q = p;
}
/* Fetch value of key. */
-uword *
+__clib_export uword *
_hash_get (void *v, uword key)
{
hash_t *h = hash_header (v);
return &p->value[0];
}
-hash_pair_t *
+__clib_export hash_pair_t *
_hash_get_pair (void *v, uword key)
{
return lookup (v, key, GET, 0, 0);
}
/* Remove key from table. */
-void *
+__clib_export void *
_hash_unset (void *v, uword key, void *old_value)
{
hash_t *h;
return v;
}
-void *
+__clib_export void *
_hash_create (uword elts, hash_t * h_user)
{
hash_t *h;
return v;
}
-void *
+__clib_export void *
_hash_free (void *v)
{
hash_t *h = hash_header (v);
return hash_resize_internal (old, new_size, 1);
}
-void *
+__clib_export void *
hash_dup (void *old)
{
return hash_resize_internal (old, vec_len (old), 0);
}
-void *
+__clib_export void *
_hash_set3 (void *v, uword key, void *value, void *old_value)
{
hash_t *h;
return v;
}
-uword
+__clib_export uword
vec_key_sum (hash_t * h, uword key)
{
void *v = uword_to_pointer (key, void *);
return hash_memory (v, vec_len (v) * h->user, 0);
}
-uword
+__clib_export uword
vec_key_equal (hash_t * h, uword key1, uword key2)
{
void *v1 = uword_to_pointer (key1, void *);
return l1 == l2 && 0 == memcmp (v1, v2, l1 * h->user);
}
-u8 *
+__clib_export u8 *
vec_key_format_pair (u8 * s, va_list * args)
{
void *CLIB_UNUSED (user_arg) = va_arg (*args, void *);
return s;
}
-uword
+__clib_export uword
mem_key_sum (hash_t * h, uword key)
{
uword *v = uword_to_pointer (key, void *);
return hash_memory (v, h->user, 0);
}
-uword
+__clib_export uword
mem_key_equal (hash_t * h, uword key1, uword key2)
{
void *v1 = uword_to_pointer (key1, void *);
return s;
}
-uword
+__clib_export uword
hash_bytes (void *v)
{
uword i, bytes;
return p ? 1 : 0;
}
-uword
+__clib_export uword
unformat_hash_vec_string (unformat_input_t * input, va_list * va)
{
return unformat_hash_string_internal (input, va, /* is_vec */ 1);
}
-uword
+__clib_export uword
unformat_hash_string (unformat_input_t * input, va_list * va)
{
return unformat_hash_string_internal (input, va, /* is_vec */ 0);
combine_free_blocks (v, p, n);
}
-void *
+__clib_export void *
_heap_alloc (void *v,
uword size,
uword align,
return v;
}
-void
+__clib_export void
heap_dealloc (void *v, uword handle)
{
heap_header_t *h = heap_header (v);
return heap_elt_size (v, elt_at (h, handle));
}
-void *
+__clib_export void *
_heap_free (void *v)
{
heap_header_t *h = heap_header (v);
#define MAP_FIXED_NOREPLACE 0x100000
#endif
-uword
+__clib_export uword
clib_mem_get_default_hugepage_size (void)
{
unformat_input_t input;
munmap (va, page_size);
}
-u64
+__clib_export u64
clib_mem_get_fd_page_size (int fd)
{
struct stat st = { 0 };
return st.st_blksize;
}
-clib_mem_page_sz_t
+__clib_export clib_mem_page_sz_t
clib_mem_get_fd_log2_page_size (int fd)
{
uword page_size = clib_mem_get_fd_page_size (fd);
return page_size ? min_log2 (page_size) : CLIB_MEM_PAGE_SZ_UNKNOWN;
}
-void
+__clib_export void
clib_mem_vm_randomize_va (uword * requested_va,
clib_mem_page_sz_t log2_page_size)
{
return fd;
}
-int
+__clib_export int
clib_mem_vm_create_fd (clib_mem_page_sz_t log2_page_size, char *fmt, ...)
{
clib_mem_main_t *mm = &clib_mem_main;
return (uword) base + sys_page_sz;
}
-clib_mem_vm_map_hdr_t *
+__clib_export clib_mem_vm_map_hdr_t *
clib_mem_vm_get_next_map_hdr (clib_mem_vm_map_hdr_t * hdr)
{
clib_mem_main_t *mm = &clib_mem_main;
return base;
}
-int
+__clib_export int
clib_mem_vm_unmap (void *base)
{
clib_mem_main_t *mm = &clib_mem_main;
return 0;
}
-void
+__clib_export void
clib_mem_get_page_stats (void *start, clib_mem_page_sz_t log2_page_size,
uword n_pages, clib_mem_page_stats_t * stats)
{
}
-u64 *
+__clib_export u64 *
clib_mem_vm_get_paddr (void *mem, clib_mem_page_sz_t log2_page_size,
int n_pages)
{
return r;
}
-int
+__clib_export int
clib_mem_set_numa_affinity (u8 numa_node, int force)
{
clib_mem_main_t *mm = &clib_mem_main;
return CLIB_MEM_ERROR;
}
-int
+__clib_export int
clib_mem_set_default_numa_affinity ()
{
clib_mem_main_t *mm = &clib_mem_main;
#include <fcntl.h>
#include <dirent.h>
-clib_error_t *
+__clib_export clib_error_t *
clib_sysfs_write (char *file_name, char *fmt, ...)
{
u8 *s;
return error;
}
-clib_error_t *
+__clib_export clib_error_t *
clib_sysfs_read (char *file_name, char *fmt, ...)
{
unformat_input_t input;
return 0;
}
-u8 *
+__clib_export u8 *
clib_sysfs_link_to_name (char *link)
{
char *p, buffer[64];
return (*fp) (mm, complain);
}
-int
+__clib_export int
clib_macro_unset (clib_macro_main_t * mm, char *name)
{
hash_pair_t *p;
return 0;
}
-int
+__clib_export int
clib_macro_set_value (clib_macro_main_t * mm, char *name, char *value)
{
u8 *key_copy, *value_copy;
* eval: takes a string, returns a vector.
* looks up $foobar in the variable table.
*/
-i8 *
+__clib_export i8 *
clib_macro_eval (clib_macro_main_t * mm, i8 * s, i32 complain, u16 level,
u16 max_level)
{
return (rv);
}
-void
+__clib_export void
clib_macro_add_builtin (clib_macro_main_t * mm, char *name, void *eval_fn)
{
hash_set_mem (mm->the_builtin_eval_hash, name, (uword) eval_fn);
}
#endif
-void
+__clib_export void
clib_macro_init (clib_macro_main_t * mm)
{
if (mm->the_builtin_eval_hash != 0)
#endif
}
-void
+__clib_export void
clib_macro_free (clib_macro_main_t * mm)
{
hash_pair_t *p;
}
-u8 *
+__clib_export u8 *
format_clib_macro_main (u8 * s, va_list * args)
{
clib_macro_main_t *mm = va_arg (*args, clib_macro_main_t *);
#include <vppinfra/format.h>
#include <vppinfra/clib_error.h>
-clib_mem_main_t clib_mem_main;
+__clib_export clib_mem_main_t clib_mem_main;
-void *
+__clib_export void *
clib_mem_vm_map (void *base, uword size, clib_mem_page_sz_t log2_page_sz,
char *fmt, ...)
{
return rv;
}
-void *
+__clib_export void *
clib_mem_vm_map_stack (uword size, clib_mem_page_sz_t log2_page_sz,
char *fmt, ...)
{
return rv;
}
-void *
+__clib_export void *
clib_mem_vm_map_shared (void *base, uword size, int fd, uword offset,
char *fmt, ...)
{
return h;
}
-void *
+__clib_export void *
clib_mem_init (void *memory, uword memory_size)
{
return clib_mem_init_internal (memory, memory_size,
CLIB_MEM_PAGE_SZ_DEFAULT);
}
-void *
+__clib_export void *
clib_mem_init_with_page_size (uword memory_size,
clib_mem_page_sz_t log2_page_sz)
{
return clib_mem_init_internal (0, memory_size, log2_page_sz);
}
-void *
+__clib_export void *
clib_mem_init_thread_safe (void *memory, uword memory_size)
{
return clib_mem_init_internal (memory, memory_size,
CLIB_MEM_PAGE_SZ_DEFAULT);
}
-void
+__clib_export void
clib_mem_destroy (void)
{
mheap_trace_main_t *tm = &mheap_trace_main;
return s;
}
-u8 *
+__clib_export u8 *
format_clib_mem_heap (u8 * s, va_list * va)
{
clib_mem_heap_t *heap = va_arg (*va, clib_mem_heap_t *);
return s;
}
-void
+__clib_export void
clib_mem_get_heap_usage (clib_mem_heap_t * heap, clib_mem_usage_t * usage)
{
struct dlmallinfo mi = mspace_mallinfo (heap->mspace);
/* Call serial number for debugger breakpoints. */
uword clib_mem_validate_serial = 0;
-void
+__clib_export void
mheap_trace (clib_mem_heap_t * h, int enable)
{
(void) mspace_enable_disable_trace (h->mspace, enable);
mheap_trace_main_free (&mheap_trace_main);
}
-void
+__clib_export void
clib_mem_trace (int enable)
{
mheap_trace_main_t *tm = &mheap_trace_main;
return mspace_is_traced (h->mspace);
}
-uword
+__clib_export uword
clib_mem_trace_enable_disable (uword enable)
{
uword rv;
return rv;
}
-clib_mem_heap_t *
+__clib_export clib_mem_heap_t *
clib_mem_create_heap (void *base, uword size, int is_locked, char *fmt, ...)
{
clib_mem_page_sz_t log2_page_sz = clib_mem_get_log2_page_size ();
return h;
}
-void
+__clib_export void
clib_mem_destroy_heap (clib_mem_heap_t * h)
{
mheap_trace_main_t *tm = &mheap_trace_main;
clib_mem_vm_unmap (h->base);
}
-uword
+__clib_export uword
clib_mem_get_heap_free_space (clib_mem_heap_t * h)
{
struct dlmallinfo dlminfo = mspace_mallinfo (h->mspace);
return dlminfo.fordblks;
}
-void *
+__clib_export void *
clib_mem_get_heap_base (clib_mem_heap_t * h)
{
return h->base;
}
-uword
+__clib_export uword
clib_mem_get_heap_size (clib_mem_heap_t * heap)
{
return heap->size;
h->user = pointer_to_uword (mh);
}
-void
+__clib_export void
mhash_init (mhash_t * h, uword n_value_bytes, uword n_key_bytes)
{
static struct
return ~0;
}
-hash_pair_t *
+__clib_export hash_pair_t *
mhash_get_pair (mhash_t * h, const void *key)
{
uword ikey;
vec_header_t vec;
} mhash_string_key_t;
-uword
+__clib_export uword
mhash_set_mem (mhash_t * h, void *key, uword * new_value, uword * old_value)
{
u8 *k;
return ikey;
}
-uword
+__clib_export uword
mhash_unset (mhash_t * h, void *key, uword * old_value)
{
hash_pair_t *p;
* @return rc - clib_error_t
*
*/
-clib_error_t *
+__clib_export clib_error_t *
mpcap_close (mpcap_main_t * pm)
{
u64 actual_size = pm->current_va - pm->file_baseva;
* @return rc - clib_error_t
*
*/
-clib_error_t *
+__clib_export clib_error_t *
mpcap_init (mpcap_main_t * pm)
{
mpcap_file_header_t *fh;
* @return rc - clib_error_t
*
*/
-clib_error_t *
+__clib_export clib_error_t *
pcap_close (pcap_main_t * pm)
{
close (pm->file_descriptor);
* @return rc - clib_error_t
*
*/
-clib_error_t *
+__clib_export clib_error_t *
pcap_write (pcap_main_t * pm)
{
clib_error_t *error = 0;
* @return rc - clib_error_t
*
*/
-clib_error_t *
+__clib_export clib_error_t *
pcap_read (pcap_main_t * pm)
{
clib_error_t *error = 0;
return 0;
}
-int
+__clib_export int
clib_pmalloc_init (clib_pmalloc_main_t * pm, uword base_addr, uword size)
{
uword base, pagesize;
return 0;
}
-void *
+__clib_export void *
clib_pmalloc_create_shared_arena (clib_pmalloc_main_t * pm, char *name,
uword size, u32 log2_page_sz, u32 numa_node)
{
return 0;
}
-void *
+__clib_export void *
clib_pmalloc_alloc_aligned_on_numa (clib_pmalloc_main_t * pm, uword size,
uword align, u32 numa_node)
{
return 1;
}
-void
+__clib_export void
clib_pmalloc_free (clib_pmalloc_main_t * pm, void *va)
{
clib_pmalloc_page_t *pp;
return s;
}
-u8 *
+__clib_export u8 *
format_pmalloc (u8 * s, va_list * va)
{
clib_pmalloc_main_t *pm = va_arg (*va, clib_pmalloc_main_t *);
return s;
}
-u8 *
+__clib_export u8 *
format_pmalloc_map (u8 * s, va_list * va)
{
clib_pmalloc_main_t *pm = va_arg (*va, clib_pmalloc_main_t *);
#include <vppinfra/pool.h>
-void
+__clib_export void
_pool_init_fixed (void **pool_ptr, u32 elt_size, u32 max_elts)
{
u8 *mmap_base;
#include <vppinfra/ptclosure.h>
-u8 **
+__clib_export u8 **
clib_ptclosure_alloc (int n)
{
u8 **rv = 0;
return rv;
}
-void
+__clib_export void
clib_ptclosure_free (u8 ** ptc)
{
u8 *row;
*
*/
-u8 **
+__clib_export u8 **
clib_ptclosure (u8 ** orig)
{
int i, j, k;
#include <vppinfra/random_buffer.h>
/* Fill random buffer. */
-void
+__clib_export void
clib_random_buffer_fill (clib_random_buffer_t * b, uword n_words)
{
uword *w, n = n_words;
while (n > 0);
}
-void
+__clib_export void
clib_random_buffer_init (clib_random_buffer_t * b, uword seed)
{
uword i, j;
rb_tree_fixup_inline (rt, y, z);
}
-rb_node_index_t
+__clib_export rb_node_index_t
rb_tree_add (rb_tree_t * rt, u32 key)
{
rb_node_t *n;
return rb_node_index (rt, n);
}
-rb_node_index_t
+__clib_export rb_node_index_t
rb_tree_add2 (rb_tree_t * rt, u32 key, uword opaque)
{
rb_node_t *n;
return rb_node_index (rt, n);
}
-rb_node_index_t
+__clib_export rb_node_index_t
rb_tree_add_custom (rb_tree_t * rt, u32 key, uword opaque, rb_tree_lt_fn ltfn)
{
rb_node_index_t yi = 0, xi = rt->root;
return rb_node_index (rt, z);
}
-rb_node_t *
+__clib_export rb_node_t *
rb_tree_search_subtree (rb_tree_t * rt, rb_node_t * x, u32 key)
{
while (rb_node_index (rt, x) != RBTREE_TNIL_INDEX && key != x->key)
return x;
}
-rb_node_t *
+__clib_export rb_node_t *
rb_tree_search_subtree_custom (rb_tree_t * rt, rb_node_t * x, u32 key,
rb_tree_lt_fn ltfn)
{
return x;
}
-rb_node_t *
+__clib_export rb_node_t *
rb_tree_min_subtree (rb_tree_t * rt, rb_node_t * x)
{
while (x->left != RBTREE_TNIL_INDEX)
return x;
}
-rb_node_t *
+__clib_export rb_node_t *
rb_tree_max_subtree (rb_tree_t * rt, rb_node_t * x)
{
while (x->right != RBTREE_TNIL_INDEX)
return x;
}
-rb_node_t *
+__clib_export rb_node_t *
rb_tree_successor (rb_tree_t * rt, rb_node_t * x)
{
rb_node_t *y;
return y;
}
-rb_node_t *
+__clib_export rb_node_t *
rb_tree_predecessor (rb_tree_t * rt, rb_node_t * x)
{
rb_node_t *y;
x->color = RBTREE_BLACK;
}
-void
+__clib_export void
rb_tree_del_node (rb_tree_t * rt, rb_node_t * z)
{
rb_tree_del_node_internal (rt, z);
pool_put (rt->nodes, z);
}
-void
+__clib_export void
rb_tree_del (rb_tree_t * rt, u32 key)
{
rb_node_t *n;
rb_tree_del_node (rt, n);
}
-void
+__clib_export void
rb_tree_del_custom (rb_tree_t * rt, u32 key, rb_tree_lt_fn ltfn)
{
rb_node_t *n;
rb_tree_del_node (rt, n);
}
-u32
+__clib_export u32
rb_tree_n_nodes (rb_tree_t * rt)
{
return pool_elts (rt->nodes);
}
-void
+__clib_export void
rb_tree_free_nodes (rb_tree_t * rt)
{
pool_free (rt->nodes);
rt->root = RBTREE_TNIL_INDEX;
}
-void
+__clib_export void
rb_tree_init (rb_tree_t * rt)
{
rb_node_t *tnil;
tnil->color = RBTREE_BLACK;
}
-int
+__clib_export int
rb_tree_is_init (rb_tree_t * rt)
{
if (pool_elts (rt->nodes) == 0)
*x = y.f;
}
-void
+__clib_export void
serialize_cstring (serialize_main_t * m, char *s)
{
u32 len = s ? strlen (s) : 0;
}
}
-void
+__clib_export void
unserialize_cstring (serialize_main_t * m, char **s)
{
char *p, *r = 0;
#define SERIALIZE_VECTOR_CHUNK_SIZE 64
-void
+__clib_export void
serialize_vector (serialize_main_t * m, va_list * va)
{
void *vec = va_arg (*va, void *);
f);
}
-void
+__clib_export void
unserialize_vector (serialize_main_t * m, va_list * va)
{
void **vec = va_arg (*va, void **);
goto bad;
}
-clib_error_t *
+__clib_export clib_error_t *
va_serialize (serialize_main_t * sm, va_list * va)
{
serialize_main_header_t *m = &sm->header;
return error;
}
-clib_error_t *
+__clib_export clib_error_t *
serialize (serialize_main_t * m, ...)
{
clib_error_t *error;
return error;
}
-clib_error_t *
+__clib_export clib_error_t *
unserialize (serialize_main_t * m, ...)
{
clib_error_t *error;
return vec_elt_at_index (s->overflow_buffer, cur_oi);
}
-void *
+__clib_export void *
serialize_read_write_not_inline (serialize_main_header_t * m,
serialize_stream_t * s,
uword n_bytes, uword flags)
vec_free (s->overflow_buffer);
}
-void
+__clib_export void
serialize_close (serialize_main_t * m)
{
serialize_read_write_close (&m->header, &m->stream,
SERIALIZE_FLAG_IS_WRITE);
}
-void
+__clib_export void
unserialize_close (serialize_main_t * m)
{
serialize_read_write_close (&m->header, &m->stream, SERIALIZE_FLAG_IS_READ);
}
-void
+__clib_export void
serialize_open_data (serialize_main_t * m, u8 * data, uword n_data_bytes)
{
clib_memset (m, 0, sizeof (m[0]));
m->stream.n_buffer_bytes = n_data_bytes;
}
-void
+__clib_export void
unserialize_open_data (serialize_main_t * m, u8 * data, uword n_data_bytes)
{
serialize_open_data (m, data, n_data_bytes);
}
}
-void
+__clib_export void
serialize_open_vector (serialize_main_t * m, u8 * vector)
{
clib_memset (m, 0, sizeof (m[0]));
m->stream.n_buffer_bytes = vec_len (vector);
}
-void *
+__clib_export void *
serialize_close_vector (serialize_main_t * m)
{
serialize_stream_t *s = &m->stream;
m->stream.data_function_opaque = fd;
}
-void
+__clib_export void
serialize_open_clib_file_descriptor (serialize_main_t * m, int fd)
{
serialize_open_clib_file_descriptor_helper (m, fd, /* is_read */ 0);
}
-void
+__clib_export void
unserialize_open_clib_file_descriptor (serialize_main_t * m, int fd)
{
serialize_open_clib_file_descriptor_helper (m, fd, /* is_read */ 1);
return 0;
}
-clib_error_t *
+__clib_export clib_error_t *
serialize_open_clib_file (serialize_main_t * m, char *file)
{
return serialize_open_clib_file_helper (m, file, /* is_read */ 0);
}
-clib_error_t *
+__clib_export clib_error_t *
unserialize_open_clib_file (serialize_main_t * m, char *file)
{
return serialize_open_clib_file_helper (m, file, /* is_read */ 1);
#include <vppinfra/format.h>
#include <vppinfra/error.h>
-void
+__clib_export void
clib_socket_tx_add_formatted (clib_socket_t * s, char *fmt, ...)
{
va_list va;
s->recvmsg_func = default_socket_recvmsg;
}
-clib_error_t *
+__clib_export clib_error_t *
clib_socket_init (clib_socket_t * s)
{
union
return error;
}
-clib_error_t *
+__clib_export clib_error_t *
clib_socket_accept (clib_socket_t * server, clib_socket_t * client)
{
clib_error_t *err = 0;
}
/* Unparse memory size e.g. 100, 100k, 100m, 100g. */
-u8 *
+__clib_export u8 *
format_memory_size (u8 * s, va_list * va)
{
uword size = va_arg (*va, uword);
}
/* Parse memory size e.g. 100, 100k, 100m, 100g. */
-uword
+__clib_export uword
unformat_memory_size (unformat_input_t * input, va_list * va)
{
uword amount, shift, c;
}
/* Unparse memory page size e.g. 4K, 2M */
-u8 *
+__clib_export u8 *
format_log2_page_size (u8 * s, va_list * va)
{
clib_mem_page_sz_t log2_page_sz = va_arg (*va, clib_mem_page_sz_t);
}
/* Parse memory page size e.g. 4K, 2M */
-uword
+__clib_export uword
unformat_log2_page_size (unformat_input_t * input, va_list * va)
{
uword amount, shift, c;
/* Format c identifier: e.g. a_name -> "a name".
Works for both vector names and null terminated c strings. */
-u8 *
+__clib_export u8 *
format_c_identifier (u8 * s, va_list * va)
{
u8 *id = va_arg (*va, u8 *);
return s;
}
-u8 *
+__clib_export u8 *
format_hexdump (u8 * s, va_list * args)
{
u8 *data = va_arg (*args, u8 *);
}
}
-void
+__clib_export void
clib_c11_violation (const char *s)
{
_clib_error (CLIB_ERROR_WARNING, (char *) __FUNCTION__, 0, (char *) s);
* EINVAL runtime constraint error
*
*/
-errno_t
+__clib_export errno_t
memcpy_s (void *__restrict__ dest, rsize_t dmax,
const void *__restrict__ src, rsize_t n)
{
* EINVAL runtime constraint error
*
*/
-errno_t
+__clib_export errno_t
memset_s (void *s, rsize_t smax, int c, rsize_t n)
{
return memset_s_inline (s, smax, c, n);
* EINVAL runtime constraint error
*
*/
-errno_t
+__clib_export errno_t
memcmp_s (const void *s1, rsize_t s1max, const void *s2, rsize_t s2max,
int *diff)
{
* EINVAL runtime constraint error
*
*/
-errno_t
+__clib_export errno_t
strcmp_s (const char *s1, rsize_t s1max, const char *s2, int *indicator)
{
return strcmp_s_inline (s1, s1max, s2, indicator);
* EINVAL runtime constraint error
*
*/
-errno_t
+__clib_export errno_t
strncmp_s (const char *s1, rsize_t s1max, const char *s2, rsize_t n,
int *indicator)
{
* EINVAL runtime constraint error
*
*/
-errno_t
+__clib_export errno_t
strcpy_s (char *__restrict__ dest, rsize_t dmax, const char *__restrict__ src)
{
return strcpy_s_inline (dest, dmax, src);
* dest is null terminated.
*
*/
-errno_t
+__clib_export errno_t
strncpy_s (char *__restrict__ dest, rsize_t dmax,
const char *__restrict__ src, rsize_t n)
{
* EINVAL runtime constraint error
*
*/
-errno_t
+__clib_export errno_t
strcat_s (char *__restrict__ dest, rsize_t dmax, const char *__restrict__ src)
{
return strcat_s_inline (dest, dmax, src);
* dest is null terminated.
*
*/
-errno_t
+__clib_export errno_t
strncat_s (char *__restrict__ dest, rsize_t dmax,
const char *__restrict__ src, rsize_t n)
{
* tok1 = "brevity", tok2 = "is", tok3 = "the", tok4 = "soul", tok5 = "of",
* tok6 = "wit", tok7 = null
*/
-char *
+__clib_export char *
strtok_s (char *__restrict__ s1, rsize_t * __restrict__ s1max,
const char *__restrict__ s2, char **__restrict__ ptr)
{
* more than maxsize or 0 if there is a constraint error
*
*/
-size_t
+__clib_export size_t
strnlen_s (const char *s, size_t maxsize)
{
return strnlen_s_inline (s, maxsize);
* After the above call,
* sub = "failure is not fatal."
*/
-errno_t
+__clib_export errno_t
strstr_s (char *s1, rsize_t s1max, const char *s2, rsize_t s2max,
char **substring)
{
return cpu_freq;
}
-f64
+__clib_export f64
os_cpu_clock_frequency (void)
{
#if defined (__aarch64__)
#endif /* CLIB_UNIX */
/* Initialize time. */
-void
+__clib_export void
clib_time_init (clib_time_t * c)
{
clib_memset (c, 0, sizeof (c[0]));
c->damping_constant = exp (-1.0 / 3.75);
}
-void
+__clib_export void
clib_time_verify_frequency (clib_time_t * c)
{
f64 now_reference, delta_reference, delta_reference_max;
}
-u8 *
+__clib_export u8 *
format_clib_time (u8 * s, va_list * args)
{
clib_time_t *c = va_arg (*args, clib_time_t *);
#include <vppinfra/time_range.h>
-void
+__clib_export void
clib_timebase_init (clib_timebase_t * tb, i32 timezone_offset_in_hours,
clib_timebase_daylight_time_t daylight_type,
clib_time_t * clib_time)
};
-void
+__clib_export void
clib_timebase_time_to_components (f64 now, clib_timebase_component_t * cp)
{
u32 year, month, hours, minutes, seconds, nanoseconds;
cp->fractional_seconds = now;
}
-f64
+__clib_export f64
clib_timebase_components_to_time (clib_timebase_component_t * cp)
{
f64 now = 0;
return (now);
}
-f64
+__clib_export f64
clib_timebase_find_sunday_midnight (f64 start_time)
{
clib_timebase_component_t _c, *cp = &_c;
}
-u8 *
+__clib_export u8 *
format_clib_timebase_time (u8 * s, va_list * args)
{
f64 now = va_arg (*args, f64);
return 1;
}
-uword
+__clib_export uword
unformat_clib_timebase_range_vector (unformat_input_t * input, va_list * args)
{
clib_timebase_range_t **rpp = va_arg (*args, clib_timebase_range_t **);
}
}
-f64
+__clib_export f64
clib_timebase_summer_offset (clib_timebase_t * tb, f64 now)
{
clib_timebase_component_t _c, *cp = &_c;
* @param u64 interval timer interval in ticks
* @returns handle needed to cancel the timer
*/
-u32
+__clib_export u32
TW (tw_timer_start) (TWT (tw_timer_wheel) * tw, u32 user_id, u32 timer_id,
u64 interval)
{
* @param tw_timer_wheel_t * tw timer wheel object pointer
* @param u32 handle timer cancellation returned by tw_timer_start
*/
-void TW (tw_timer_stop) (TWT (tw_timer_wheel) * tw, u32 handle)
+__clib_export void TW (tw_timer_stop) (TWT (tw_timer_wheel) * tw, u32 handle)
{
TWT (tw_timer) * t;
pool_put_index (tw->timers, handle);
}
-int TW (tw_timer_handle_is_free) (TWT (tw_timer_wheel) * tw, u32 handle)
+__clib_export int
+TW (tw_timer_handle_is_free) (TWT (tw_timer_wheel) * tw, u32 handle)
{
return pool_is_free_index (tw->timers, handle);
}
* @param u32 handle timer returned by tw_timer_start
* @param u32 interval timer interval in ticks
*/
-void TW (tw_timer_update) (TWT (tw_timer_wheel) * tw, u32 handle,
- u64 interval)
+__clib_export void
+TW (tw_timer_update) (TWT (tw_timer_wheel) * tw, u32 handle, u64 interval)
{
TWT (tw_timer) * t;
t = pool_elt_at_index (tw->timers, handle);
* expired timer handles. The callback is optional.
* @param f64 timer_interval_in_seconds
*/
-void
+__clib_export void
TW (tw_timer_wheel_init) (TWT (tw_timer_wheel) * tw,
void *expired_timer_callback,
f64 timer_interval_in_seconds, u32 max_expirations)
* @brief Free a tw timer wheel template instance
* @param tw_timer_wheel_t * tw timer wheel object pointer
*/
-void TW (tw_timer_wheel_free) (TWT (tw_timer_wheel) * tw)
+__clib_export void TW (tw_timer_wheel_free) (TWT (tw_timer_wheel) * tw)
{
int i, j;
tw_timer_wheel_slot_t *ts;
return callback_vector;
}
-u32 *TW (tw_timer_expire_timers) (TWT (tw_timer_wheel) * tw, f64 now)
+__clib_export u32 *TW (tw_timer_expire_timers) (TWT (tw_timer_wheel) * tw,
+ f64 now)
{
return TW (tw_timer_expire_timers_internal) (tw, now, 0 /* no vector */ );
}
-u32 *TW (tw_timer_expire_timers_vec) (TWT (tw_timer_wheel) * tw, f64 now,
- u32 * vec)
+__clib_export u32 *TW (tw_timer_expire_timers_vec) (TWT (tw_timer_wheel) * tw,
+ f64 now, u32 * vec)
{
return TW (tw_timer_expire_timers_internal) (tw, now, vec);
}
* when timers are removed from fast wheel slots.
*/
-u32 TW (tw_timer_first_expires_in_ticks) (TWT (tw_timer_wheel) * tw)
+__clib_export u32
+TW (tw_timer_first_expires_in_ticks) (TWT (tw_timer_wheel) * tw)
{
u32 first_expiring_index, fast_ring_index;
i32 delta;
#include <vppinfra/format.h>
/* Call user's function to fill input buffer. */
-uword
+__clib_export uword
_unformat_fill_input (unformat_input_t * i)
{
uword l, first_mark;
}
/* Format function for dumping input stream. */
-u8 *
+__clib_export u8 *
format_unformat_error (u8 * s, va_list * va)
{
unformat_input_t *i = va_arg (*va, unformat_input_t *);
}
/* Print everything: not just error context. */
-u8 *
+__clib_export u8 *
format_unformat_input (u8 * s, va_list * va)
{
unformat_input_t *i = va_arg (*va, unformat_input_t *);
return 1;
}
-uword
+__clib_export uword
unformat_hex_string (unformat_input_t * input, va_list * va)
{
u8 **hexstring_return = va_arg (*va, u8 **);
}
/* unformat (input "foo%U", unformat_eof) matches terminal foo only */
-uword
+__clib_export uword
unformat_eof (unformat_input_t * input, va_list * va)
{
return unformat_check_input (input) == UNFORMAT_END_OF_INPUT;
}
/* Parse a token containing given set of characters. */
-uword
+__clib_export uword
unformat_token (unformat_input_t * input, va_list * va)
{
u8 *token_chars = va_arg (*va, u8 *);
/* Unformat (parse) function which reads a %s string and converts it
to and unformat_input_t. */
-uword
+__clib_export uword
unformat_input (unformat_input_t * i, va_list * args)
{
unformat_input_t *sub_input = va_arg (*args, unformat_input_t *);
}
/* Parse a line ending with \n and return it. */
-uword
+__clib_export uword
unformat_line (unformat_input_t * i, va_list * va)
{
u8 *line = 0, **result = va_arg (*va, u8 **);
}
/* Parse a line ending with \n and return it as an unformat_input_t. */
-uword
+__clib_export uword
unformat_line_input (unformat_input_t * i, va_list * va)
{
unformat_input_t *result = va_arg (*va, unformat_input_t *);
return n ? f : 0;
}
-uword
+__clib_export uword
unformat_skip_white_space (unformat_input_t * input)
{
uword n = 0;
return input_matches_format;
}
-uword
+__clib_export uword
unformat (unformat_input_t * input, const char *fmt, ...)
{
va_list va;
return result;
}
-uword
+__clib_export uword
unformat_user (unformat_input_t * input, unformat_function_t * func, ...)
{
va_list va;
}
/* Setup for unformat of Unix style command line. */
-void
+__clib_export void
unformat_init_command_line (unformat_input_t * input, char *argv[])
{
uword i;
}
}
-void
+__clib_export void
unformat_init_string (unformat_input_t * input, char *string, int string_len)
{
unformat_init (input, 0, 0);
vec_add (input->buffer, string, string_len);
}
-void
+__clib_export void
unformat_init_vector (unformat_input_t * input, u8 * vector_string)
{
unformat_init (input, 0, 0);
return input->index;
}
-void
+__clib_export void
unformat_init_clib_file (unformat_input_t * input, int file_descriptor)
{
unformat_init (input, clib_file_fill_buffer,
return val != 0;
}
-uword
+__clib_export uword
unformat_data_size (unformat_input_t * input, va_list * args)
{
u64 _a;
return format (s, "%p", regs[reg_no]);
}
-uword
+__clib_export uword
unformat_unix_gid (unformat_input_t * input, va_list * args)
{
gid_t *gid = va_arg (*args, gid_t *);
#include <fcntl.h>
#include <stdio.h> /* for sprintf */
-__thread uword __os_thread_index = 0;
-__thread uword __os_numa_index = 0;
+__clib_export __thread uword __os_thread_index = 0;
+__clib_export __thread uword __os_numa_index = 0;
clib_error_t *
clib_file_n_bytes (char *file, uword * result)
return error;
}
-clib_error_t *
+__clib_export clib_error_t *
clib_file_contents (char *file, u8 ** result)
{
uword n_bytes;
;
}
-void os_out_of_memory (void) __attribute__ ((weak));
-void
+__clib_export __clib_weak void
os_out_of_memory (void)
{
os_panic ();
}
-uword os_get_nthreads (void) __attribute__ ((weak));
-uword
+__clib_export __clib_weak uword
os_get_nthreads (void)
{
return 1;
@param template - clib_valloc_chunk_t * pointer to a template chunk which
describes the initial virtual address range
*/
-void
+__clib_export void
clib_valloc_init (clib_valloc_main_t * vam, clib_valloc_chunk_t * template,
int need_lock)
{
@os_out_of_memory_on_failure - 1=> panic on allocation failure
@return uword allocated space, 0=> failure
*/
-uword
+__clib_export uword
clib_valloc_alloc (clib_valloc_main_t * vam, uword size,
int os_out_of_memory_on_failure)
{
@note the size is returned since we know it / in case the caller
doesn't memorize chunk sizes
*/
-uword
+__clib_export uword
clib_valloc_free (clib_valloc_main_t * vam, uword baseva)
{
clib_valloc_chunk_t *ch, *prev_ch, *next_ch, *n2_ch;
/* Vector resize operator. Called as needed by various macros such as
vec_add1() when we need to allocate memory. */
-void *
+__clib_export void *
vec_resize_allocate_memory (void *v,
word length_increment,
uword data_bytes,