+struct mon_cmd_entry {
+ MON_CMD code;
+ const char *name;
+};
+
+struct mon_opt_entry {
+ MON_OPT_TYPE code;
+ MON_CMD cmd_code;
+ const char *name;
+};
+
+/* Table of commands */
+struct mon_cmd_entry mon_cmd_table[] = {
+ { MON_CMD_SHOW, "show" },
+ { MON_CMD_UNKNOWN } /* list terminator */
+};
+
+/* Table of options */
+struct mon_opt_entry mon_opt_table[] = {
+ { OPT_TYPE_SHOW_VERSION, MON_CMD_SHOW, "version" },
+ { OPT_TYPE_SHOW_CONFIG_FILES, MON_CMD_SHOW, "config_files" },
+ { OPT_TYPE_SHOW_UPTIME, MON_CMD_SHOW, "uptime" },
+ { OPT_TYPE_SHOW_TID_REQS_PROCESSED, MON_CMD_SHOW, "tid_reqs_processed" },
+ { OPT_TYPE_SHOW_TID_REQS_FAILED, MON_CMD_SHOW, "tid_reqs_failed" },
+ { OPT_TYPE_SHOW_TID_REQS_PENDING, MON_CMD_SHOW, "tid_reqs_pending" },
+ { OPT_TYPE_SHOW_TID_ERROR_COUNT, MON_CMD_SHOW, "tid_error_count" },
+ { OPT_TYPE_SHOW_ROUTES, MON_CMD_SHOW, "routes" },
+ { OPT_TYPE_SHOW_PEERS, MON_CMD_SHOW, "peers" },
+ { OPT_TYPE_SHOW_COMMUNITIES, MON_CMD_SHOW, "communities" },
+ { OPT_TYPE_SHOW_REALMS, MON_CMD_SHOW, "realms" },
+ { OPT_TYPE_SHOW_RP_CLIENTS, MON_CMD_SHOW, "rp_clients" },
+ { OPT_TYPE_UNKNOWN } /* list terminator */
+};
+
+/*** Commands ***/
+
+static struct mon_cmd_entry *find_cmd_entry(MON_CMD code)