19 #include <vpp/app/version.h> 28 s =
format (s,
"{\"vpp_details\": {");
29 s =
format (s,
" \"version\": \"%s\",", VPP_BUILD_VER);
30 s =
format (s,
" \"build_date\": \"%s\"}}\r\n", VPP_BUILD_DATE);
43 int trim_length = strlen (path) + 1 ;
59 _vec_len (s) = cp - s;
70 u8 *s = 0, *stats = 0;
72 u32 *sw_if_indices = 0;
92 s =
format (s,
"{\"interface_stats\": {[\n");
93 s =
format (s,
" \"name\": \"%s\",", request);
94 s =
format (s,
" \"error\": \"%s\"",
"UnknownInterface");
111 s =
format (s,
"{%sinterface_stats%s: [\n", q, q);
113 for (i = 0; i <
vec_len (sw_if_indices); i++)
121 s =
format (s,
"{%sname%s: %s%U%s, ", q, q, q,
127 s =
format (s,
"%v}", stats);
129 s =
format (s,
"%snone%s: %strue%s}", q, q, q, q);
154 u32 *hw_if_indices = 0;
168 s =
format (s,
"{\"interface_list\": [\n");
169 for (i = 0; i <
vec_len (hw_if_indices); i++)
Static http server definitions.
vnet_main_t * vnet_get_main(void)
#define pool_foreach(VAR, POOL)
Iterate through pool.
vnet_interface_main_t interface_main
u32 data_offset
Current data send offset.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
format_function_t format_vnet_sw_if_index_name
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
int handle_get_version(http_builtin_method_type_t reqtype, u8 *request, http_session_t *hs)
description fragment has unexpected format
int free_data
Need to free data in detach_cache_entry.
uword * hw_interface_by_name
vnet_hw_interface_t * hw_interfaces
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u8 * data
File data, a vector.
int handle_get_interface_stats(http_builtin_method_type_t reqtype, u8 *request, http_session_t *hs)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
void builtinurl_handler_init(builtinurl_main_t *bm)
u32 cache_pool_index
File cache pool index.
#define vec_delete(V, N, M)
Delete N elements starting at element M.
void(* register_handler)(void *, char *, int)
void trim_path_from_request(u8 *s, char *path)
http_builtin_method_type_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
int handle_get_interface_list(http_builtin_method_type_t reqtype, u8 *request, http_session_t *hs)