Addition of developer and user modes to debugcli

In order to be able to protect the interface so that mistyped argument
do not endanger MaxScale yet still allow the developer access a router
option has been added that gives the debugcli two modes.
This commit is contained in:
Mark Riddoch
2014-05-23 13:29:58 +01:00
parent 23a9759fca
commit 7fe50a311f
11 changed files with 280 additions and 49 deletions

View File

@ -41,6 +41,7 @@ struct cli_session;
typedef struct cli_instance {
SPINLOCK lock; /*< The instance spinlock */
SERVICE *service; /*< The debug cli service */
int mode; /*< CLI interface mode */
struct cli_session
*sessions; /*< Linked list of sessions within this instance */
struct cli_instance
@ -53,8 +54,13 @@ typedef struct cli_instance {
*/
typedef struct cli_session {
char cmdbuf[80]; /*< The command buffer used to build up user commands */
int mode; /*< The CLI Mode for this session */
SESSION *session; /*< The gateway session */
struct cli_session
*next; /*< The next pointer for the list of sessions */
} CLI_SESSION;
/* Command line interface modes */
#define CLIM_USER 1
#define CLIM_DEVELOPER 2
#endif