/* *INDENT-OFF* */
VLIB_CLI_COMMAND (cli_show_api_histogram_command, static) = {
- .path = "show api histogram",
- .short_help = "show api histogram",
- .function = vl_api_show_histogram_command,
+ .path = "show api histogram",
+ .short_help = "show api histogram",
+ .function = vl_api_show_histogram_command,
};
/* *INDENT-ON* */
return 0;
}
+static clib_error_t *
+vl_api_status_command (vlib_main_t * vm,
+ unformat_input_t * input, vlib_cli_command_t * cli_cmd)
+{
+ api_main_t *am = &api_main;
+
+ // check if rx_trace and tx_trace are not null pointers
+
+ if (am->rx_trace == 0)
+ {
+ vlib_cli_output (vm, "RX Trace disabled\n");
+ }
+ else
+ {
+ if (am->rx_trace->enabled == 0)
+ vlib_cli_output (vm, "RX Trace disabled\n");
+ else
+ vlib_cli_output (vm, "RX Trace enabled\n");
+ }
+
+ if (am->tx_trace == 0)
+ {
+ vlib_cli_output (vm, "TX Trace disabled\n");
+ }
+ else
+ {
+ if (am->tx_trace->enabled == 0)
+ vlib_cli_output (vm, "TX Trace disabled\n");
+ else
+ vlib_cli_output (vm, "TX Trace enabled\n");
+ }
+
+ return 0;
+}
+
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (cli_show_api_command, static) = {
.path = "show api",
};
/* *INDENT-ON* */
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (cli_show_api_status_command, static) = {
+ .path = "show api status",
+ .short_help = "Show API trace status",
+ .function = vl_api_status_command,
+};
+/* *INDENT-ON* */
+
static clib_error_t *
vl_api_message_table_command (vlib_main_t * vm,
unformat_input_t * input,
msg_id = ntohs (msg_id);
if (fseek (fp, -2, SEEK_CUR) < 0)
- {
- vlib_cli_output (vm, "fseek failed, %s", strerror(errno));
- fclose(fp);
- return;
- }
+ {
+ vlib_cli_output (vm, "fseek failed, %s", strerror (errno));
+ fclose (fp);
+ return;
+ }
/* Mild sanity check */
if (msg_id >= vec_len (am->msg_handlers))
vlibmemory_init (vlib_main_t * vm)
{
api_main_t *am = &api_main;
- /* Normally NULL / 0, set by cmd line "api-segment" */
- svm_region_init_chroot_uid_gid (am->root_path, am->api_uid, am->api_gid);
+ svm_map_region_args_t _a, *a = &_a;
+
+ memset (a, 0, sizeof (*a));
+ a->root_path = am->root_path;
+ a->name = SVM_GLOBAL_REGION_NAME;
+ a->baseva = (am->global_baseva != 0) ?
+ am->global_baseva : SVM_GLOBAL_REGION_BASEVA;
+ a->size = (am->global_size != 0) ? am->global_size : SVM_GLOBAL_REGION_SIZE;
+ a->flags = SVM_FLAGS_NODATA;
+ a->uid = am->api_uid;
+ a->gid = am->api_gid;
+ a->pvt_heap_size =
+ (am->global_pvt_heap_size !=
+ 0) ? am->global_pvt_heap_size : SVM_PVT_MHEAP_SIZE;
+
+ svm_region_init_args (a);
return 0;
}