1
/******************************************************************************
3
** (c) 2012 The Johns Hopkins University Applied Physics Laboratory
4
** All rights reserved.
6
** This material may only be used, modified, or reproduced by or for the
7
** U.S. Government pursuant to the license rights granted under
8
** FAR clause 52.227-14 or DFARS clauses 252.227-7013/7014
10
** For any other permissions, please contact the Legal Office at JHU/APL.
11
******************************************************************************/
13
/*****************************************************************************
18
** Description: A text-based DTNMP Manager. This manager provides the
19
** following functions associated with DTN network management:
21
** 1. Define and send custom report and macro definitions
22
** 2. Provide tools to build all versions of MIDs and OIDs.
23
** 3. Configure Agents for time- and state- based production
24
** 4. Print data reports received from a DTNMP Agent
27
** 1. Currently we do not support ACLs.
28
** 2. Currently, we do not support multiple DTNMP agents.
32
** Modification History:
33
** MM/DD/YY AUTHOR DESCRIPTION
34
** -------- ------------ ---------------------------------------------
35
** 01/18/13 E. Birrane Code comments and cleanup
36
*****************************************************************************/
39
#include "shared/utils/nm_types.h"
40
#include "shared/adm/adm.h"
41
#include "shared/primitives/mid.h"
44
#define UI_MAIN_MENU 0
45
#define UI_ADMIN_MENU 1
48
#define UI_CTRL_MENU 4
53
mid_t *ui_build_mid(char *mid_str);
55
void ui_clear_reports(agent_t* agent);
57
agent_t *ui_select_agent();
59
void ui_construct_ctrl_by_idx(agent_t* agent);
60
void ui_construct_time_rule_by_idx(agent_t* agent);
61
void ui_construct_time_rule_by_mid(agent_t* agent);
63
void ui_define_macro(agent_t* agent);
64
void ui_define_report(agent_t* agent);
65
void ui_define_mid_params(char *name, int num_parms, mid_t *mid);
67
void ui_register_agent();
68
void ui_deregister_agent();
72
int ui_get_user_input(char *prompt, char **line, int max_len);
74
mid_t *ui_input_mid();
75
int ui_input_mid_flag(uint8_t *flag);
77
Lyst ui_parse_mid_str(char *mid_str, int max_idx, int type);
79
void ui_print_ctrls();
80
int ui_print_agents();
81
void ui_print_custom_rpt(rpt_data_entry_t *rpt_entry, def_gen_t *rpt_def);
82
void ui_print_menu_admin();
83
void ui_print_menu_ctrl();
84
void ui_print_menu_def();
85
void ui_print_menu_main();
86
void ui_print_menu_rpt();
88
void ui_print_predefined_rpt(mid_t *mid, uint8_t *data, uint64_t data_size, uint64_t *data_used, adm_datadef_t *adu);
89
void ui_print_reports(agent_t *agent);
94
void *ui_thread(void * threadId);