summaryrefslogtreecommitdiffstats
path: root/data/mnet/Common/cli/include
diff options
context:
space:
mode:
Diffstat (limited to 'data/mnet/Common/cli/include')
-rw-r--r--data/mnet/Common/cli/include/address.h188
-rw-r--r--data/mnet/Common/cli/include/cfg_end.h49
-rw-r--r--data/mnet/Common/cli/include/cfg_exit.h42
-rw-r--r--data/mnet/Common/cli/include/cli_parser_api.h18
-rw-r--r--data/mnet/Common/cli/include/cli_parser_private.h11
-rw-r--r--data/mnet/Common/cli/include/cli_private.h114
-rw-r--r--data/mnet/Common/cli/include/config.h389
-rw-r--r--data/mnet/Common/cli/include/debug.h70
-rw-r--r--data/mnet/Common/cli/include/debug_macros.h70
-rw-r--r--data/mnet/Common/cli/include/defs.h127
-rw-r--r--data/mnet/Common/cli/include/exec_clear.h47
-rw-r--r--data/mnet/Common/cli/include/exec_configure.h47
-rw-r--r--data/mnet/Common/cli/include/exec_debug.h46
-rw-r--r--data/mnet/Common/cli/include/exec_debug_all.h41
-rw-r--r--data/mnet/Common/cli/include/exec_disable.h55
-rw-r--r--data/mnet/Common/cli/include/exec_enable.h58
-rw-r--r--data/mnet/Common/cli/include/exec_exit.h45
-rw-r--r--data/mnet/Common/cli/include/exec_help.h44
-rw-r--r--data/mnet/Common/cli/include/exec_show.h35
-rw-r--r--data/mnet/Common/cli/include/exec_undebug.h33
-rw-r--r--data/mnet/Common/cli/include/imc.h538
-rw-r--r--data/mnet/Common/cli/include/imsg.h179
-rw-r--r--data/mnet/Common/cli/include/macros.h652
-rw-r--r--data/mnet/Common/cli/include/mutex.h23
-rw-r--r--data/mnet/Common/cli/include/nv.h21
-rw-r--r--data/mnet/Common/cli/include/parser.h263
-rw-r--r--data/mnet/Common/cli/include/parser_ModNum.h13
-rw-r--r--data/mnet/Common/cli/include/parser_actions.h591
-rw-r--r--data/mnet/Common/cli/include/parser_api.h13
-rw-r--r--data/mnet/Common/cli/include/parser_commands.h27
-rw-r--r--data/mnet/Common/cli/include/parser_debug.h36
-rw-r--r--data/mnet/Common/cli/include/parser_debug_flags.h13
-rw-r--r--data/mnet/Common/cli/include/parser_defs_config.h28
-rw-r--r--data/mnet/Common/cli/include/parser_defs_exec.h86
-rw-r--r--data/mnet/Common/cli/include/parser_errno.h53
-rw-r--r--data/mnet/Common/cli/include/parser_if.h135
-rw-r--r--data/mnet/Common/cli/include/parser_init.h38
-rw-r--r--data/mnet/Common/cli/include/parser_input.h84
-rw-r--r--data/mnet/Common/cli/include/parser_modes.h8
-rw-r--r--data/mnet/Common/cli/include/parser_privilege.h19
-rw-r--r--data/mnet/Common/cli/include/parser_sim.h33
-rw-r--r--data/mnet/Common/cli/include/parser_util.h21
-rw-r--r--data/mnet/Common/cli/include/parsertypes.h145
-rw-r--r--data/mnet/Common/cli/include/platdef.h229
-rw-r--r--data/mnet/Common/cli/include/pstypes.h82
-rw-r--r--data/mnet/Common/cli/include/psvxif.h252
-rw-r--r--data/mnet/Common/cli/include/sys_debug.h20
-rw-r--r--data/mnet/Common/cli/include/ttyutil.h88
-rw-r--r--data/mnet/Common/cli/include/vxworks_cfg_chain.h157
-rw-r--r--data/mnet/Common/cli/include/vxworks_exec_chain.h229
-rw-r--r--data/mnet/Common/cli/include/vxworks_show_chain.h145
51 files changed, 5750 insertions, 0 deletions
diff --git a/data/mnet/Common/cli/include/address.h b/data/mnet/Common/cli/include/address.h
new file mode 100644
index 0000000..64ea31b
--- /dev/null
+++ b/data/mnet/Common/cli/include/address.h
@@ -0,0 +1,188 @@
+/* $Id: address.h,v 10.7 1999/08/17 01:05:18 sutton Exp $
+ * $Source: /export/sbcc/cepro/h/parser/address.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: address.h
+ * Description: Address(es) Header
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: address.h,v $
+ * Revision 10.7 1999/08/17 01:05:18 sutton
+ * Replaced red-black tree implementation with IOS code.
+ * CSCdm75775: Assert in cepro_201b11_dbg_cus1
+ *
+ * Revision 10.6 1999/08/05 20:53:51 vernikov
+ * CSCdm69411: delete of defualt gateway from GUI is BAD
+ *
+ * Revision 10.5.14.2 1999/08/16 23:18:33 sutton
+ * Replaced red-black tree implementation with code from IOS.
+ * CSCdm75775: Assert in cepro_201b11_dbg_cus1
+ * Branch: ROBIN202BR
+ *
+ * Revision 10.5.14.1 1999/08/05 20:51:27 vernikov
+ * CSCdm69411: delete of defualt gateway from GUI is BAD
+ * Branch: ROBIN202BR
+ *
+ * Revision 10.5 1999/03/30 02:15:17 vernikov
+ * CSCdm08933: Need validation during configuration of certain address
+ * fields
+ *
+ * Revision 10.4 1999/02/19 09:55:45 loril
+ * CSCdm02735: Add hostname support & martian validation in cli & gui
+ * where needed
+ *
+ * Revision 10.3 1998/10/07 03:03:41 pradeep
+ * CSCdk50280: ICP CLI needes to be checked in
+ *
+ * Revision 10.2 1998/07/11 16:51:04 sutton
+ * Straighten out some of the spaghetti dependencies between modules.
+ * CSCdk13101: merge MicroServer and Cache Engine source trees
+ *
+ * Revision 10.1 1998/06/09 17:41:39 sutton
+ * code merge
+ *
+ * Revision 1.2 1997/10/09 18:14:14 pparthas
+ * First Attempt to cleanup dead-code to reduce code-size; Included debug
+ * scheme in place
+ *
+ * Revision 1.1 1997/06/25 00:36:54 pparthas
+ * Initial Commit
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+#ifndef __ADDRESS_H__
+#define __ADDRESS_H__
+
+
+#define CLASS_A_BIT 0x80000000 /* off for class A, on for B, C, D */
+#define CLASS_B_BIT 0x40000000 /* off for class B, on for C, D */
+#define CLASS_C_BIT 0x20000000 /* off for class C, on for D */
+#define CLASS_D_BIT 0x10000000 /* off for class D */
+
+#define CLASSA_BIT 0x80 /* off for class A, on for B, C, D */
+#define CLASSB_BIT 0x40 /* off for class B, on for C, D */
+#define CLASSC_BIT 0x20 /* off for class C, on for D */
+#define CLASSD_BIT 0x10 /* off for class D */
+
+#define CLASS_A_MASK 0xFF000000 /* mask for class A net */
+#define CLASS_B_MASK 0xFFFF0000 /* mask for class B net */
+#define CLASS_C_MASK 0xFFFFFF00 /* mask for class C net */
+#define CLASS_D_MASK 0x00000000 /* mask for class D net??? */
+
+#define CLASS_A_SHIFT 24 /* A: bits shift to make int */
+#define CLASS_B_SHIFT 16 /* B: bits shift to make int */
+#define CLASS_C_SHIFT 8 /* C: bits shift to make int */
+
+#define ADDR_ILLEGAL 0 /* illegal address */
+#define ADDR_IP 1 /* IP address */
+
+#define ADDRLEN_IP 4
+
+/*
+ * Flag bit definitions for use in martian() api
+ */
+#define MARTIAN_FLAG_IS_HOST 0x01 /* TRUE => ipaddr is a host */
+ /* FALSE => ipaddr may be a */
+ /* network address */
+#define MARTIAN_FLAG_MULTICAST_ALLOWED 0x02 /* TRUE => do not consider a */
+ /* CLASS D ipaddr */
+ /* a martian addr */
+ /* FALSE => do consider a */
+ /* CLASS D ipaddr */
+ /* a martian addr */
+
+/*
+ * Special networks and addresses.
+ */
+#define IP_LOOPBACK_NET 0x7f000000 /* 127.0.0.0 */
+#define MASK_HOST 0xffffffff /* 255.255.255.255 */
+#define IP_LIMITED_BROADCAST 0xffffffff /* 255.255.255.255 */
+#define IP_BSD_LIMITED_BROADCAST 0 /* 0.0.0.0 */
+#define IPADDR_ZERO ((ipaddrtype) 0) /* for use as a default address */
+
+
+union addresses {
+ ipaddrtype ip_address;
+};
+
+#define ip_addr addr.ip_address
+
+typedef struct addrtype_ {
+ uchar type;
+ uchar length;
+ union addresses addr;
+} addrtype;
+
+/* Structure and #defines used in parser_ipaddr_or_hostname() api */
+
+typedef struct ipAddr_ {
+ ipaddrtype ipAddrNetOrder; /* network byte order */
+ ipaddrtype ipAddrHostOrder; /* host byte order */
+ char ipAddrStr[INET_ADDR_LEN]; /* dotted-decimal string */
+} ipAddr_t, *pIpAddr_t;
+
+/* Values of flags as the calling parameter to parser_ipaddr_or_hostname() */
+
+#define IPADDR_CLI_PROCESSING 0x01 /* TRUE => processing for cli
+ * FALSE => processing for gui
+ */
+#define IPADDR_CLI_IN_HELP 0x02 /* Flag is valid only if
+ * IPADDR_CLI_HANDLING == TRUE
+ * TRUE => in cli help
+ * processing
+ * FALSE => not in cli help
+ * processing
+ */
+#define IPADDR_HOSTNAME_ALLOWED 0x04 /* TRUE => input string can
+ * be ipaddr or
+ * hostname
+ * FALSE => input string can
+ * an ipaddr only
+ */
+#define IPADDR_MARTIAN_TEST_REQUIRED 0x08 /* TRUE => do martian test
+ * FALSE => skip martian test
+ */
+#define IPADDR_MARTIAN_IS_HOST_ADDRESS 0x10 /* Flag is valid only if
+ * IPADDR_MARTIAN_TEST_REQUIRED
+ * == TRUE
+ * TRUE => input is host addr
+ * FALSE => input can be a
+ * network addr
+ */
+
+#define IPADDR_MARTIAN_MULTICAST_ALLOWED 0x20 /* Flag is valid only if
+ * IPADDR_MARTIAN_TEST_REQUIRED
+ * == TRUE
+ * TRUE => multicast addr
+ * wil not be
+ * consider a
+ * martian
+ * FALSE => multicast addr
+ * will be considered
+ * a martian
+ */
+
+#define IPADDR_DEFAULT_ROUTING 0x40 /* Flag is valid only for
+ * default routing
+ * if ip address is 0.0.0.0
+ */
+
+/* The default flags represent what the GUI uses in most cases. */
+
+#define IPADDR_GUI_DEFAULT_FLAGS (IPADDR_HOSTNAME_ALLOWED | \
+ IPADDR_MARTIAN_TEST_REQUIRED | \
+ IPADDR_MARTIAN_IS_HOST_ADDRESS)
+
+extern void ip_address_init( void );
+extern boolean good_address (ipaddrtype , ipaddrtype , boolean );
+extern boolean martian (ipaddrtype , ulong);
+extern int parser_ipaddr_or_hostname (char *, int *, ulong, pIpAddr_t, char **);
+extern int ValidateNetMask (ipaddrtype, char *, char **);
+#endif /* __ADDRESS_H__ */
diff --git a/data/mnet/Common/cli/include/cfg_end.h b/data/mnet/Common/cli/include/cfg_end.h
new file mode 100644
index 0000000..259e6e9
--- /dev/null
+++ b/data/mnet/Common/cli/include/cfg_end.h
@@ -0,0 +1,49 @@
+/* $Id: cfg_end.h,v 10.2 1998/12/30 18:13:01 sundars Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/cfg_end.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: cfg_end.h
+ * Description: end - exit configuration mode
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: cfg_end.h,v $
+ * Revision 10.2 1998/12/30 18:13:01 sundars
+ * Fix help texts for CLI commands
+ * CSCdk69292: CLI Command Descriptions When Entering a ?-Part 2
+ *
+ * Revision 10.1 1998/06/10 20:41:51 sutton
+ * code merge
+ *
+ * Revision 1.4 1998/04/21 01:26:41 pparthas
+ * CLI Related changes / Undo log / Errno propagation
+ * CSCdj68847: CLI changes
+ *
+ * Revision 1.3 1997/08/04 19:28:27 pparthas
+ * Made 'end' from config mode a hidden command
+ *
+ * Revision 1.2 1997/05/14 22:12:01 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+/***************************************************************
+ * end
+ *
+ * exits from config mode
+ */
+
+EOLS (act_end_configure, exit_config_command, CMD_END);
+
+KEYWORD (end_configure, act_end_configure, ALTERNATE, "end",
+ "Exit configuration mode", PRIV_MIN);
+
+#undef ALTERNATE
+#define ALTERNATE end_configure
diff --git a/data/mnet/Common/cli/include/cfg_exit.h b/data/mnet/Common/cli/include/cfg_exit.h
new file mode 100644
index 0000000..722e2e4
--- /dev/null
+++ b/data/mnet/Common/cli/include/cfg_exit.h
@@ -0,0 +1,42 @@
+/* $Id: cfg_exit.h,v 10.2 1998/12/30 18:13:01 sundars Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/cfg_exit.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: cfg_exit.h
+ * Description: exit - exit configuration mode
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: cfg_exit.h,v $
+ * Revision 10.2 1998/12/30 18:13:01 sundars
+ * Fix help texts for CLI commands
+ * CSCdk69292: CLI Command Descriptions When Entering a ?-Part 2
+ *
+ * Revision 10.1 1998/06/10 20:41:52 sutton
+ * code merge
+ *
+ * Revision 1.2 1997/05/14 22:12:02 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+/***************************************************************
+ * exit
+ *
+ * exits from config mode
+ */
+
+EOLS (act_exit_configure, exit_config_command, CMD_EXIT);
+
+KEYWORD (exit_configure, act_exit_configure, ALTERNATE,
+ "exit", "Exit configuration mode", PRIV_MIN);
+
+#undef ALTERNATE
+#define ALTERNATE exit_configure
diff --git a/data/mnet/Common/cli/include/cli_parser_api.h b/data/mnet/Common/cli/include/cli_parser_api.h
new file mode 100644
index 0000000..b1815aa
--- /dev/null
+++ b/data/mnet/Common/cli/include/cli_parser_api.h
@@ -0,0 +1,18 @@
+#ifndef __CLI_PARSER_API_H__
+#define __CLI_PARSER_API_H__
+
+/* exported by cli_parser_init.c */
+extern void CliParserInit();
+extern void CliIOInit (int);
+
+/* exported by debug.cpp */
+
+extern void debug_init();
+
+/* exported by command_chain.cpp */
+extern void command_parser_init();
+
+/* exported by exec_chain.cpp */
+extern void exec_parser_init();
+
+#endif /* __CLI_PARSER_API_H__ */
diff --git a/data/mnet/Common/cli/include/cli_parser_private.h b/data/mnet/Common/cli/include/cli_parser_private.h
new file mode 100644
index 0000000..31758f2
--- /dev/null
+++ b/data/mnet/Common/cli/include/cli_parser_private.h
@@ -0,0 +1,11 @@
+#ifndef __CLI_PARSER_PRIVATE_H__
+#define __CLI_PARSER_PRIVATE_H__
+
+#define PARSER_TASK_PRIORITY 150
+#define PARSER_TASK_OPTION 0
+#define PARSER_TASK_STACK_SIZE 20000
+#define DEBUG_CLI_PARSER 0
+
+#define DBG_PARSER(s) if (DEBUG_CLI_PARSER) printf(s);
+
+#endif /* __CLI_PARSER_PRIVATE_H__ */
diff --git a/data/mnet/Common/cli/include/cli_private.h b/data/mnet/Common/cli/include/cli_private.h
new file mode 100644
index 0000000..7b40c2a
--- /dev/null
+++ b/data/mnet/Common/cli/include/cli_private.h
@@ -0,0 +1,114 @@
+#ifndef __CLI_PRIVATE_H__
+#define __CLI_PRIVATE_H__
+
+typedef char tOCTET; /* signed octet */
+typedef unsigned char tUOCTET; /* unsigned octet */
+typedef int tINT; /* Integer */
+typedef short tOCTET2; /* signed 2 octets */
+typedef short s_size_t; /* signed size_t */
+typedef unsigned us_size_t; /* unsigned size_t */
+typedef long tOCTET4; /* signed 4 octets */
+typedef unsigned short tUOCTET2; /* unsigned 2 octets */
+typedef unsigned long tUOCTET4; /* unsigned 4 octets */
+typedef FILE tFILE;
+typedef int tTASKID;
+typedef int boolean;
+typedef uint32_t ipaddrtype;
+
+ /*
+ **
+ ** Basic data type pointers
+ **
+ */
+
+typedef char * tpOCTET;
+typedef unsigned char * tpUOCTET;
+typedef short * tpOCTET2;
+typedef long * tpOCTET4;
+typedef unsigned short * tpUOCTET2;
+typedef unsigned long * tpUOCTET4;
+
+/*
+ * libc data types
+ */
+typedef FILE * tpFILE;
+
+/*
+ * kernel data types
+ */
+typedef SEM_ID tSEMAPHORE; /* semaphore */
+typedef SEM_ID tCSEMAPHORE; /* counting semaphore */
+typedef SEM_ID tBSEMAPHORE; /* binary semaphore */
+typedef SEM_ID tMSEMAPHORE; /* mutex semaphore */
+
+/*
+ * missing from vxWorks' Posix types
+ */
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+
+/*
+ * Cisco IOS compatibility
+ */
+typedef long long longlong;
+typedef unsigned int uint;
+typedef unsigned char uchar;
+typedef unsigned long ulong;
+typedef unsigned long long ulonglong;
+typedef unsigned long long sys_timestamp;
+
+/*
+ * Special values for data types
+ */
+#ifndef NULLP
+#define NULLP ((void *) 0)
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+
+/*
+ * copied from dosfs/uvfatTypes.h
+ */
+
+typedef uid_t tUID;
+typedef gid_t tGID;
+typedef tOCTET2 tMODE;
+typedef unsigned long tDIRNUM, *tpDIRNUM;
+typedef tOCTET4 tCOMPATDWORD;
+
+
+#define INVALID_UID ((unsigned short)-1)
+#define INVALID_GID ((unsigned short)-1)
+#define INVALID_MODE -1
+#define INVALID_DIRNUM -1L
+#define INVALID_FLAGS -1L
+
+#define INIT_DIRNUM 0
+#define ROOTDIR_DIRNUM 1
+
+typedef tOCTET2 tACCESS;
+
+#define setuid setUid
+#define getuid getUid
+
+
+
+
+/*
+** vxWorks mutex semphore default flag
+*/
+#define PS_DEFAULT_MUTEX_SEM_FLAG \
+ (SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
+#define PS_DEFAULT_BINARY_SEM_FLAG (SEM_Q_PRIORITY)
+#define PS_DEFAULT_COUNT_SEM_FLAG (SEM_Q_PRIORITY)
+#define PS_DEFAULT_BINARY_SEM_STAT (SEM_FULL)
+#define PS_DEFAULT_COUNT_SEM_COUNT 1
+
+#endif /* __CLI_PRIVATE_H_ */
diff --git a/data/mnet/Common/cli/include/config.h b/data/mnet/Common/cli/include/config.h
new file mode 100644
index 0000000..022e3ea
--- /dev/null
+++ b/data/mnet/Common/cli/include/config.h
@@ -0,0 +1,389 @@
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#define SABUFSIZE 3000 /* buffer size for config from term */
+#define TOKLEN 85 /* maximum token length */
+#define WORD 0 /* gettoken should return a word */
+#define LINE 1 /* gettoken should return a line */
+
+
+/*
+ * flags used in csb->flags
+ */
+#define CONFIG_TERM 0x00000001 /* configuring from a terminal */
+#define CONFIG_ABORT 0x00000002 /* need to abort the config */
+#define CONFIG_DONE 0x00000004 /* config is done */
+#define CONFIG_HTTP 0x00000008 /* configuring from http */
+#define KEYWORD_MATCHED 0x00000010 /* keyword was matched */
+#define COMMAND_AUTHORIZE 0x00000020 /* expand command into nv_command */
+#define COMMAND_FUNCTION 0x00000040 /* substitute function on accept */
+#define HIDE_PASSWORDS 0x00000080 /* Don't print password during nvgen */
+#define PARSE_EMPTY_STRING 0x00000100 /* Try to parse empty string */
+#define CONFIG_PER_USER 0x00000200 /* Per-user configuration */
+#define CONFIG_CGI 0x00000400 /* configuring from http */
+#define COMMAND_COMPLETE 0x00000800 /* Indicate to I/O so it can do History */
+#define CONFIG_FILE 0x00001000 /* Copy Startup to Disk */
+#define TERMINAL_MODE 0x00002000 /* Indicate to Callback to leave at
+ * Terminal Mode */
+
+#define NOMEANSZERO 1 /* if "no", assume number 0 */
+#define NONULL 2 /* null args not allowed */
+#define NOMEANSMINUS 3 /* if "no", assume number -1 */
+#define NOMEANSNULL 4 /* if "no", assume null string */
+#define NULLMEANSDONE 5 /* if NULL, quiet error return */
+
+
+/*
+ * Methods for resolving protocol addresses and configuration information.
+ * Note that this list has grown to be used for lots more than resolving
+ * protocol addresses, however.
+ */
+enum RES {
+ RES_NULL, /* Not resolved */
+ RES_CONFIG, /* Configuration file */
+ RES_MANUAL, /* Manually set */
+ RES_NONVOL, /* Read from non-volatile RAM */
+ RES_PRIVATE_NONVOL, /* Read from private non-volatile RAM */
+ RES_WRITING_NONVOL /* Writing to non-volatile RAM */
+};
+
+
+
+/*
+ * RAMS : this was under ifdef of IOS_PARSER
+ */
+
+/*
+ * A list of file access methods.
+ * The bootstrap monitor knows about the TFTP, MOP, and FLASH codes,
+ * so don't change their values.
+ */
+typedef enum {
+ FILE_ACCESS_UNKNOWN = 0,
+ FILE_ACCESS_TFTP = 1,
+ FILE_ACCESS_FLASH = 3,
+ FILE_ACCESS_ROM = 4,
+ FILE_ACCESS_RCP = 5,
+ FILE_ACCESS_FTP = 8,
+} file_access_protocol;
+
+
+/*
+ * now define a generic named thing.
+ */
+typedef struct namedthingtype_ {
+ struct namedthingtype_ *next;
+ NAMEDTHINGMACRO
+ uchar data[1];
+} namedthingtype;
+
+/*
+ * RAMS : ifdef ended here
+ */
+
+
+
+
+
+
+/************************************************************************/
+/*********** START OF NEW PARSER STRUCTURE ******************************/
+/************************************************************************/
+
+
+#define PARSEBUF 256 /* Input buffer length */
+#define MAXTOKLEN 21 /* Maximum token length */
+#define MAXPROMPTLEN 30 /* Maximum prompt; prompt truncated to fit */
+
+/* Structure for saving blocks of character strings like comments,
+ * help output, and NV generation.
+ */
+typedef struct save_buf_ {
+ char *buf; /* The buffer itself */
+ int size; /* Size of the malloc'ed buffer area */
+ int used; /* Number of characters stored in the buffer */
+} save_buf;
+
+/*
+ *
+ */
+typedef struct ambig_struct_ {
+ char ambig[PARSEBUF];
+ char ambig_save[PARSEBUF];
+ int multiple_funcs;
+} ambig_struct;
+
+/* The 'transition' struct is the central data structure of the parser.
+ * A parse tree is built of transition nodes, each of which references
+ * an action routine (func() in the structure). The action routine
+ * will transition to the 'accept' node if the input was matched (or
+ * some other action was successful). The 'alternate' transition is taken
+ * if the action failed, and after the accepting node returns (recursion
+ * is currently used to transition between nodes). The 'args' variable
+ * may be used to pass additional parameters to the action routine. It is
+ * generally defined as one of several types of structures to allow passing
+ * multiple parameters.
+ *
+ * The parse_token() function handles transitioning between nodes.
+ */
+
+typedef void (*trans_func)(parseinfo *, transition *, const void * const);
+struct transition_ {
+ transition *accept;
+ transition *alternate;
+ const trans_func func;
+ const void * const args;
+};
+
+/*
+ * Dynamic transitions used for adding parse chains at run time
+ */
+typedef struct dynamic_transition_ dynamic_transition;
+struct dynamic_transition_ {
+ dynamic_transition *accept;
+ dynamic_transition *alternate;
+ const trans_func func;
+ const void *args;
+};
+
+typedef void (*command_func)(parseinfo *);
+
+/* The parseinfo struct is used by the parser routines for
+ * parameter storage between the parser and command action routines.
+ * The parser and action functions must agree as to where
+ * values are stored in this struct. Generally, this is
+ * in order in which the values appear in the input stream.
+ *
+ * Parser internal state info is also kept here.
+ */
+
+
+struct parseinfo_ {
+
+/*** Start of cleared area ***/
+
+/*** Note that csb_start_data is defined as txt1 below! ***/
+
+ /* Variable storage for parsed data being passed to functions */
+ char txt1[PARSEBUF], txt2[PARSEBUF], txt3[PARSEBUF]; /* String data */
+ char txt4[PARSEBUF], txt5[PARSEBUF], txt6[PARSEBUF]; /* String data */
+ char txt7[PARSEBUF], txt8[PARSEBUF]/*, txt9[PARSEBUF]*/; /* String data */
+
+ uint val1, val2, val3, val4, val5; /* Integer values */
+ uint val6, val7, val8, val9, val10;
+ uint val11, val12, val13, val14, val15;
+
+ addrtype addr1, addr2, addr3, addr4, addr5, addr6, addr7, addr8;
+
+ int interface;
+
+ void *vptr0, *vptr1;
+
+ void *udb1,*udb2;
+
+ boolean leave_subcommand;
+
+ parser_mode *pmp;
+
+ uint end_of_data; /* Dummy to mark end of data area */
+
+/*** End of cleared area ***/
+
+ /* The below two variables are used in determining the command action
+ * routine to execute.
+ * 'which' is the command type code passed in the EOL structure and is
+ * used by the called function to switch out to the command action routine.
+ * An example is CMD_CLEAR, which causes the clear_command() function to
+ * be called.
+ * 'func' is a function code which determines which of several command
+ * functions was requested. An example is CLEAR_VINES_ROUTE which is
+ * used by the clear_command() function to decide which action to take.
+ */
+
+ uint which; /* Which command type being executed */
+ uint func; /* Command function being executed */
+
+ boolean sense; /* FALSE if we parsed a 'no' prefix. Also
+ * FALSE if a 'default' prefix parsed
+ * because the off state is the default
+ * for most commands.
+ */
+
+ boolean set_to_default; /* TRUE if we parsed a 'default'
+ * prefix
+ */
+
+ int resolvemethod; /* Config source: term, mem, or net */
+ uint flags; /* misc flags */
+
+
+ char *batch_buf; /* Batch input buffer. NULL pointer if
+ * no batch buffer.
+ */
+
+ char *batch_offset; /* Current offset into batch buffer */
+
+ /* NV generation variables */
+ boolean nvgen; /* We're doing NV generation */
+ char nv_command[PARSEBUF]; /* The command being generated */
+
+ /* Structures for saving comments, help output, and NV generation */
+ save_buf comment_save, help_save;
+ int saved_help_used; /* How many bytes of help we've seen */
+
+ /* Parser internal state info */
+
+ /* The number of commands which matched the input stream,
+ * the function to call if only one matched, and a pointer to any
+ * additional parseinfo structures we created.
+ */
+ queuetype *tokenQ; /* Token processing queue. This is a
+ * push-down queue. The top of the
+ * stack is the next element to
+ * process.
+ */
+ ambig_struct visible_ambig;
+ ambig_struct hidden_ambig;
+
+ boolean command_visible; /* TRUE if current keyword is visible */
+ boolean unsupported; /* TRUE if current keyword is unsupported */
+
+ void (* action_func)(parseinfo *); /* Command function to call */
+ struct parseinfo_ *next; /* Next structure, or NULL */
+
+ int in_help; /* We're processing a help request */
+
+ uchar priv_set; /* If non-zero, then set keywords to
+ * this privilege level.
+ */
+
+ uchar priv; /* User's current privilege level */
+ uchar highest_priv; /* Highest keyword priv level parsed */
+ uchar last_priv; /* Privilege level of last keyword */
+ queuetype *privQ; /* stack of transitions that will have
+ * their privilege level changed */
+
+ queuetype *priv_nvgenQ; /* stack for doing NV generation */
+
+ int exit_all; /* Exit flag */
+
+ char prompt[MAXPROMPTLEN+1]; /* Command line prompt */
+ char line_buffer[PARSEBUF]; /* String being consumed */
+
+ char *line; /* Pointer to string being consumed */
+ int line_index; /* Current token ptr into line */
+ int error_index; /* Position of error in input line */
+ char *break_chars; /* Texti break character set */
+ char lastchar; /* last char read by readline() */
+ parser_mode *mode; /* Current parser mode */
+ command_func command_function; /* Substitute function on accept */
+
+ /* Microweb Specific Additions */
+ ushort MoreStatus; /* Who does 'more' etc. ? */
+ SEM_ID configSemId; /* Semaphore to hold for configuration */
+ boolean giveConfigSem; /* Easy access to release configuration
+ semaphore */
+
+ int inFd; /* Input 'fd' */
+ int outFd; /* Output 'fd' */
+ int savedFd; /* saved outFd when output is redirected */
+ void *pIndex; /* Used for 'more' kind of processing,
+ cookie */
+ long maxRecordCount; /* Used for 'more'; Maximum record count */
+ int moduleId; /* Who owns this CSB ? */
+
+
+ int uid; /* UID of the I/O Module */
+
+ int ioTaskId; /* Task Id of the I/O Module */
+ timer_t io_timer; /* io input timeout */
+ boolean return_val; /* return value for command */
+ int errno_val; /* error value for command */
+ void *userDataBlock[2];
+ /* struct parser_session *session; parser session, if one exists */
+
+};
+
+/* Start and end of variable area (for clearing purposes) */
+
+#define csb_start_data txt1 /* First address to clear */
+#define csb_end_data end_of_data /* Last address + 1 to clear */
+
+#define PFLAG_in_help in_help /* Help flag */
+#define PFLAG_nvgen nvgen /* NV gen flag */
+#define PFLAG_sense sense /* sense flag */
+#define PFLAG_which which /* which flag */
+
+#define PTXT_0 nv_command
+#define PTXT_1 txt1
+#define PTXT_2 txt2
+#define PTXT_3 txt3
+#define PTXT_4 txt4
+#define PTXT_5 txt5
+#define PTXT_6 txt6
+#define PTXT_7 txt7
+#define PTXT_8 txt8
+#define PTXT_9 txt9
+#define PTXT_prompt prompt
+#define PTXT_line line
+#define PTXT_break_chars break_chars
+
+#define PVPTR_0 vptr0
+#define PVPTR_1 vptr1
+
+
+#define PCHAR_lastchar lastchar
+
+#define PTYPE_int(num) val ## num /* Integer */
+#define PTYPE_char(num) PCHAR ## num
+#define PTYPE_string(num) PTXT_ ## num /* String */
+#define PTYPE_paddr(num) addr ## num /* Protocol address ptr */
+#define PTYPE_hwaddr(num) hwaddr ## num /* Hardware address ptr */
+#define PTYPE_maskedAddr(num) maskedAddr ## num /* masked address ptr */
+#define PTYPE_flag(num) PFLAG_ ## num /* Parser flags */
+#define PTYPE_vptr(num) PVPTR_ ## num /* Parser void* */
+#define PUDB_current1 userDataBlock[0]
+#define PUDB_current2 userDataBlock[1]
+#define PUDB_1 udb1
+#define PUDB_2 udb2
+#define PTYPE_udb(num) PUDB_ ## num /* User Defined data block ptr */
+
+
+#define PPTR_int
+#define PPTR_string
+#define PPTR_paddr &
+#define PPTR_hwaddr &
+#define PPTR_maskedAddr &
+#define PPTR_flag
+#define PPTR_vptr
+#define PPTR_udb
+
+#define GETOBJ(type,num) (PPTR_ ## type ## (csb->PTYPE_ ## type ## ( ## num ## )))
+#define SETOBJ(type,num) csb->PTYPE_ ## type ## ( ## num ## )
+#define ISOBJ(type,num) ((int) GETOBJ(type,num) != 0)
+
+/************************************************************************/
+/*********** END OF NEW PARSER STRUCTURE ********************************/
+/************************************************************************/
+
+/***********************************************************************
+ *
+ * Externs and Prototypes
+ *
+ ***********************************************************************/
+
+/*
+ * parser.c
+ */
+typedef boolean (*match_gen_func)(parseinfo *, char *, int *, void *,
+ int, uint, void *);
+typedef char * (*short_help_func)(parseinfo *, uint, void *);
+
+extern void parser_add_address(const uint, short_help_func, match_gen_func);
+extern void exit_config_submode(parseinfo *);
+extern void exit_config_modes(parseinfo *);
+extern void parse_configure (char *, int , int , uchar );
+extern void wait_for_system_load( void );
+extern boolean yes_or_no(const char *prompt, boolean def, boolean usedef);
+#endif __CONFIG_H__
+
diff --git a/data/mnet/Common/cli/include/debug.h b/data/mnet/Common/cli/include/debug.h
new file mode 100644
index 0000000..51e4229
--- /dev/null
+++ b/data/mnet/Common/cli/include/debug.h
@@ -0,0 +1,70 @@
+#ifndef __DEBUG_H__
+#define __DEBUG_H__
+
+
+
+#define MIN_DEBUG_LEVEL 1
+#define MAX_DEBUG_LEVEL 5
+
+/*
+ * debug_item_type defines a standard way of describing a debugging
+ * flag. Most protocols keep their debugging flags in special
+ * cells, which are pointed to by the members of arrays of entries
+ * of this type. The generic debugging support provides a few routines
+ * for dealing with such arrays. By convention, the end of an array
+ * is flagged by a null flag pointer.
+ */
+typedef struct debug_item_type_ {
+ boolean *var; /* Address of on/off flag */
+ char *txt; /* Descriptive text about what to debug */
+} debug_item_type;
+
+/* Initialize the debugging system */
+extern void debug_init(void);
+
+/*
+ * Determine whether "debug all" is in effect. When a new subsystem
+ * is initialized, it uses this routine to determine whether it should
+ * immediately turn on its debugging flags or not.
+ */
+extern boolean debug_all_p(void);
+
+/*
+ * Generic routine for "debug" parse chains to call. Only useful if you're
+ * using totally stock flags and arrays.
+ */
+extern void debug_command(parseinfo *csb);
+
+/* Routine to handle "debug all" and "undebug all" */
+extern void debug_all_cmd(parseinfo *csb);
+
+/* Routine that implements the "show debug" command */
+extern void show_debug(void);
+
+/*
+ * Display the value of a debugging flag in the common format used for
+ * all such flags.
+ */
+extern void debug_show_flag(boolean flag, char *text);
+
+/*
+ * Show a whole array of flags. The end of the array is marked by an
+ * entry with a null flag pointer.
+ */
+extern void debug_show_flags(const debug_item_type *array, const char *heading,
+ boolean printLevel );
+
+/*
+ * generic routine to call when anybody issues
+ * a "debug all" or "undebug all" command or
+ * whenever you want to set the state of all
+ * debug flags at once.
+ */
+
+extern void generic_debug_all (const debug_item_type *, boolean );
+extern void generic_debug_show (const debug_item_type *, const char* );
+extern STATUS generic_debug_init (const debug_item_type *, const char* );
+
+extern void debug_init( void );
+
+#endif __DEBUG_H__
diff --git a/data/mnet/Common/cli/include/debug_macros.h b/data/mnet/Common/cli/include/debug_macros.h
new file mode 100644
index 0000000..76a3dc7
--- /dev/null
+++ b/data/mnet/Common/cli/include/debug_macros.h
@@ -0,0 +1,70 @@
+
+
+/* This perverted abuse of the C preprocessor is designed to keep us from
+ * having to keep too many files consistent to make debugging DEBUG_FLAGs work.
+ * To make a standard debugging DEBUG_FLAG, we have to create 3 things:
+ *
+ * o A boolean flag variable (tested by the routines that print the actual
+ * debugging output)
+ *
+ * o An array element that associates that variable with a textual
+ * description (used by the parsing and printing routines to talk about
+ * the flag)
+ *
+ * o A symbolic name for the array index (used by parse chains to designate
+ * which flag is to be set or cleared within an array).
+ *
+ * Rather than ask a human being to type in all three definitions, we use
+ * the macros below and some include file hackery to create them all from
+ * the same data. If the magic symbol "__DECLARE_DEBUG_ARR__" is defined,
+ * we assume that whatever file includes us wants to actually declare
+ * initialized data... presumably we've been included by an xxx_debug.c
+ * module. If "__DECLARE_DEBUG_NUMS__" is defined instead, we assume
+ * that an include file wants to create the symbolic names for array
+ * offsets. If neither magic symbol is defined, we assume that an include
+ * file (probably the same one) wants to create external declarations
+ * for the booleans themselves, as well as an external declaration for
+ * the array.
+ *
+ * There are some instances in which a debug flag is defined that should
+ * not be declared by us; in such cases the DEBUG_FLAG_NO_DECL macro
+ * should be used, rather than the DEBUG_FLAG macro.
+ */
+
+/* We've probably been called before, so let's clean up what we did then */
+#undef DEBUG_ARRDECL
+#undef DEBUG_FLAG
+#undef DEBUG_ARRDONE
+#undef DEBUG_FLAG_NO_DECL
+
+#if defined(__DECLARE_DEBUG_ARR__)
+
+#define DEBUG_ARRDECL(arrname) const debug_item_type arrname[] = {
+#define DEBUG_FLAG(varname,codename,textname) {&varname, textname},
+#define DEBUG_FLAG_NO_DECL(varname,codename,textname) {&varname, textname},
+#define DEBUG_ARRDONE {(boolean *) NULL, (char *) NULL} };
+
+#elif defined(__DECLARE_DEBUG_NUMS__)
+
+#define DEBUG_ARRDECL(arrname) enum {
+#define DEBUG_FLAG(varname,codename,textname) codename,
+#define DEBUG_FLAG_NO_DECL(varname,codename,textname) codename,
+#define DEBUG_ARRDONE };
+
+#else
+
+#define DEBUG_ARRDECL(arrname) extern const debug_item_type arrname[];
+#if defined(__DECLARE_DEBUG_VARS__)
+#define DEBUG_FLAG(varname,codename,textname) boolean varname;
+#else
+#define DEBUG_FLAG(varname,codename,textname) extern boolean varname;
+#endif
+#define DEBUG_FLAG_NO_DECL(varname,codename,textname) /* Nothing */
+#define DEBUG_ARRDONE /* Nothing */
+
+#endif
+
+/* Some other include file might want to reuse us... */
+#undef __DECLARE_DEBUG_VARS__
+#undef __DECLARE_DEBUG_ARR__
+#undef __DECLARE_DEBUG_NUMS__
diff --git a/data/mnet/Common/cli/include/defs.h b/data/mnet/Common/cli/include/defs.h
new file mode 100644
index 0000000..aa88fc8
--- /dev/null
+++ b/data/mnet/Common/cli/include/defs.h
@@ -0,0 +1,127 @@
+#ifndef _PARSER_DEFS_H
+#define _PARSER_DEFS_H
+
+#ifdef NONE
+#undef NONE
+#endif
+
+#define pname(x) PARSER_ ## x
+#define pdecl(x) extern transition pname(x)
+#define lpdecl(x) extern dynamic_transition pname(x);
+
+#define CSBOFF(elem) ((int) &((parseinfo*)NULL)->elem)
+#define CSBVAR(csb, offset, type) ((type *) ((u_char*) csb + offset))
+
+extern transition PARSER_NONE;
+
+pdecl(no_alt);
+pdecl(link_point);
+pdecl(link_trans);
+
+/*
+ * List structure for parser extension
+ */
+typedef const struct {
+ uint type; /* Type code */
+ dynamic_transition *commands; /* Transition pointer */
+} parser_extension_request;
+
+/*
+ * Extending the parser.
+ * Some brave soul should turn this into an enum and rearrange things
+ * intelligently.
+ */
+enum {
+ PARSE_LIST_END=0, /* End of list - not a real code */
+ PARSE_ADD_EXEC_CMD,
+ PARSE_ADD_SHOW_CMD,
+ PARSE_ADD_CLEAR_CMD,
+ PARSE_ADD_DEBUG_CMD,
+ PARSE_ADD_TERM_CMD, /* "term xxx" commands, not saved */
+ PARSE_ADD_CFG_TOP_CMD, /* top level config commands */
+ PARSE_ADD_GLOBAL_CMD, /* global commands */
+ PARSE_ADD_PING_CMD, /* exec ping commands */
+ PARSE_ADD_COPY_CMD, /* copy commands */
+ PARSE_ADD_COPYFILE_CMD, /* copy file commands */
+ PARSE_ADD_CFG_LAST_CMD, /* top level config commands at end */
+ PARSE_ADD_CFG_CDP, /* Cisco Discovery Protocol */
+ PARSE_ADD_WRITE_CMD, /* to add dynamic write commands */
+ PARSE_ADD_CFG_FILE_CMD, /* to add config file command */
+ PARSE_ADD_COPY_RUNNING_CMD, /* extending copy running-config */
+ PARSE_ADD_COPY_STARTUP_CMD, /* extending copy startup-config */
+ PARSE_ADD_COPY_FLASH_CMD, /* extending copy flash */
+ PARSE_ADD_COPY_DISK_CMD, /* extending copy disk cmd */
+ PARSE_ADD_COPY_TFTP_CMD, /* extending copy tftp cmd */
+ PARSE_ADD_COPY_RUNNING_FILE_CMD, /* extending copy running-config */
+ PARSE_ADD_COPY_STARTUP_FILE_CMD, /* extending copy startup-config */
+ PARSE_ADD_COPY_FLASH_FILE_CMD, /* extending copy flash */
+ PARSE_ADD_COPY_RCP_FILE_CMD, /* extending copy rcp */
+ PARSE_ADD_COPY_TFTP_FILE_CMD, /* extending copy tftp cmd */
+ PARSE_ADD_ERASE_CMD, /* to add erase file cmd */
+ PARSE_ADD_CFG_LOG_CMD, /* syslog history config cmd */
+ PARSE_ADD_SHOW_LOG_CMD, /* syslog history show cmd */
+ PARSE_ADD_GLOBAL_EXIT, /* Global command exit */
+ PARSE_ADD_SHOW_TECHSUPPORT_CMD, /* show tech-support commands */
+ PARSE_ADD_SHOW_TECHSUPPORT_EXIT, /* show tech-support exit */
+ PARSE_ADD_SHOW_REV_CMD, /* show revision commands */
+ PARSE_ADD_CFG_INTERFACE_TOP_CMD, /* Config Interface commands */
+ PARSE_ADD_CFG_CELL_CMD, /* config cell mode commands */
+ PARSE_ADD_CFG_ADJCELL_CMD, /* config adjacent cell mode commands */
+ PARSE_ADD_CFG_PROTO_CMD, /* config protocol mode commands */
+ PARSE_ADD_SHOW_STATS_CMD, /* show statistics */
+ PARSE_ADD_CLEAR_STATS_CMD, /* clear statistics */
+ PARSE_ADD_CFG_DNS_BOOM_CLIENT_TOP_CMD,/* Config dns-boomerang client cmds */
+ PARSE_ADD_CFG_DNS_BOOM_SERVER_TOP_CMD,/* Config dns-boomerang server cmds */
+ PARSE_ADD_CFG_GP10_CELL,
+ PARSE_ADD_CFG_GP10_ADJCELL,
+ PARSE_ADD_CFG_GP10_PROTO,
+ PARSE_ADD_CFG_GP10_CELL_TRX,
+ PARSE_ADD_CFG_GP10_CELL_BTS,
+ PARSE_ADD_CFG_GP10_CELL_CCCH,
+ PARSE_ADD_CFG_GMC_CAPS, /* Config GMC CAPS Paramaters */
+ PARSE_ADD_CFG_GMC_CCS, /* Config GMC CCS Paramaters */
+ PARSE_ADD_CFG_GMC_SYNAXIS, /* Config GMC SYNAXIS Paramaters */
+ PARSE_ADD_EXEC_SMSCB_SCHEDULE, /* Exec commands for SMS-CB Schedule Messages */
+ PARSE_ADD_EXEC_SMSCB_CHANGE, /* Exec commands for SMS-CB Change Messages */
+ PARSE_ADD_CFG_GMC_ITP, /* Config GMC ITP Paramaters */
+ PARSE_ADD_CFG_GMC_ITP_PATH /* Config GMC ITP Path Paramaters */
+
+};
+
+#ifdef PARSER_DEBUG_LINKS
+#define parser_add_commands(def, trans, str)\
+ parser_add_commands_func(def, trans, str)
+#define parser_add_command_list(list, str)\
+ parser_add_command_list_func(list, str)
+#define parser_add_link_point(def, str, trans)\
+ parser_add_link_point_func(def, str, trans)
+#define parser_add_link_exit(def, str, trans)\
+ parser_add_link_exit_func(def, str, trans)
+
+extern boolean parser_add_commands_func(uint, dynamic_transition *, const char *);
+extern boolean parser_add_command_list_func(parser_extension_request *,
+ const char *);
+extern boolean parser_add_link_point_func(uint, const char *, transition *);
+extern boolean parser_add_link_exit_func(uint, const char *, transition *);
+#else /* PARSER_DEBUG_LINKS */
+#define parser_add_commands(def, trans, str)\
+ parser_add_commands_func(def, trans)
+#define parser_add_command_list(list, str)\
+ parser_add_command_list_func(list)
+#define parser_add_link_point(def, str, trans)\
+ parser_add_link_point_func(def, trans)
+#define parser_add_link_exit(def, str, trans)\
+ parser_add_link_exit_func(def, trans)
+
+extern boolean parser_add_commands_func(uint, dynamic_transition *);
+extern boolean parser_add_command_list_func(parser_extension_request *);
+extern boolean parser_add_link_point_func(uint, transition *);
+extern boolean parser_add_link_exit_func(uint, transition *);
+#endif /* PARSER_DEBUG_LINKS */
+
+/*
+ * True during reading of the configuration from NVRAM
+ */
+extern boolean systemloading;
+
+#endif /* _PARSER_DEFS_H */
diff --git a/data/mnet/Common/cli/include/exec_clear.h b/data/mnet/Common/cli/include/exec_clear.h
new file mode 100644
index 0000000..f2c0d61
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_clear.h
@@ -0,0 +1,47 @@
+/* $Id: exec_clear.h,v 10.2 1999/02/12 03:19:54 sundars Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_clear.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_clear.h
+ * Description: clear - Reset Functions
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_clear.h,v $
+ * Revision 10.2 1999/02/12 03:19:54 sundars
+ * create a customer debug build; remove lots of junk printfs from
+ * customer builds;disable wccp when we suspend a task due to
+ * panic/exception etc.
+ * CSCdk92101: Make cli as the default on development
+ *
+ * Revision 10.1 1998/06/10 20:41:58 sutton
+ * code merge
+ *
+ * Revision 1.3 1997/12/05 18:17:43 pparthas
+ * Unhide the 'clear' command
+ * CSCdj39802: A command to clear serial interfaces
+ *
+ * Revision 1.2 1997/05/14 22:12:04 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+/******************************************************************/
+#ifdef MNET_GP10
+EOLNS (exec_clear_help_eol, clear_help_command);
+PRIV_TEST(exec_clear_help, exec_clear_help_eol, NONE,
+ exec_clear_commands, PRIV_CONF | PRIV_HIDDEN );
+
+KEYWORD (exec_clear, exec_clear_help, ALTERNATE,
+ "clear", "Reset functions", PRIV_CONF | PRIV_HIDDEN);
+
+#undef ALTERNATE
+#define ALTERNATE exec_clear
+
+#endif
diff --git a/data/mnet/Common/cli/include/exec_configure.h b/data/mnet/Common/cli/include/exec_configure.h
new file mode 100644
index 0000000..4f7f888
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_configure.h
@@ -0,0 +1,47 @@
+
+/* $Id: exec_configure.h,v 10.1 1998/06/10 20:41:59 sutton Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_configure.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_configure.h
+ * Description: configure commands
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_configure.h,v $
+ * Revision 10.1 1998/06/10 20:41:59 sutton
+ * code merge
+ *
+ * Revision 1.4 1997/10/11 00:51:07 pparthas
+ * Reverted to configure terminal , except that 'terminal' is now hidden
+ *
+ * Revision 1.3 1997/10/09 18:14:15 pparthas
+ * First Attempt to cleanup dead-code to reduce code-size; Included debug
+ * scheme in place
+ *
+ * Revision 1.2 1997/05/14 22:12:05 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+
+/*************************************************************n
+ * configure
+ *
+ */
+
+EOLS (exec_config_term_eol, manual_configure, PARSER_CONF_TERM);
+KEYWORD (exec_config_term, exec_config_term_eol, exec_config_term_eol,
+ "terminal", "Configure from Terminal", PRIV_ROOT | PRIV_HIDDEN);
+KEYWORD (exec_configure, exec_config_term, ALTERNATE,
+ "configure", "Enter configuration mode", PRIV_ROOT);
+
+#undef ALTERNATE
+#define ALTERNATE exec_configure
diff --git a/data/mnet/Common/cli/include/exec_debug.h b/data/mnet/Common/cli/include/exec_debug.h
new file mode 100644
index 0000000..606a2c9
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_debug.h
@@ -0,0 +1,46 @@
+/* $Id: exec_debug.h,v 10.1 1998/06/10 20:42:01 sutton Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_debug.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_debug.h
+ * Description: debug command support
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_debug.h,v $
+ * Revision 10.1 1998/06/10 20:42:01 sutton
+ * code merge
+ *
+ * Revision 1.3 1998/04/21 01:26:41 pparthas
+ * CLI Related changes / Undo log / Errno propagation
+ * CSCdj68847: CLI changes
+ *
+ * Revision 1.2 1997/05/14 22:12:06 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+EOLNS (exec_debug_help_eol, debug_help_command);
+PRIV_TEST(exec_debug_help, exec_debug_help_eol, NONE,
+ exec_debug_commands, PRIV_USER | PRIV_HIDDEN);
+
+KEYWORD_ID(exec_debug_false, exec_debug_help, no_alt,
+ sense, FALSE,
+ "debug", "Disable debugging functions",
+ PRIV_OPR);
+KEYWORD (exec_debug_no, exec_debug_false, ALTERNATE,
+ "no", "Disable debugging functions", PRIV_OPR);
+
+KEYWORD_ID(exec_debug_true, exec_debug_help, exec_debug_no,
+ sense, TRUE,
+ "debug", "Debugging functions", PRIV_OPR);
+
+#undef ALTERNATE
+#define ALTERNATE exec_debug_true
diff --git a/data/mnet/Common/cli/include/exec_debug_all.h b/data/mnet/Common/cli/include/exec_debug_all.h
new file mode 100644
index 0000000..4d78558
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_debug_all.h
@@ -0,0 +1,41 @@
+/* $Id: exec_debug_all.h,v 10.1 1998/06/10 20:42:02 sutton Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_debug_all.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_debug_all.h
+ * Description: debug all command support
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_debug_all.h,v $
+ * Revision 10.1 1998/06/10 20:42:02 sutton
+ * code merge
+ *
+ * Revision 1.3 1998/04/03 21:21:59 pparthas
+ * Changed EOLS macro to EOLI macro
+ * CSCdj89287: make the CLI callable from TCL
+ *
+ * Revision 1.2 1997/05/14 22:12:07 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+/******************************************************************
+ * debug all
+ *
+
+EOLI (debug_all_eol, debug_all_cmd, 0);
+KEYWORD (debug_all, debug_all_eol, ALTERNATE,
+ "all", "Enable all debugging", PRIV_OPR);
+
+
+#undef ALTERNATE
+#define ALTERNATE debug_all
+
+*/ \ No newline at end of file
diff --git a/data/mnet/Common/cli/include/exec_disable.h b/data/mnet/Common/cli/include/exec_disable.h
new file mode 100644
index 0000000..9ceb7cf
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_disable.h
@@ -0,0 +1,55 @@
+/* $Id: exec_disable.h,v 10.2 1999/03/18 01:23:08 sundars Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_disable.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_disable.h
+ * Description: disable command support
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_disable.h,v $
+ * Revision 10.2 1999/03/18 01:23:08 sundars
+ * CSCdm02577: No Context sensitive help available for disable and enable
+ * CLI comma
+ *
+ * Revision 10.1 1998/06/10 20:42:02 sutton
+ * code merge
+ *
+ * Revision 1.6 1998/04/21 01:26:41 pparthas
+ * CLI Related changes / Undo log / Errno propagation
+ * CSCdj68847: CLI changes
+ *
+ * Revision 1.5 1998/03/18 04:34:53 sutton
+ * Initial release of CLI/TCL integration.
+ * Still missing -- sysconf commit, sysconf abort,
+ * and interrupt character processing.
+ * Also changed the output pager (More processing) to
+ * be much simpler and universal for all commands.
+ * CSCdj89287: make the CLI callable from TCL
+ *
+ * Revision 1.4 1997/10/09 18:14:17 pparthas
+ * First Attempt to cleanup dead-code to reduce code-size; Included debug
+ * scheme in place
+ *
+ * Revision 1.3 1997/09/27 04:30:57 pparthas
+ * Removed levels for 'disable' command
+ *
+ * Revision 1.2 1997/05/14 22:12:07 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+EOLI (exec_disable_endline, enable_command, CMD_DISABLE);
+KEYWORD_ID(exec_disable, exec_disable_endline, ALTERNATE,
+ OBJ(int,1), DEFAULT_PRIV,
+ "disable", "Turn off privileged commands",
+ PRIV_ROOT);
+
+#undef ALTERNATE
+#define ALTERNATE exec_disable
diff --git a/data/mnet/Common/cli/include/exec_enable.h b/data/mnet/Common/cli/include/exec_enable.h
new file mode 100644
index 0000000..b498b16
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_enable.h
@@ -0,0 +1,58 @@
+/* $Id: exec_enable.h,v 10.2 1999/03/18 01:23:09 sundars Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_enable.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_enable.h
+ * Description: enable command
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_enable.h,v $
+ * Revision 10.2 1999/03/18 01:23:09 sundars
+ * CSCdm02577: No Context sensitive help available for disable and enable
+ * CLI comma
+ *
+ * Revision 10.1 1998/06/10 20:42:03 sutton
+ * code merge
+ *
+ * Revision 1.6 1998/04/21 01:26:42 pparthas
+ * CLI Related changes / Undo log / Errno propagation
+ * CSCdj68847: CLI changes
+ *
+ * Revision 1.5 1998/03/18 04:34:53 sutton
+ * Initial release of CLI/TCL integration.
+ * Still missing -- sysconf commit, sysconf abort,
+ * and interrupt character processing.
+ * Also changed the output pager (More processing) to
+ * be much simpler and universal for all commands.
+ * CSCdj89287: make the CLI callable from TCL
+ *
+ * Revision 1.4 1997/10/09 18:14:17 pparthas
+ * First Attempt to cleanup dead-code to reduce code-size; Included debug
+ * scheme in place
+ *
+ * Revision 1.3 1997/08/16 04:52:53 pparthas
+ * For now, got rid of 'Privilege Levels' in 'enable' command
+ *
+ * Revision 1.2 1997/05/14 22:12:08 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+/****************************************************************
+ * enable
+ */
+EOLI (enable_endline, enable_command, CMD_ENABLE);
+KEYWORD_ID(enable, enable_endline, ALTERNATE,
+ OBJ(int,1), PRIV_MAX,
+ "enable", "Turn on privileged commands",
+ PRIV_MIN | PRIV_INTERACTIVE);
+
+#undef ALTERNATE
+#define ALTERNATE enable
diff --git a/data/mnet/Common/cli/include/exec_exit.h b/data/mnet/Common/cli/include/exec_exit.h
new file mode 100644
index 0000000..9aa900e
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_exit.h
@@ -0,0 +1,45 @@
+/* $Id: exec_exit.h,v 10.1 1998/06/10 20:42:04 sutton Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_exit.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_exit.h
+ * Description: exit, quit - exit from the EXEC
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_exit.h,v $
+ * Revision 10.1 1998/06/10 20:42:04 sutton
+ * code merge
+ *
+ * Revision 1.3 1998/03/18 04:34:54 sutton
+ * Initial release of CLI/TCL integration.
+ * Still missing -- sysconf commit, sysconf abort,
+ * and interrupt character processing.
+ * Also changed the output pager (More processing) to
+ * be much simpler and universal for all commands.
+ * CSCdj89287: make the CLI callable from TCL
+ *
+ * Revision 1.2 1997/05/14 22:12:09 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+/******************************************************************
+ * exit, quit - exit from the EXEC
+ */
+extern void Logout(parseinfo *csb);
+EOLI (exec_quit_eol, exit_exec_command, CMD_QUIT);
+EOLI (exec_exit_eol, Logout, CMD_EXIT);
+KEYWORD (exec_quit, exec_quit_eol, ALTERNATE,
+ "quit", "Exit from the EXEC", PRIV_MIN | PRIV_HIDDEN | PRIV_INTERACTIVE);
+KEYWORD (exec_exit, exec_exit_eol, exec_quit,
+ "exit", "Exit from the EXEC", PRIV_MIN | PRIV_INTERACTIVE);
+
+#undef ALTERNATE
+#define ALTERNATE exec_exit
diff --git a/data/mnet/Common/cli/include/exec_help.h b/data/mnet/Common/cli/include/exec_help.h
new file mode 100644
index 0000000..8226936
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_help.h
@@ -0,0 +1,44 @@
+/* $Id: exec_help.h,v 10.2 1998/12/30 18:13:02 sundars Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_help.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_help.h
+ * Description: help command
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_help.h,v $
+ * Revision 10.2 1998/12/30 18:13:02 sundars
+ * Fix help texts for CLI commands
+ * CSCdk69292: CLI Command Descriptions When Entering a ?-Part 2
+ *
+ * Revision 10.1 1998/06/10 20:42:04 sutton
+ * code merge
+ *
+ * Revision 1.3 1997/10/09 18:14:18 pparthas
+ * First Attempt to cleanup dead-code to reduce code-size; Included debug
+ * scheme in place
+ *
+ * Revision 1.2 1997/05/14 22:12:09 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+/******************************************************************
+ * help
+ */
+
+EOLNS (exec_help_eol, exec_help_command);
+KEYWORD (exec_help, exec_help_eol, ALTERNATE,
+ "help", "Assistance for command line interface",
+ PRIV_MIN );
+
+#undef ALTERNATE
+#define ALTERNATE exec_help
diff --git a/data/mnet/Common/cli/include/exec_show.h b/data/mnet/Common/cli/include/exec_show.h
new file mode 100644
index 0000000..6dbb727
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_show.h
@@ -0,0 +1,35 @@
+/* $Id: exec_show.h,v 10.1 1998/06/10 20:42:06 sutton Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_show.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_show.h
+ * Description: show command
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_show.h,v $
+ * Revision 10.1 1998/06/10 20:42:06 sutton
+ * code merge
+ *
+ * Revision 1.2 1997/05/14 22:12:10 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+/******************************************************************/
+EOLNS (exec_show_help_eol, show_help_command);
+PRIV_TEST(exec_show_help, no_alt, no_alt,
+ exec_show_commands, PRIV_MIN);
+
+KEYWORD (exec_show, exec_show_help, ALTERNATE,
+ "show", "Show running system information", PRIV_MIN);
+
+#undef ALTERNATE
+#define ALTERNATE exec_show
diff --git a/data/mnet/Common/cli/include/exec_undebug.h b/data/mnet/Common/cli/include/exec_undebug.h
new file mode 100644
index 0000000..623e37c
--- /dev/null
+++ b/data/mnet/Common/cli/include/exec_undebug.h
@@ -0,0 +1,33 @@
+/* $Id: exec_undebug.h,v 10.1 1998/06/10 20:42:17 sutton Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/exec_undebug.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: exec_undebug.h
+ * Description: undebug command support
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: exec_undebug.h,v $
+ * Revision 10.1 1998/06/10 20:42:17 sutton
+ * code merge
+ *
+ * Revision 1.1 1998/04/21 01:57:17 pparthas
+ * CLI Changes
+ * CSCdj68847: CLI changes
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+/******************************************************************/
+KEYWORD_ID(exec_undebug, exec_debug_commands, ALTERNATE,
+ sense, FALSE,
+ "undebug", "Disable debugging functions (see also 'debug')",
+ PRIV_OPR);
+
+#undef ALTERNATE
+#define ALTERNATE exec_undebug
diff --git a/data/mnet/Common/cli/include/imc.h b/data/mnet/Common/cli/include/imc.h
new file mode 100644
index 0000000..ad6b5a0
--- /dev/null
+++ b/data/mnet/Common/cli/include/imc.h
@@ -0,0 +1,538 @@
+#ifndef _IMC_H_
+#define _IMC_H_
+
+/*
+===============================================================================
+
+ Modules have a request, indication, management queues that are anchored
+ in the IMC Queue Anchor.
+
+ IMC Q anchor block
+ ________
+ | |
+ | |------> MgmtQ
+ | |------> Expedited IndQ
+ | |------> Expedited ReqQ
+ | |------> ReqQ
+ | |------> IndQ
+ | |--|
+ |________| |
+ |
+ \|/ Next Module Anchor block
+
+===============================================================================
+*/
+
+#define MAX_IMC_COUNT 32
+
+
+
+struct imc_qanchor { /* IMC queue anchor */
+
+ NODE imc_element; /* List Element */
+ tSEMAPHORE semId; /* Couting Semaphore task is waiting on */
+ tUOCTET4 taskId; /* Task requesting IMC Services */
+ tOCTET4 workCount; /* Number of elements in Queues */
+ LIST pimc_mgmt; /* Management request queue */
+ LIST pimc_exp_ind; /* Expedited Indication queue */
+ LIST pimc_exp_req; /* Expedited request queue */
+ LIST pimc_ind; /* Normal Indication queue */
+ LIST pimc_req; /* Normal request queue */
+} ;
+
+typedef struct imc_qanchor tIMC_QANCHOR, *tpIMC_QANCHOR;
+
+/*
+ * Global Count Macro
+*/
+
+#define INCREMENT 1
+#define DECREMENT 2
+
+
+typedef enum IMC_QUEUE_TYPE {
+ MGMT_QUEUE = 0,
+ NREQ_QUEUE,
+ EREQ_QUEUE,
+ NIND_QUEUE,
+ EIND_QUEUE
+} IMC_QUEUE_TYPE;
+
+
+/* Convenience macro for mid queues */
+/* Use with caution by checking for NULL */
+
+#define mMID2Q(mid) pimcglp[(mid)]
+#define mMID2MGMT(mid) (&(mMID2Q((mid))->pimc_mgmt))
+#define mMID2EREQ(mid) (&(mMID2Q((mid))->pimc_exp_req))
+#define mMID2NREQ(mid) (&(mMID2Q((mid))->pimc_req))
+#define mMID2EIND(mid) (&(mMID2Q((mid))->pimc_exp_ind))
+#define mMID2NIND(mid) (&(mMID2Q((mid))->pimc_ind))
+#define mMID2SEM(mid) (mMID2Q((mid))->semId)
+
+#ifdef USE_IMC_MACROS
+
+#define mCHANGEGLOBALCOUNT(action) \
+ {\
+ if ( action == INCREMENT ) \
+ ++imc_global_count; \
+ else if ( action == DECREMENT ) {\
+ --imc_global_count; \
+ if ( imc_global_count < 0 ) { \
+ PSpanic("mCHANGEGLOBALCOUNT: Negative Count\n"); \
+ }\
+ }\
+ else { \
+ trace_Msg("\n%s: ", taskName( taskIdSelf() ));\
+ trace_Msg("mCHANGEGLOBALCOUNT:Invalid Action\n"); \
+ } \
+ }
+
+#define mTAKEINDEXSEM(which, rc ) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("Could not Take freeIndex Semaphore\n"); \
+ rc = RC_ERR; \
+ } else \
+ rc = RC_OK; \
+ }
+
+#define mGIVEINDEXSEM( which ) \
+ { \
+ if ( PSsemGive( freeIndexSemId) == ERROR) { \
+ PSpanic("Could not Give freeIndex Semaphore\n"); \
+ } \
+ }
+
+#define mCHECKMODULEIMC( which, mid,rc) \
+ { \
+ if (pimcglp[(mid)] == NULL ) { \
+ trace_Msg("NULL IMC Anchor for Destination %ld\n", \
+ mid ); \
+ rc = RC_ERR; \
+ } else \
+ rc = RC_OK; \
+ }
+
+
+
+/*
+ * POST service interaction macros
+ * Interaction post Failed if rc != RC_OK
+ * pComSim->destid is module id of destination
+ */
+
+#define mPOST_SIM_NREQ(pComSim, rc) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mPOST_SIM_NREQ:Could not get semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ else if (pimcglp[(pComSim)->destid] == NULL ) { \
+ trace_Msg("NULL IMC Anchor for Destination %ld", \
+ (pComSim)->destid ); \
+ rc = RC_ERR; \
+ } \
+ else if ( (rc=lstAdd((mMID2NREQ((pComSim)->destid)), \
+ &(pComSim)->simq)) == RC_OK ) { \
+ ++((pimcglp[(pComSim)->destid])->workCount); \
+ mCHANGEGLOBALCOUNT( INCREMENT ); \
+ if ( PSsemGive(mMID2SEM((pComSim)->destid)) == ERROR ) { \
+ PSpanic("mPOST_SIM_NREQ:Could not give Task semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mPOST_SIM_NREQ:Could not give Index semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ }
+
+#define mPOST_SIM_MGMT(pComSim, rc) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mPOST_SIM_MGMT:Could not get semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ else if ( (pimcglp[(pComSim)->destid] == NULL ) ) { \
+ trace_Msg("%s: ", taskName( taskIdSelf() ));\
+ trace_Msg("NULL IMC Anchor for Destination %ld" \
+ ,(pComSim)->destid ); \
+ rc = RC_ERR; \
+ } \
+ else if ( (rc=lstAdd((mMID2MGMT((pComSim)->destid)), \
+ &(pComSim)->simq)) == RC_OK ) { \
+ mCHANGEGLOBALCOUNT( INCREMENT ); \
+ ++((pimcglp[(pComSim)->destid])->workCount); \
+ if ( PSsemGive( mMID2SEM((pComSim)->destid))== ERROR ) { \
+ PSpanic("mPOST_SIM_MGMT:Could not give Task semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mPOST_SIM_MGMT:Could not give Index semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ }
+
+/* Post Normal Indication Failed if rc != RC_OK */
+#define mPOST_SIM_NIND(pComSim, rc) \
+ { \
+ if (PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mPOST_SIM_NIND:Could not get semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ else if (pimcglp[(pComSim)->destid] == NULL ) { \
+ trace_Msg("%s: ", taskName( taskIdSelf() ));\
+ trace_Msg("NULL IMC Anchor for Destination %ld", \
+ (pComSim)->destid ); \
+ rc = RC_ERR; \
+ } \
+ else if ( (rc=lstAdd((mMID2NIND((pComSim)->destid)), \
+ &((pComSim)->simq))) == RC_OK ) { \
+ ++((pimcglp[(pComSim)->destid])->workCount); \
+ mCHANGEGLOBALCOUNT( INCREMENT ); \
+ if ( PSsemGive( mMID2SEM((pComSim)->destid)) == ERROR ) { \
+ PSpanic("mPOST_SIM_NIND:Could not give Task semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mPOST_SIM_NIND:Could not give Index semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ }
+
+/* Post Expedited Request Failed if rc != RC_OK */
+#define mPOST_SIM_EREQ(pComSim, rc) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mPOST_SIM_EREQ:Could not get semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ else if ( (pimcglp[(pComSim)->destid] == NULL ) ) { \
+ trace_Msg("%s: ", taskName( taskIdSelf() ));\
+ trace_Msg("NULL IMC Anchor for Destination %ld", \
+ (pComSim)->destid ); \
+ rc = RC_ERR; \
+ } \
+ else if ( (rc=lstAdd(mMID2EREQ((pComSim)->destid), \
+ &(pComSim)->simq)) == RC_OK ) { \
+ mCHANGEGLOBALCOUNT( INCREMENT ); \
+ ++((pimcglp[(pComSim)->destid])->workCount); \
+ if ( PSsemGive( mMID2SEM((pComSim)->destid)) == ERROR ) { \
+ PSpanic("mPOST_SIM_EREQ:Could not give Task semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mPOST_SIM_EREQ:Could not give semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ }
+
+/* Post Expedited Indication Failed if rc != RC_OK */
+#define mPOST_SIM_EIND(pComSim, rc) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mPOST_SIM_EIND:Could not get semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ else if (pimcglp[(pComSim)->destid] == NULL ) { \
+ trace_Msg("%s: ", taskName( taskIdSelf() ));\
+ trace_Msg("NULL IMC Anchor for Destination %ld", \
+ (pComSim)->destid ); \
+ rc = RC_ERR; \
+ } \
+ if ( (rc=lstAdd(mMID2EIND((pComSim)->destid), \
+ &(pComSim)->simq)) == RC_OK ) { \
+ mCHANGEGLOBALCOUNT( INCREMENT ); \
+ ++((pimcglp[(pComSim)->destid])->workCount); \
+ if ( PSsemGive( mMID2SEM((pComSim)->destid)) == ERROR ) { \
+ PSpanic("mPOST_SIM_EIND:Could not give semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mPOST_SIM_EIND:Could not give semaphore\n"); \
+ rc = RC_ERR; \
+ } \
+ }
+
+/*
+ * GET Service interactions for a module, Indications first
+ */
+
+
+/* Call with pComSim == NULLP , mid == module id */
+/* get Management requests, expedited indications and requests first,
+ * then the normal indications and requests */
+
+/* Get Management work only */
+#define mGET_MGMT_WORK_SIM(pComSim, mid) \
+ { \
+ if (PSsemTake(freeIndexSemId, WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mGET_MGMT_WORK_SIM:Could not get semaphore\n"); \
+ } \
+ else if (pimcglp[(mid)] == NULL) { \
+ trace_Msg("mGET_MGMT_WORK_SIM:NULL IMC Anchor for Module %ld", \
+ (tUOCTET4)mid); \
+ pComSim = NULL; \
+ } \
+ else if (mMID2Q(mid)->workCount > 0 ) { \
+ tOCTET2 count = lstCount(mMID2MGMT(mid)); \
+ if (count < 0 ) { \
+ PSpanic("mGET_MGMT_WORK_SIM:Could not get count\n"); \
+ } \
+ else if ( count > 0 ){ \
+ pComSim = (tpCOMSIM)lstGet(mMID2MGMT(mid)); \
+ if (pComSim == NULL) { \
+ PSpanic("mGET_MGMT_WORK_SIM:NULL Sim Dequeued\n"); \
+ } \
+ mCHANGEGLOBALCOUNT( DECREMENT ); \
+ --((pimcglp[mid])->workCount); \
+ } \
+ } \
+ else { \
+ pComSim = NULL; \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mGET_MGMT_WORK_SIM:Could not give semaphore\n"); \
+ } \
+ }
+
+
+/* Get Normal Indication work only */
+
+#define mGET_NIND_WORK_SIM(pComSim, mid) \
+ { \
+ if ( PSsemTake(freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mGET_NIND_WORK_SIM:Could not get semaphore\n"); \
+ } \
+ else if ( mIS_THERE_WORK( (mid) ) ) { \
+ tOCTET2 count=lstCount(mMID2NIND((mid))); \
+ if (count < 0 ) { \
+ PSpanic("mGET_NIND_WORK_SIM:Could not get count\n"); \
+ }\
+ else if ( count > 0 ){ \
+ pComSim = (tpCOMSIM)lstGet(mMID2NIND(mid)); \
+ if (pComSim == NULL) { \
+ PSpanic("mGET_NIND_WORK_SIM:NULL Sim Dequeued\n"); \
+ } \
+ --((pimcglp[mid])->workCount); \
+ mCHANGEGLOBALCOUNT( DECREMENT ); \
+ } \
+ } else { \
+ pComSim = NULL; \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mGET_NIND_WORK_SIM:Could not give semaphore\n"); \
+ } \
+ }
+
+/* Get Expedited Indication work only */
+
+#define mGET_EIND_WORK_SIM(pComSim, mid) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mGET_EIND_WORK_SIM:Could not get semaphore\n"); \
+ } \
+ else if ( mIS_THERE_WORK( (mid) ) ) { \
+ tOCTET2 count=lstCount(mMID2EIND((mid))); \
+ if (count < 0 ) { \
+ PSpanic("mGET_EIND_WORK_SIM:Could not get count\n"); \
+ }\
+ else if ( count > 0 ){ \
+ pComSim = (tpCOMSIM)lstGet(mMID2EIND(mid)); \
+ if (pComSim == NULL) { \
+ trace_Msg("mGET_EIND_WORK_SIM:NULL Sim Dequeued\n"); \
+ } \
+ mCHANGEGLOBALCOUNT( DECREMENT ); \
+ --((pimcglp[mid])->workCount); \
+ } \
+ } else{ \
+ pComSim = NULL; \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mGET_EIND_WORK_SIM:Could not give semaphore\n"); \
+ } \
+ }
+
+/* Get Normal Request work only */
+
+#define mGET_NREQ_WORK_SIM(pComSim, mid) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mGET_NREQ_WORK_SIM:Could not get semaphore\n"); \
+ } \
+ else if ( mIS_THERE_WORK((mid))) { \
+ tOCTET2 count=lstCount(mMID2NREQ((mid))); \
+ if (count < 0 ) { \
+ PSpanic("mGET_NREQ_WORK_SIM:Could not get count\n"); \
+ } \
+ else if ( count > 0 ){ \
+ pComSim = (tpCOMSIM)lstCount(mMID2NREQ(mid)); \
+ if (pComSim == NULL) { \
+ PSpanic("mGET_NREQ_WORK_SIM:NULL Sim Dequeued\n"); \
+ } \
+ mCHANGEGLOBALCOUNT( DECREMENT ); \
+ --((pimcglp[mid])->workCount); \
+ } \
+ } else { \
+ pComSim = NULL; \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mGET_NREQ_WORK_SIM:Could not give semaphore\n"); \
+ } \
+ }
+
+/* Get Expedited Request work only */
+
+#define mGET_EREQ_WORK_SIM(pComSim, mid) \
+ { \
+ if ( PSsemTake( freeIndexSemId,WAIT_FOREVER ) == ERROR) { \
+ PSpanic("mGET_EREQ_WORK_SIM:Could not get semaphore\n"); \
+ } \
+ else if ( mIS_THERE_WORK((mid))) { \
+ tOCTET2 count=lstCount(mMID2EREQ((mid))); \
+ if (count < 0 ) { \
+ PSpanic("mGET_EREQ_WORK_SIM:Could not get count\n"); \
+ }\
+ else if ( count > 0 ){ \
+ pComSim = (tpCOMSIM)lstGet(mMID2EREQ(mid)); \
+ if (pComSim == NULL) { \
+ PSpanic("mGET_EREQ_WORK_SIM:NULL Sim Dequeued\n"); \
+ } \
+ mCHANGEGLOBALCOUNT( DECREMENT ); \
+ --((pimcglp[mid])->workCount); \
+ } \
+ } \
+ else { \
+ pComSim = NULL; \
+ } \
+ if ( PSsemGive( freeIndexSemId ) == ERROR) { \
+ PSpanic("mGET_EREQ_WORK_SIM:Could not give semaphore\n"); \
+ } \
+ }
+
+
+#else /* USE_IMC_MACROS */
+
+#define mCHANGEGLOBALCOUNT(action) \
+ imc_change_global_count( (action))
+
+#define mPOST_SIM_NREQ(pComSim, rc) \
+ rc = imc_post_sim( (pComSim), NREQ_QUEUE)
+
+#define mPOST_SIM_MGMT(pComSim, rc) \
+ rc = imc_post_sim( (pComSim), MGMT_QUEUE)
+
+/* Post Expedited Indication Failed if rc != RC_OK */
+#define mPOST_SIM_EIND(pComSim, rc) \
+ rc = imc_post_sim( (pComSim), EIND_QUEUE)
+
+/* Post Expedited Request Failed if rc != RC_OK */
+#define mPOST_SIM_EREQ(pComSim, rc) \
+ rc = imc_post_sim( (pComSim), EREQ_QUEUE)
+
+/* Post Normal Indication Failed if rc != RC_OK */
+#define mPOST_SIM_NIND(pComSim, rc) \
+ rc = imc_post_sim( (pComSim), NIND_QUEUE)
+
+/* Get Management work only */
+#define mGET_MGMT_WORK_SIM(pComSim, mid) \
+ imc_get_sim( &(pComSim), (mid), MGMT_QUEUE );
+
+/* Get Normal Indication work only */
+#define mGET_NIND_WORK_SIM(pComSim, mid) \
+ imc_get_sim( &(pComSim), (mid), NIND_QUEUE );
+
+/* Get Expedited Indication work only */
+#define mGET_EIND_WORK_SIM(pComSim, mid) \
+ imc_get_sim( &(pComSim), (mid), EIND_QUEUE );
+
+/* Get Normal Request work only */
+#define mGET_NREQ_WORK_SIM(pComSim, mid) \
+ imc_get_sim( &(pComSim), (mid), NREQ_QUEUE );
+
+/* Get Expedited Request work only */
+#define mGET_EREQ_WORK_SIM(pComSim, mid) \
+ imc_get_sim( &(pComSim), (mid), EREQ_QUEUE );
+
+
+#endif /* USE_IMC_MACROS */
+
+
+/* Get Request work only */
+
+#define mGET_REQ_WORK_SIM(pComSim, mid) \
+ { \
+ mGET_EREQ_WORK_SIM( pComSim, mid ); \
+ if ( pComSim == NULL ) { \
+ mGET_NREQ_WORK_SIM( pComSim, mid ); \
+ } \
+ }
+
+/* Get indication work only */
+
+#define mGET_IND_WORK_SIM(pComSim, mid) \
+ { \
+ mGET_EIND_WORK_SIM( pComSim, mid ); \
+ if ( pComSim == NULL ) { \
+ mGET_NIND_WORK_SIM( pComSim, mid ); \
+ } \
+ }
+
+
+
+/* Get Any work. Enforces a policy of servicing order */
+/* Management, Expedited Indication, Expedited Requests */
+/* Normal Indications, Normal Requests. The order given */
+/* is also exhaustive and hence can starve other queues */
+
+#define mGET_WORK_SIM(pComSim, mid) \
+ { \
+ mGET_MGMT_WORK_SIM( pComSim, mid ); \
+ if ( pComSim == NULL ) { \
+ mGET_EIND_WORK_SIM( pComSim, mid ); \
+ } \
+ if ( pComSim == NULL ){ \
+ mGET_EREQ_WORK_SIM( pComSim, mid ); \
+ } \
+ if ( pComSim == NULL ){ \
+ mGET_NREQ_WORK_SIM( pComSim, mid ); \
+ } \
+ if ( pComSim == NULL ){ \
+ mGET_NIND_WORK_SIM( pComSim, mid ); \
+ } \
+ }
+
+/* mIS_THERE_WORK(mid) returns TRUE or FALSE depending on whether there
+ is work for this module or not */
+
+#define mIS_THERE_WORK(mid) \
+ ( ( \
+ (mMID2Q((mid)) == NULL ) ? FALSE : \
+ (mMID2Q((mid))->workCount > 0 ) ? \
+ TRUE : FALSE ) )
+
+/* checks if there is work in any of the imc queues */
+
+#define mANY_WORK imc_global_count
+
+/* exported by imc.c */
+extern tOCTET4 imc_global_count; /* keeps track of the TOTAL number
+ of entries in the imc facility */
+extern LIST *pimcListHead; /* Pointer to IMC ListHead */
+extern tpIMC_QANCHOR pimcglp[MAX_IMC_COUNT];
+/* Global MUTEX Semaphores */
+extern tSEMAPHORE freeIndexSemId; /* Protect freeIndex and hence IMC */
+extern boolean imcInited;
+extern void imc_term(void);
+extern tOCTET2 imc_init( void );
+extern tOCTET2 imc_add( tpOCTET4 index, tSEMAPHORE semId, tTASKID taskId );
+extern tOCTET2 imc_remove( tUOCTET4 index );
+extern tOCTET2 imc_post_sim(tpCOMSIM , IMC_QUEUE_TYPE);
+extern void imc_get_sim( tpCOMSIM *, tUOCTET4 , IMC_QUEUE_TYPE);
+
+#endif /* _IMC_H_ */
diff --git a/data/mnet/Common/cli/include/imsg.h b/data/mnet/Common/cli/include/imsg.h
new file mode 100644
index 0000000..45f3cc2
--- /dev/null
+++ b/data/mnet/Common/cli/include/imsg.h
@@ -0,0 +1,179 @@
+#ifndef _IMSG_H_
+#define _IMSG_H_
+/*
+-------------------------------------------------------------------------------
+ The common service interaction header
+-------------------------------------------------------------------------------
+*/
+
+struct com_sim {
+ NODE simq; /* queue element */
+ tUOCTET4 ownership; /* if 0, it can be freed */
+ tUOCTET4 origid; /* originators module id */
+ tUOCTET4 destid; /* destination module id */
+ tUOCTET4 requestid; /* request id generated by orig.*/
+ tUOCTET4 serviceid; /* service interaction id */
+ tUOCTET4 status; /* carries return codes */
+ SEM_ID ownerSemId; /* Semaphore for ownership */
+ void *pLayerSim; /* pointer to module-specific sim */
+} ;
+
+typedef struct com_sim tCOMSIM, *tpCOMSIM;
+
+struct idval {
+ tOCTET4 id; /* Identifier */
+ void* value; /* Value */
+};
+
+typedef struct idval tIDVAL, *tpIDVAL;
+
+#define MAX_CFG_ID_VAL 5
+
+struct mgmt_sim {
+ tCOMSIM comsim; /* Common SIM */
+ tUOCTET4 nid;
+ tIDVAL idvals[MAX_CFG_ID_VAL];
+ boolean sense;
+ SEM_ID configSemId;
+ int inFd;
+ int outFd;
+};
+
+#define mGETID(pSim,index) (pSim)->idvals[(index)-1].id
+#define mGETVAL(pSim,index) (pSim)->idvals[(index)-1].value
+
+#define mSETID( pSim,index,id ) mID((pSim),(index)) = (id)
+#define mSETVAL( pSim,index,val ) mID((pSim),(index)) = (val)
+
+typedef struct mgmt_sim tMGMTSIM, *tpMGMTSIM;
+
+/*
+------------------------------------------------------------------------------
+ SIM manipulation macros
+------------------------------------------------------------------------------
+*/
+#define IMCcalloc(nelem, elemSize) PScalloc((nelem), (elemSize))
+#define IMCmalloc(elemSize) PSmalloc((elemSize))
+#define IMCrealloc(elemPtr, elemSize) PSrealloc((elemPtr), (elemSize))
+#define IMCfree(elemPtr) PSfree((elemPtr))
+
+
+
+#define mGETSIM(size) imsg_getsim( (size) )
+
+#define mFREEMGMTSIM(pSim) \
+ { \
+ mFREESIM( &(pSim->comsim) ); \
+ }
+#ifndef USE_IMC_MACROS
+#define mFREESIM(pSim) imsg_freesim( (pSim))
+#else
+#define mFREESIM(pSim) \
+ { \
+ if ( PSsemTake(((tpCOMSIM)(pSim))->ownerSemId,\
+ WAIT_FOREVER ) == ERROR ) { \
+ PSpanic("Could not Take Ownership Semaphore "); \
+ }\
+ else if ( ((tpCOMSIM)(pSim))->ownership == 0) { \
+ if( ((tpCOMSIM)(pSim))->pLayerSim ) \
+ PSfree(((tpCOMSIM)(pSim))->pLayerSim); \
+ PSsemDelete(((tpCOMSIM)(pSim))->ownerSemId); \
+ PSfree((tpCOMSIM)pSim);\
+ } else {\
+ --((tpCOMSIM)(pSim))->ownership;\
+ if (PSsemGive(((tpCOMSIM)(pSim))->ownerSemId) == ERROR ) {\
+ PSpanic("mFREESIM:Could not Give Ownership Semaphore\n"); \
+ }\
+ }\
+ }
+#endif /* USE_IMC_MACROS */
+
+#define mSIMCOPY(pDestsim, pSrcSim) \
+ { \
+ PSsemTake(((tpCOMSIM)(pSrcSim))->ownerSemId, WAIT_FOREVER ); \
+ ((tpCOMSIM)(pSrcSim))->ownership++; \
+ pDestSim = pSrcSim; \
+ PSsemGive(((tpCOMSIM)(pSrcSim))->ownerSemId); \
+ }
+
+#define mZEROSIM(pSim) imsg_zerosim( (pSim) )
+
+#define mFILL_COM_SIM( pComSim, origin, dest, service, request, pLayer,owner, \
+ moreStatus )\
+ { \
+ if ( !pComSim ) { \
+ PSpanic("NULL SIM in mFILL_COM_SIM\n"); \
+ } \
+ else { \
+ pComSim->ownership = owner; \
+ pComSim->origid = origin; \
+ pComSim->destid = dest; \
+ pComSim->requestid = request; \
+ pComSim->serviceid = service; \
+ pComSim->pLayerSim = pLayer; \
+ pComSim->status = moreStatus; \
+ } \
+ }
+
+#define mSIM_ORIG(pGsim) ((pGsim)->origid)
+#define mSIM_DEST(pGsim) ((pGsim)->destid)
+#define mSIM_REQ(pGsim) ((pGsim)->requestid)
+#define mSIM_SERV(pGsim) ((pGsim)->serviceid)
+
+
+
+/*
+-------------------------------------------------------------------------------
+ Service interaction codes for the various modules, bottom up
+ Recomended convention for 4 byte service code:
+
+ [0][1][2][3]
+
+ byte 0: service provider id
+ byte 1: direction 1: request, 2 indication
+ byte 2, 3 service class
+
+-------------------------------------------------------------------------------
+*/
+
+#define MODULE_MASK 0xF000
+#define DIRECTION_MASK 0x0200
+#define SERVICE_CLASS_MASK 0x00FF
+ /* service to module */
+
+#define REQ_MASK 0x0100 /* Request Mask */
+#define IND_MASK 0x0200 /* Indication Mask*/
+
+#define IS_REQUEST(serviceid) ((serviceid) & REQ_MASK )
+#define IS_INDICATION(serviceid) ((serviceid) & IND_MASK )
+
+
+/* Get moduleid from service id */
+#define S2L(serviceid) ( ((serviceid)&LAYER_MASK) >> 12 )
+
+/* Service interaction codes */
+#define TEST_MODULE 0x00 /* Test Module */
+#define SMTPCL_MODULE 0x01 /* SMTP Client Module */
+#define HTTP_MODULE 0x02 /* Http Module */
+#define PARSER_MODULE 0x03 /* Parser Module */
+#define TIMER_MODULE 0x04 /* timer service */
+#define ACL_MODULE 0x05 /* ACL Module */
+#define CAPS_MODULE 0x06 /* CAPS Module */
+
+#define LAST_MODULE CAPS_MODULE
+
+#define ASSIGN_MODULE_ID -1
+
+/*
+**
+** Intermodule service access points
+**
+*/
+/* exported by imsg.c */
+#ifndef USE_IMC_MACROS
+extern void imsg_freesim( tpCOMSIM );
+#endif
+extern tpCOMSIM imsg_getsim (tOCTET4 );
+extern void imsg_zerosim (tpCOMSIM );
+
+#endif /* _IMSG_H_ */
diff --git a/data/mnet/Common/cli/include/macros.h b/data/mnet/Common/cli/include/macros.h
new file mode 100644
index 0000000..8b7d73b
--- /dev/null
+++ b/data/mnet/Common/cli/include/macros.h
@@ -0,0 +1,652 @@
+#ifndef __MACROS_H
+#define __MACROS_H
+
+/*
+ * Common help strings
+ */
+extern const char parser_help_default_keyword[];
+extern const char parser_help_no_keyword[];
+extern const char parser_default_keyword[];
+extern const char parser_no_keyword[];
+
+
+#ifdef BOOT
+#define PHELP(str) NULL
+#else BOOT
+#define PHELP(str) str
+#endif BOOT
+
+#define OBJ(type,num) PTYPE_ ## type ## ( ## num ## )
+
+#define pfdecl(x) extern void x (parseinfo *)
+
+#define TRANS_PRIV(name, priv)\
+ static trans_priv P ## name =\
+ {\
+ (priv),\
+ (priv),\
+ TRANS_PRIV_FLAGS_SET(priv),\
+ 0\
+ }
+
+
+#define NOP(name, acc, alt)\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) NOP_action, NULL}
+
+#define LINK_POINT(name, acc)\
+ static dynamic_transition pname(name) =\
+ {\
+ (dynamic_transition *)&pname(acc),\
+ (dynamic_transition *)&pname(link_point),\
+ (trans_func) NOP_action,\
+ NULL\
+ }
+
+#define LINK_TRANS(name, acc)\
+ static dynamic_transition pname(L ## name) =\
+ {\
+ (dynamic_transition *)&pname(NONE),\
+ (dynamic_transition *)&pname(link_trans),\
+ (trans_func) NOP_action,\
+ NULL\
+ };\
+ static transition pname(name) = {(transition *) &pname(L ## name),\
+ &pname(acc),\
+ (trans_func) NOP_action, NULL}
+
+#define LINK_EXIT(name, acc)\
+ LINK_TRANS(name, acc)
+
+#define NVGENS(name, acc, func, subfunc)\
+ pfdecl(func);\
+ static nvgens_struct L ## name = {func, subfunc};\
+ static transition pname(name) = {&pname(acc), NULL,\
+ (trans_func) nvgens_action, & L ## name}
+
+#define NVGENNS(name, acc, func)\
+ pfdecl(func);\
+ static transition pname(name) =\
+ {\
+ &pname(acc),\
+ NULL,\
+ (trans_func) nvgenns_action,\
+ func\
+ }
+
+#define EOLNS(name,func)\
+ pfdecl(func);\
+ static transition pname(name) =\
+ {\
+ NULL,\
+ NULL,\
+ (trans_func) eolns_action,\
+ func\
+ }
+
+#define EOLS(name,func,subfunc)\
+ pfdecl(func);\
+ static eols_struct L ## name = {func, subfunc};\
+ static transition pname(name) = {NULL, NULL, (trans_func) eols_action, & L ## name}
+
+#define EOLI(name,func,subfunc)\
+ pfdecl(func);\
+ static eols_struct L ## name = {func, subfunc};\
+ static transition pname(name) = {NULL, NULL, (trans_func) eoli_action, & L ## name}
+
+#define HELP(name,alt,str)\
+ static help_struct L ## name = {PHELP(str), NULL};\
+ static transition pname(name) = {NULL, &pname(alt), (trans_func) help_action, & L ## name}
+
+#define GENERAL_STRING(name, acc, alt, str, help, flags)\
+ static general_string_struct L ## name =\
+ {\
+ CSBOFF(str),\
+ PHELP(help),\
+ flags\
+ };\
+ static transition pname(name) =\
+ {\
+ &pname(acc),\
+ &pname(alt),\
+ (trans_func) general_string_action,\
+ & L ## name\
+ }
+
+/* A string delimited by whitespace. */
+#define STRING(name, acc, alt, str, help)\
+ GENERAL_STRING(name, acc, alt, str, help,\
+ STRING_QUOTED | STRING_HELP_CHECK)
+
+/* A string delimited by EOL. */
+#define TEXT(name, acc, alt, str, help)\
+ GENERAL_STRING(name, acc, alt, str, help,\
+ STRING_WS_OK | STRING_HELP_CHECK)
+
+/*
+ * Testing Macros
+ */
+
+/* ASSERT - assert that a C expression is true */
+
+#define TEST_EXPR(name, true, false, alt, expr)\
+ static boolean F ## name (parseinfo *csb, transition *mine)\
+ {\
+ return((expr) != 0);\
+ }\
+ static testexpr_struct L ## name = {&pname(false), F ## name};\
+ static transition pname(name) = {&pname(true), &pname(alt),\
+ (trans_func) testexpr_action, & L ## name}
+
+#define ASSERT(name, acc, alt, expr)\
+ TEST_EXPR(name, acc, NONE, alt, expr)
+
+#define IFELSE(name, if, else, expr)\
+ TEST_EXPR(name, if, else, NONE, expr)
+
+/* EVAL - always accept, and evaluate a C expression */
+
+#define EVAL(name,acc,expr)\
+ static void F ## name (parseinfo *csb, transition *mine)\
+ { expr;push_node(csb, mine->accept); }\
+ static transition pname(name) = {&pname(acc), NULL, (trans_func) F ## name, NULL}
+
+/* TESTVAR - test a variable relative to a constant value */
+
+#define TESTVAR(name, equal, notequal, lt, gt, alt, var, val)\
+ static test_struct L ## name = {CSBOFF(var), (uint) val,\
+ &pname(equal), &pname(notequal),\
+ &pname(lt), &pname(gt)};\
+ static transition pname(name) = {NULL, &pname(alt),\
+ (trans_func) test_action, & L ## name}
+
+
+/* Relations simpler than TESTVAR in its entirity */
+
+#define EQUAL(name, acc, alt, var, val)\
+ TESTVAR(name, acc, NONE, NONE, NONE, alt, var, val)
+#define NEQ(name, acc, alt, var, val)\
+ TESTVAR(name, NONE, acc, NONE, NONE, alt, var, val)
+#define SPLIT(name, acc, alt, var, val)\
+ TESTVAR(name, acc, alt, NONE, NONE, NONE, var, val)
+
+/* SET - always accept, setting a variable to a constant value */
+
+#define SET(name, acc, var, val)\
+ static set_struct L ## name = {CSBOFF(var), (uint) val};\
+ static transition pname(name) = {&pname(acc), NULL,\
+ (trans_func) set_action, & L ## name}
+
+/*
+ * KEYWORD is a complete token, with help, error handling and whitespace.o
+ * KEYWORD_OPTWS has optional trailing white-space.
+ * KEYWORD_NOWS has no trailing white-space.
+ * KEYWORD_MM takes an extra argument for the minimum number of chars required
+ * to match.
+ */
+
+#define GENERAL_KEYWORD(name,acc,alt,str,help,priv,var,val,match,flags)\
+ TRANS_PRIV(name, priv);\
+ static general_keyword_struct L ## name = {str, PHELP(help), & P ## name,\
+ var, val, match, flags};\
+ static transition pname(name) = {&pname(acc),&pname(alt),\
+ (trans_func) general_keyword_action, & L ## name}
+
+#define KEYWORD(name, acc, alt, str, help, priv)\
+ TRANS_PRIV(name, priv);\
+ static keyword_struct L ## name = {str, PHELP(help), & P ## name};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_action, & L ## name}
+
+#define KEYWORD_OPTWS(name,acc,alt,str,help, priv)\
+ TRANS_PRIV(name, priv);\
+ static keyword_struct L ## name = {str, PHELP(help), & P ## name};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_optws_action, & L ## name}
+
+#define KEYWORD_OPTIONS(name, acc, alt, options, var, priv, flags)\
+ TRANS_PRIV(name, priv);\
+ static keyword_option_struct L ## name =\
+ {\
+ options,\
+ CSBOFF(var),\
+ & P ## name,\
+ flags\
+ };\
+ static transition pname(name) =\
+ {\
+ &pname(acc),\
+ &pname(alt),\
+ (trans_func) keyword_option_action,\
+ & L ## name\
+ }
+
+#define KEYWORD_MM(name,acc,alt,str,help, priv, count)\
+ TRANS_PRIV(name, priv);\
+ static keyword_mm_struct L ## name = {str, PHELP(help), & P ## name, count};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_mm_action, & L ## name}
+
+#define KEYWORD_ID(name, acc, alt, var, val, str, help, priv)\
+ TRANS_PRIV(name, priv);\
+ static keyword_id_struct L ## name = {str,PHELP(help),&P##name,CSBOFF(var),val};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_id_action, & L ## name}
+/*
+ * If parse keyword
+ * var |= val
+ */
+#define KEYWORD_OR(name, acc, alt, var, val, str, help, priv)\
+ TRANS_PRIV(name, priv);\
+ static keyword_id_struct L ## name = {str,PHELP(help),&P##name,CSBOFF(var),val};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_orset_action, & L ## name}
+
+/*
+ * Number macros
+ */
+
+#define GENERAL_NUMBER(name,acc,alt,var,lower,upper,help,flags)\
+ static number_struct L ## name = {CSBOFF(var), lower, upper, PHELP(help), flags};\
+ static transition pname(name) =\
+ {&pname(acc), &pname(alt), (trans_func) general_number_action, & L##name}
+
+#define NUMBER(name, acc, alt, var, lower, upper, help)\
+ GENERAL_NUMBER(name, acc, alt, var, lower, upper, help,\
+ (NUMBER_HEX | HEX_ZEROX_OK | NUMBER_OCT | OCT_ZERO_OK |\
+ NUMBER_DEC | NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+#define DECIMAL(name, acc, alt, var, lower, upper, help)\
+ GENERAL_NUMBER(name, acc, alt, var, lower, upper, help,\
+ (NUMBER_DEC | NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+/* HEXADECIMAL matches an unsigned hex number, minimum one
+ * digit, and assigns it to a int. This function works on numbers
+ * which don't begin with '0x'. */
+
+#define HEXADECIMAL(name,acc,alt,var)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, NULL,\
+ (NUMBER_HEX | HEX_NO_ZEROX_OK | NUMBER_NO_WS_OK))
+
+#define HEXNUM(name, acc, alt, var, help)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, help,\
+ (NUMBER_HEX | HEX_NO_ZEROX_OK | NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+
+/*
+ * This is an OCTAL number, with help, error handling and
+ * whitespace
+ */
+#define OCTAL(name,acc,alt,var,help)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, help,\
+ (NUMBER_OCT | OCT_ZERO_OK | OCT_NO_ZERO_OK |\
+ NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+#define SIGNED_DEC(name,acc,alt,var,lower,upper,help)\
+ static signed_number_struct L ## name = {CSBOFF(var), lower, upper, PHELP(help)};\
+ static transition pname(name) =\
+ {&pname(acc), &pname(alt), (trans_func) signed_number_action, & L##name}
+
+/* NOPREFIX
+ * Go to 'accept' if there isn't a 'no' prefix.
+ * Consume the remainder of the input and go to 'alt' if there
+ * was a 'no' prefix. This is somewhat backwards from other macros
+ * in that the major action takes place before going to the alternate
+ * state, but it keeps the major thread of the command token chains
+ * similar to other tokens.
+ */
+#define NOPREFIX(name, acc, alt)\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) noprefix_action, NULL}
+
+
+/* IPADDR gets an IP address and stores it in addr.
+ * IPADDR_NAME gets an IP address or hostname and
+ * converts to an address stored in addr.
+ */
+#define IPADDR_NAME(name, acc, alt, addr, help)\
+ static addrparse_struct L ## name = {CSBOFF(addr), PHELP(help), ADDR_IP,\
+ ADDR_NAME_LOOKUP};\
+ static transition pname(name) = {& pname(acc), & pname(alt),\
+ (trans_func) generic_addr_action, & L ## name}
+
+#define IPADDR(name,acc,alt,addr, help)\
+ static addrparse_nf_struct L ## name = {CSBOFF(addr), PHELP(help), ADDR_IP};\
+ static transition pname(name) = {& pname(acc), & pname(alt),\
+ (trans_func) generic_addr_noflag_action, & L ## name}
+
+
+/* DAY - A day of the week */
+
+#define DAY(name,acc,alt,var,help) \
+ static day_struct L ## name = {CSBOFF(var), PHELP(help)};\
+ static transition pname(name) =\
+ {&pname(acc), &pname(alt), (trans_func) day_action, & L##name}
+
+/* MONTH - A month of the year */
+
+#define MONTH(name,acc,alt,var,help) \
+ static month_struct L ## name = {CSBOFF(var), PHELP(help)};\
+ static transition pname(name) =\
+ {&pname(acc), &pname(alt), (trans_func) month_action, & L##name}
+
+#define GENERAL_TIME(name, acc, alt, var1, var2, var3, help)\
+ static timesec_struct L ## name =\
+ {\
+ var1,\
+ var2,\
+ var3,\
+ help\
+ };\
+ static transition pname(name) =\
+ {\
+ &pname(acc),\
+ &pname(alt),\
+ (trans_func) timesec_action,\
+ & L ## name\
+ }
+
+/* TIME - A time (24 hours, without seconds) */
+#define ATIME(name, acc, alt, var1, var2, help)\
+ GENERAL_TIME(name, acc, alt, CSBOFF(var1),\
+ CSBOFF(var2), MAXUINT, help)
+
+/* TIMESEC - A time (24 hours, with seconds) */
+#define TIMESEC(name, acc, alt, var1, var2, var3, help)\
+ GENERAL_TIME(name, acc, alt, CSBOFF(var1),\
+ CSBOFF(var2), CSBOFF(var3), help)
+
+#define TEST_MULTIPLE_FUNCS(name, equal, notequal, alt)\
+ static test_struct L ## name = {0, 0, &pname(equal), &pname(notequal), NULL, NULL};\
+ static transition pname(name) = {NULL, &pname(alt),\
+ (trans_func) multiple_funcs_action, & L ## name}
+
+#define PRIV_TEST(name, acc, fail, alt, priv)\
+ TRANS_PRIV(name, priv);\
+ static priv_struct L ## name = {& P ## name, &pname(fail)};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) priv_action, & L ## name}
+
+#define NVCOMMENT(name, acc)\
+ static transition pname(name) =\
+ {\
+ &pname(acc),\
+ &pname(NONE),\
+ (trans_func) comment_action,\
+ NULL\
+ }
+
+#define NO_OR_DEFAULT(name, acc, flags) \
+ SET (name ## setsense, acc, sense, FALSE); \
+ KEYWORD (name, name ## setsense, acc, \
+ parser_no_keyword, parser_help_no_keyword, flags);
+
+
+
+#define IPADDR_MASK(name, acc, alt, addr, mask, help)\
+ static ipaddrmask_struct L ## name = { CSBOFF(addr), CSBOFF(mask), help};\
+ static transition pname(name) = {& pname(acc), & pname(alt),\
+ (trans_func) ipaddrmask_action, & L ## name}
+
+#define IPMASK(name,acc,alt,mask, help)\
+ static ipmask_struct L ## name = {CSBOFF(mask), PHELP(help)};\
+ static transition pname(name) = {& pname(acc), & pname(alt),\
+ (trans_func) ipmask_action, & L ## name}
+
+#define FUNC(name, acc, func)\
+ pfdecl(func);\
+ static transition pname(name) = {&pname(acc), NULL, (trans_func) func_action, func}
+
+#ifdef IOS_PARSER
+
+#define WHITESPACE(name,acc,alt)\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) whitespace_action, NULL}
+
+#define PRINT(name,acc,str)\
+ static print_struct L ## name = {str};\
+ static transition pname(name) = {&pname(acc), NULL, (trans_func) print_action, & L ## name}
+
+#define DISPLAY(name,acc,str)\
+ static help_struct L ## name = {PHELP(str), NULL};\
+ static transition pname(name) = {NULL, &pname(acc),\
+ (trans_func) display_action, & L ## name}
+
+#define VAR_STRING(name, acc, alt, str) \
+ GENERAL_STRING(name, acc, alt, str, NULL, STRING_QUOTED)
+
+#define CHARACTER(name,acc,alt,character)\
+ static char_struct L ## name = {character};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) char_action, & L ## name}
+
+#define CHAR8_NUMBER(name, acc, alt, var, help)\
+ static number_struct L ## name = {CSBOFF(var), 0, 255, PHELP(help), 0};\
+ static transition pname(name) = \
+ {&pname(acc), &pname(alt), (trans_func) char_number_action, & L ## name}
+
+#define FUNC(name, acc, func)\
+ pfdecl(func);\
+ static transition pname(name) = {&pname(acc), NULL, (trans_func) func_action, func}
+
+
+#define TXT_LINE(name, acc, alt, str)\
+ GENERAL_STRING(name, acc, alt, str, NULL, STRING_WS_OK)
+
+#define CHAR_NUMBER(name, acc, alt, var, help)\
+ static number_struct L ## name = {CSBOFF(var), 0, 127, PHELP(help), 0};\
+ static transition pname(name) = \
+ {&pname(acc), &pname(alt), (trans_func) char_number_action, & L ## name}
+
+#define TEST_BOOLEAN(name, nonzero, zero, alt, var)\
+ static test_bool_struct L ## name = {&var, &pname(zero), &pname(nonzero)};\
+ static transition pname(name) = {NULL, &pname(alt),\
+ (trans_func) test_boolean_action, & L ## name}
+
+#define TEST_INT(name, nonzero, zero, alt, var)\
+ static test_int_struct L ## name = {&var, &pname(zero), &pname(nonzero)};\
+ static transition pname(name) = {NULL, &pname(alt),\
+ (trans_func) test_int_action, & L ## name}
+
+#define TEST_FUNC(name, nonzero, zero, alt, func)\
+ static test_func_struct L ## name = {func, &pname(zero), &pname(nonzero)};\
+ static transition pname(name) = {NULL, &pname(alt),\
+ (trans_func) test_func_action, & L ## name}
+
+#define TEST_IDBSTATUS(name, true, false, alt, val)\
+ static test_idbstatus_struct L ## name = {&pname(false), val};\
+ static transition pname(name) = {&pname(true), &pname(alt),\
+ (trans_func) test_idbstatus_action, & L ## name}
+
+#define KEYWORD_DEBUG(name, acc, alt, var, val, str, help, priv)\
+ KEYWORD_ID(name, acc, alt, var, (uint) val, str, help, priv)
+
+#define KEYWORD_ID_MM(name, acc, alt, var, val, str, help, priv, count)\
+ TRANS_PRIV(name, priv);\
+ static keyword_id_mm_struct L ## name = {str,PHELP(help),&P##name,CSBOFF(var),val,count};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_id_mm_action, & L ## name}
+
+#define KEYWORD_TRANS(name, link, acc, alt, str, help, priv)\
+ LINK_TRANS(link, acc);\
+ TRANS_PRIV(name, priv);\
+ static keyword_struct L ## name =\
+ {\
+ str,\
+ PHELP(help),\
+ & P ## name\
+ };\
+ static transition pname(name) =\
+ {\
+ &pname(link),\
+ &pname(alt),\
+ (trans_func) keyword_trans_action,\
+ & L ## name\
+ }
+
+/*
+ * If !(var & val) and parse keyword
+ * var |= val
+ */
+#define KEYWORD_ORTEST(name, acc, alt, var, val, str, help, priv)\
+ TRANS_PRIV(name, priv);\
+ static keyword_id_struct L ## name = {str,PHELP(help),&P##name,CSBOFF(var),val};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_ortest_action, & L ## name}
+
+#define KEYWORD_OPTIONS(name, acc, alt, options, var, priv, flags)\
+ TRANS_PRIV(name, priv);\
+ static keyword_option_struct L ## name =\
+ {\
+ options,\
+ CSBOFF(var),\
+ & P ## name,\
+ flags\
+ };\
+ static transition pname(name) =\
+ {\
+ &pname(acc),\
+ &pname(alt),\
+ (trans_func) keyword_option_action,\
+ & L ## name\
+ }
+
+#define KEYWORD_NOWS(name,acc,alt,str,help, priv)\
+ TRANS_PRIV(name, priv);\
+ static keyword_struct L ## name = {str, PHELP(help), & P ## name};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) keyword_nows_action, & L ## name}
+
+
+#define PERMIT_DENY(name, acc, alt, var, priv)\
+ KEYWORD_OPTIONS(name, acc, alt, permitdeny_options, var, priv, 0);
+
+#define NUMBER_NV(name, acc, alt, var, lower, upper, help)\
+ GENERAL_NUMBER(name, acc, alt, var, lower, upper, help,\
+ (NUMBER_HEX | HEX_ZEROX_OK | NUMBER_OCT | OCT_ZERO_OK |\
+ NUMBER_DEC | NUMBER_WS_OK | NUMBER_HELP_CHECK |\
+ NUMBER_NV_RANGE))
+
+/* Handle a decimal number, without help and whitespace. */
+#define IDECIMAL(name,acc,alt,var,lower,upper)\
+ GENERAL_NUMBER(name, acc, alt, var, lower, upper, NULL,\
+ (NUMBER_DEC | NUMBER_NO_WS_OK))
+
+/* Handle a decimal number, without help and whitespace. */
+#define INUMBER(name,acc,alt,var,lower,upper)\
+ GENERAL_NUMBER(name, acc, alt, var, lower, upper, NULL,\
+ (NUMBER_HEX | HEX_ZEROX_OK | NUMBER_OCT | OCT_ZERO_OK |\
+ NUMBER_DEC | NUMBER_NO_WS_OK))
+
+/* HEXADECIMAL matches an unsigned hex number, minimum one
+ * digit, and assigns it to a int. This function works on numbers
+ * which don't begin with '0x'. */
+
+#define HEXADECIMAL(name,acc,alt,var)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, NULL,\
+ (NUMBER_HEX | HEX_NO_ZEROX_OK | NUMBER_NO_WS_OK))
+
+#define HEXNUM(name, acc, alt, var, help)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, help,\
+ (NUMBER_HEX | HEX_NO_ZEROX_OK | NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+#define HEXDIGIT(name, acc, alt, var, lower, upper, help)\
+ GENERAL_NUMBER(name, acc, alt, var, lower, upper, help,\
+ (NUMBER_HEX | HEX_NO_ZEROX_OK | NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+#define OPT_HEXNUM(name, acc, alt, var, help)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, help,\
+ (NUMBER_HEX | HEX_NO_ZEROX_OK | HEX_ZEROX_OK |\
+ NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+#define OPT_HEXDIGIT(name, acc, alt, var, lower, upper, help)\
+ GENERAL_NUMBER(name, acc, alt, var, lower, upper, help,\
+ (NUMBER_HEX | HEX_NO_ZEROX_OK | HEX_ZEROX_OK |\
+ NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+#define ZEROXHEXNUM(name, acc, alt, var, help)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, help,\
+ (NUMBER_HEX | HEX_ZEROX_OK | NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+/*
+ * IOCTAL matches an unsigned octal number, minimum one
+ * digit, and assigns it to a int
+ */
+#define IOCTAL(name,acc,alt,var)\
+ GENERAL_NUMBER(name, acc, alt, var, 0, -1, NULL,\
+ (NUMBER_OCT | OCT_ZERO_OK | OCT_NO_ZERO_OK |\
+ NUMBER_NO_WS_OK))
+
+#define NUMBER_FUNC(name, acc, alt, var, func, help)\
+ static number_func_struct L ## name =\
+ {CSBOFF(var), func, PHELP(help)};\
+ static transition pname(name) =\
+ {&pname(acc), &pname(alt), (trans_func) number_func_action, & L ## name}
+
+#define NUMBER_HELP_FUNC(name, acc, alt, var, func)\
+ static number_help_func_struct L ## name =\
+ {CSBOFF(var), func};\
+ static transition pname(name) =\
+ {&pname(acc), &pname(alt), (trans_func) number_help_func_action, & L ## name}
+
+
+#define GENERAL_PARAMS(name, alt, keyword, var, lower, upper, func, subfunc, keyhelp, varhelp, priv, flags)\
+ pfdecl(func);\
+ TRANS_PRIV(name, priv);\
+ static params_struct L ## name = {keyword, CSBOFF(var), lower, upper,\
+ func, subfunc, PHELP(keyhelp),\
+ PHELP(varhelp),\
+ & P ## name, flags};\
+ static transition pname(name) = {NULL, & pname(alt),\
+ (trans_func) params_action, & L ## name}
+
+#define PARAMS(name, alt, keyword, var, lower, upper, func, subfunc, keyhelp,varhelp,priv)\
+ GENERAL_PARAMS(name, alt, keyword, var, lower, upper, func,\
+ subfunc, keyhelp, varhelp, priv,\
+ (KEYWORD_WS_OK | KEYWORD_HELP_CHECK | NUMBER_DEC |\
+ NUMBER_WS_OK | NUMBER_HELP_CHECK))
+
+#define PARAMS_KEYONLY(name, alt, keyword, var, lower, upper, func, subfunc, keyhelp, varhelp, priv)\
+ GENERAL_PARAMS(name, alt, keyword, var, lower, upper, func,\
+ subfunc, keyhelp, varhelp, priv,\
+ (KEYWORD_WS_OK | KEYWORD_HELP_CHECK | NUMBER_DEC |\
+ NUMBER_WS_OK | NUMBER_HELP_CHECK | NO_NUMBER))
+
+#define IPMASK(name,acc,alt,mask, help)\
+ static ipmask_struct L ## name = {CSBOFF(mask), PHELP(help)};\
+ static transition pname(name) = {& pname(acc), & pname(alt),\
+ (trans_func) ipmask_action, & L ## name}
+
+#define IPADDR_MASK(name, acc, alt, addr, mask, help)\
+ static ipaddrmask_struct L ## name = { CSBOFF(addr), CSBOFF(mask), help};\
+ static transition pname(name) = {& pname(acc), & pname(alt),\
+ (trans_func) ipaddrmask_action, & L ## name}
+
+/* Negative 1 (-1), used as the wild-card in many protocols */
+#define NEG1(name, acc, alt, net, help)\
+ KEYWORD_ID(name, acc, alt, net, -1L, "-1", help, PRIV_MIN)
+
+
+#define ALT_HELPS(name,func,subfunc)\
+ pfdecl(func);\
+ static eols_struct L ## name = {func, subfunc};\
+ static transition pname(name) = {NULL, NULL, (trans_func) alt_helps_action, & L ## name}
+
+/*
+ * Hexadecimal data stream. Used in 'llc2 send' command.
+ */
+
+#define HEXDATA(name, acc, alt, buf, count, help, bufmax)\
+ static hexdata_struct L ## name = {CSBOFF(buf), CSBOFF(count),\
+ PHELP(help), bufmax};\
+ static transition pname(name) = {&pname(acc), &pname(alt),\
+ (trans_func) hexdata_action, & L ## name}
+
+#define KEYWORD_NEG(name,acc, alt,str,help, priv)\
+ SET(name ## setsense, acc , sense, FALSE); \
+ KEYWORD(name, name ## setsense, alt, str, help, priv)
+
+
+#endif /* IOS_PARSER */
+
+#endif /* __MACROS_H__ */
diff --git a/data/mnet/Common/cli/include/mutex.h b/data/mnet/Common/cli/include/mutex.h
new file mode 100644
index 0000000..2362fd9
--- /dev/null
+++ b/data/mnet/Common/cli/include/mutex.h
@@ -0,0 +1,23 @@
+
+#ifndef MUTEX_HEADER
+#define MUTEX_HEADER
+
+enum mutex_types {
+ USYNC_THREAD,
+ USYNC_PROCESS
+};
+
+#define USYNC_THREAD 0
+
+typedef struct semaphore mutex_t;
+
+mutex_t * MUTEX_CREATE(enum mutex_types a2, void * a3);
+int MUTEX_LOCK(mutex_t * pMutex);
+int MUTEX_UNLOCK(mutex_t * pMutex);
+
+#define mutex_create MUTEX_CREATE
+#define mutex_lock MUTEX_LOCK
+#define mutex_unlock MUTEX_UNLOCK
+
+#endif /* MUTEX_HEADER */
+
diff --git a/data/mnet/Common/cli/include/nv.h b/data/mnet/Common/cli/include/nv.h
new file mode 100644
index 0000000..40b927f
--- /dev/null
+++ b/data/mnet/Common/cli/include/nv.h
@@ -0,0 +1,21 @@
+#if !defined(__NV_H__)
+#define __NV_H__
+
+
+
+extern void nv_init(void);
+
+extern void nv_configure(uchar);
+extern int nv_current_to_nv (boolean vocal);
+extern char* nv_current_to_buffer(boolean, uchar, boolean);
+extern void nv_review(parseinfo *);
+
+extern STATUS write_nv_config_from_fd( int );
+
+extern void nv_add (boolean , char *, ...);
+extern void nv_write (boolean , char *, ...);
+extern int nv_erase(boolean);
+
+extern boolean ok_to_write_nv(void);
+
+#endif /* !defined(__NV_H__) */
diff --git a/data/mnet/Common/cli/include/parser.h b/data/mnet/Common/cli/include/parser.h
new file mode 100644
index 0000000..2037210
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser.h
@@ -0,0 +1,263 @@
+#ifndef __PARSER_H__
+#define __PARSER_H__
+
+
+
+enum {
+ STACKMAKER_NAME =0,
+ STACKMAKER_MEMBER,
+};
+
+typedef struct parsenode_ {
+ struct parsenode_ *next; /* Next stack entry */
+ transition *node; /* The node */
+ int line_index; /* Where we are in the input buffer */
+ char nv_command[PARSEBUF]; /* The command generated to this point */
+ char visible_ambig[PARSEBUF]; /* Visible command ambiguity detection */
+ char hidden_ambig[PARSEBUF]; /* Hidden command Ambiguity detection */
+ boolean command_visible; /* TRUE if current keyword is visible */
+ boolean unsupported; /* TRUE if current keyword is unsupp. */
+ parser_mode *pmp; /* Parser mode */
+ boolean sense; /* FALSE if 'no' parsed. Also FALSE if 'default'
+ * parsed because the off state is the default for
+ * most commands. */
+ boolean set_to_default; /* TRUE if 'default' parsed */
+ boolean leave_subcommand;
+
+#ifdef BOOMERANG
+ /* save string info from csb into sub-mode csb's */
+ char save_txt[PARSEBUF];
+#endif /* BOOMERANG */
+ int interface;
+
+} parsenode;
+
+typedef struct callbackMsg {
+ parseinfo *csb;
+ tpPARSERSIM pSim;
+} tCALLBACKMSG, *tpCALLBACKMSG;
+
+/* extern chunk_type *parseinfo_chunks;*/
+
+extern parseinfo *get_csb(const char *);
+extern void free_csb(parseinfo **csb);
+struct idbtype_ *findidb(parseinfo *csb);
+extern void set_multiple_funcs(parseinfo *csb, int value);
+extern void increment_multiple_funcs(parseinfo *csb, char *str);
+extern int test_multiple_funcs(parseinfo *csb, char test, int value);
+extern int test_visible_multiple_funcs(parseinfo *csb, char test, int value);
+extern int test_invisible_multiple_funcs(parseinfo *csb, char test, int value);
+extern void print_multiple_funcs(parseinfo *csb);
+extern void report_error(parseinfo *, int, boolean);
+extern tOCTET2 parser_send_response( tpCOMSIM , char *, tUOCTET4 );
+extern void ParserCallbackInit( void );
+
+/* Return values from parse_cmd() used by report_error() */
+#define PARSE_ERROR_NOERR 0x0 /* Success */
+#define PARSE_ERROR_AMBIG 0x1 /* Ambiguous command */
+#define PARSE_ERROR_NOMATCH 0x2 /* True error; didn't match any command */
+#define PARSE_ERROR_UNKNOWN 0x4 /* Didn't match anything while doing help */
+#define PARSE_ERROR_ALIAS 0x8 /* Didn't match expanded alias */
+
+#define RC_CONT 1
+#define RC_MORE 2
+#define RC_NO_MORE 3
+#define RC_CANT_MORE 4
+#define RC_WAIT 5
+#define RC_BREAK 6
+#define RC_CFG_BREAK 7
+#define RC_TIMEOUT 8
+
+#define MORE_BUFFER 1
+#define MORE_FILE 2
+
+#define NON_UNIQUE 1 /* Non-unique token in help */
+#define PARSE_FAIL 2 /* Parse failed */
+
+/*
+ * Values for csb->in_help
+ */
+#define PARSER_NO_HELP 0
+#define PARSER_HELP 1<<0
+#define PARSER_COMMAND_COMPLETION 1<<1
+
+/*
+ * Values for mode volume
+ */
+#define MODE_VERBOSE 1
+#define MODE_SILENT 2
+
+/*
+ * Type of parser
+ */
+#define PARSER_CLI_DEFAULT 0
+#define PARSER_CLI_TCL 1
+#define PARSER_CLI_OVERRIDE 2
+
+
+#ifdef USE_PARSER_KMEM
+
+#define PARSERcalloc(nelem, elemSize) PSkcalloc((nelem), (elemSize), \
+ M_PARSER, M_WAITOK)
+#define PARSERmalloc(elemSize) PSkmalloc((elemSize), \
+ M_PARSER, M_WAITOK)
+#define PARSERrealloc(elemPtr, elemSize) PSkrealloc((elemPtr), (elemSize), \
+ M_PARSER, M_WAITOK)
+#define PARSERfree( elemPtr ) PSkfree( (elemPtr), M_PARSER )
+
+#else
+
+#define PARSERcalloc(nelem, elemSize) PScalloc((nelem), (elemSize))
+#define PARSERmalloc(elemSize) PSmalloc((elemSize))
+#define PARSERrealloc(elemPtr, elemSize) PSrealloc((elemPtr), (elemSize))
+#define PARSERfree(elemPtr) PSfree((elemPtr))
+
+#endif
+
+
+#define PARSER_ENTRY_LINK_POINT 1
+#define PARSER_EXIT_LINK_POINT 2
+
+/*
+ * Uncomment this define to add parser link point names for debugging
+ */
+/*#define PARSER_DEBUG_LINKS*/
+
+typedef struct chain_link_ {
+ uint id;
+#ifdef PARSER_DEBUG_LINKS
+ const char *name;
+#endif /* PARSER_DEBUG_LINKS */
+ dynamic_transition *link_point;
+ uint type;
+} chain_link;
+
+typedef struct chain_list_ {
+ struct chain_list_ *next;
+ chain_link cp;
+} chain_list;
+
+extern chain_link chain_gang[];
+extern SEM_ID parse_chain_sem;
+
+typedef void * (*mode_save_var_func)(parseinfo *);
+typedef void (*mode_reset_var_func)(parseinfo *, void *);
+typedef boolean (*mode_http_init_func)(parseinfo *);
+
+
+extern parser_mode *parser_add_mode(const char *, const char *, const char *,
+ boolean, boolean, const char *,
+ mode_save_var_func, mode_reset_var_func,
+ transition *,
+ mode_http_init_func);
+
+extern parser_mode *get_mode_tmp(const char *, const char *, const char *,
+ boolean, boolean,
+ transition *);
+extern void free_mode(parser_mode *);
+extern parser_mode *get_alt_mode(parser_mode *);
+extern void *mode_save_vars(parseinfo *);
+extern void mode_reset_vars(parseinfo *, void *);
+extern boolean priv_changed_in_mode(parser_mode *);
+extern void set_priv_changed_in_mode(parser_mode *, boolean);
+extern boolean mode_http_init(parseinfo *);
+extern int print_debug(char *, ... );
+
+/*
+ * The big well known parser modes
+ */
+extern parser_mode *exec_mode;
+extern parser_mode *config_mode;
+
+/*extern BOOT_PARAMS sysBootParams;*/
+
+/*
+ * Some extern declarations for variables
+ * defined in parser.c / parser_init.c
+ */
+extern SEM_ID systemloadingSemId;
+extern int terminalLength;
+extern int parserNullFd;
+extern FILE* parserNullFp;
+
+/*
+ * Miscellaneous routine declarations.
+ */
+void parse_token(parseinfo *);
+void push_node(parseinfo *, transition *);
+int parse_cmd(parseinfo *, tpPARSERSIM);
+boolean batch_input(parseinfo *, char *, int, char *, char *);
+void print_caret(int);
+void save_line_init(save_buf*);
+void save_line(parseinfo *, save_buf*, const char*, ...);
+int print_buf(save_buf, boolean, boolean, int *, long);
+extern void bad_parser_subcommand(parseinfo *, uint);
+char *last_config_time_string(void);
+char *last_write_mem_time_string(void);
+void note_write_mem_time(void);
+void free_csb_mem(parseinfo *);
+extern int cliShell_sync(void);
+
+/*
+ * Parser Mode functions
+ */
+extern void parser_modes_init(void);
+extern parser_mode *get_mode_byname(const char *, uint);
+extern boolean set_mode_byname(parser_mode **, const char *, uint);
+extern queuetype *get_mode_aliases(parser_mode *);
+extern queuetype *get_mode_defaliases(parser_mode *);
+extern const char *get_mode_prompt(parseinfo *);
+extern boolean test_mode_config_subcommand(parseinfo *);
+extern transition *get_mode_nv(parseinfo *);
+extern transition *get_mode_top(parser_mode *);
+extern const char *get_mode_name(parser_mode *);
+extern void display_mode_aliases(parseinfo *, parser_mode *);
+extern void parser_add_main_modes(void);
+
+/*
+ * Global parser debug variables
+ */
+extern boolean parser_help_debug;
+extern boolean parser_ambig_debug;
+extern boolean parser_mode_debug;
+extern boolean parser_priv_debug;
+
+/*
+ * Should we have a prompt in config mode.
+ */
+extern boolean config_prompt;
+extern char *nomemory;
+
+extern int doprnt (char *, tt_soc *, const char *, va_list , boolean );
+extern void printVersion( void );
+extern int getTftpInput( char *pTftpServer, char *pFileName );
+
+extern boolean queueempty_inline (queuetype *q);
+extern void enqueue(queuetype *, void *);
+extern void unqueue(queuetype *, void *);
+extern void queue_init(queuetype *, int);
+extern void *dequeue(queuetype *);
+extern void requeue(queuetype *, void *);
+extern void *peekqueuehead (queuetype* q);
+extern int queryqueuedepth(queuetype *);
+extern void insqueue(queuetype *, void *, void *);
+extern ushort ipcrc (ushort *p, int count);
+extern boolean name_verify( char *);
+#ifdef IOS_PARSER
+/*
+ * Global parser debug variables
+ */
+extern boolean parser_alias_debug;
+extern boolean parser_http_debug;
+
+extern boolean parser_link_point_exists(uint);
+
+void recurse_node(parseinfo *, transition *);
+extern void *p_dequeue(queuetype *);
+extern void p_enqueue (queuetype *, void *);
+extern void p_unqueue (queuetype *, void *);
+extern void *remqueue(queuetype *, void *, void *);
+#endif
+
+
+#endif /* __PARSER_H_ */
diff --git a/data/mnet/Common/cli/include/parser_ModNum.h b/data/mnet/Common/cli/include/parser_ModNum.h
new file mode 100644
index 0000000..ac5b812
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_ModNum.h
@@ -0,0 +1,13 @@
+/*
+ * vxWorks errno module number for parser
+ * See man pages: makeStatTbl(3), errnoLib(1), printErrno(2)
+ */
+#ifndef _PARSER_MODNUM_H
+#define _PARSER_MODNUM_H
+
+/*
+ * Module numbers 1-500 are reserved to vxWorks
+ */
+#define M_parser (501 << 16)
+
+#endif /* _PARSER_MODNUM_H */
diff --git a/data/mnet/Common/cli/include/parser_actions.h b/data/mnet/Common/cli/include/parser_actions.h
new file mode 100644
index 0000000..296be88
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_actions.h
@@ -0,0 +1,591 @@
+#ifndef __PARSER_ACTIONS_H__
+#define __PARSER_ACTIONS_H__
+
+/******************************************************************
+ * Macros
+ ******************************************************************/
+
+#define SHORTHELP_LEN 32
+
+#define isodigit(c) (((c) >= '0') && ((c) <= '7'))
+#define is_terminator(c) (((c)=='\0') || ((c)=='!') || ((c)==';'))
+#define CVHTOB(c) ((int) c - \
+ (((c >= '0') && (c <= '9')) ? \
+ '0' : \
+ (((c >= 'a') && (c <= 'f')) ? \
+ 'a'-10 : \
+ 'A'-10)))
+
+#define INVALID_NVGEN_CHECK\
+ if (csb->nvgen) {\
+ if (!csb->priv_set) {\
+ printf("ERROR:INVALID_NVGEN_CHECK\n");\
+ }\
+ return;\
+ }
+
+
+/******************************************************************
+ * Defines
+ ******************************************************************/
+
+/* Command completion flags */
+#define NO_COMMAND_COMPLETION 0
+#define SUPPORT_COMMAND_COMPLETION 1
+
+#define ADDR_PARSE(n) 0xf000+n
+
+#define ADDR_NAME_LOOKUP 0x00000001
+#define ADDR_LIL_ENDIAN 0x00000002
+#define ADDR_HOST_ADDR_ONLY 0x00000004
+#define ADDR_HOST_NET_ONLY 0x00000008
+#define ADDR_PROTO_ADDR 0x00000010
+#define ADDR_NO_SHORT_HELP 0x80000000
+#define ADDR_ALL 0xffffffff
+
+/* Flag values for number_struct types field. */
+
+#define NUMBER_HEX 0x00000001 /* hexadecimal number */
+#define NUMBER_OCT 0x00000002 /* octal number */
+#define NUMBER_DEC 0x00000004 /* decimal number */
+#define NO_NUMBER 0x00000008 /* don't parse number if !sense */
+#define HEX_ZEROX_OK 0x00000010 /* hex number can have '0x000' */
+#define HEX_NO_ZEROX_OK 0x00000020 /* hex number can have no '0x000' */
+#define HEX_ZEROX_MATCHED 0x00000040 /* hex number matched '0x000' */
+#define HEX_ZEROX_NOT_MATCHED 0x00000080 /* hex number didn't match '0x000'*/
+#define OCT_ZERO_OK 0x00000100 /* oct number can have '0' */
+#define OCT_NO_ZERO_OK 0x00000200 /* oct number can have no '0' */
+#define OCT_ZERO_MATCHED 0x00000400 /* oct number matched '0' */
+#define OCT_ZERO_NOT_MATCHED 0x00000800 /* oct number didn't match '0' */
+
+#define SIGNED_NUMBER 0x00001000 /* parse signed number */
+
+#define NUMBER_WS_OK 0x00100000 /* number can have whitespace */
+#define NUMBER_NO_WS_OK 0x00200000 /* number can have no whitespace */
+#define KEYWORD_WS_OK 0x00400000 /* keyword can have whitespace */
+#define KEYWORD_NO_WS_OK 0x00800000 /* keyword can have no whitespace */
+
+#define NUMBER_HELP_CHECK 0x01000000 /* give help */
+#define KEYWORD_HELP_CHECK 0x02000000 /* give help */
+
+#define KEYWORD_OR_SET 0x04000000 /* OR value instead of set */
+#define KEYWORD_TEST 0x08000000 /* Test value before parsing */
+#define NUMBER_NV_RANGE 0x10000000 /* Do NV of number range */
+
+#define STRING_WS_OK NUMBER_WS_OK /* Whitespace allowed in string */
+#define STRING_HELP_CHECK NUMBER_HELP_CHECK /* Provide help for string */
+#define STRING_QUOTED 0x20000000 /* Quotes aren't included */
+
+/*
+ * Command privileges. The privilege levels can be 1-255 (stored
+ * as uchar). Privilege level 0 is reserved
+ * to indicate that normal processing of keywords should
+ * be done. If 'priv_set' is non-zero, then the keywords which match
+ * should copy 'priv_set' into their 'priv' variable.
+ *
+ */
+
+/*
+ * Privilege level is stored in a unsigned integer broken
+ * down like the following.
+ *
+ * bits 0-3 current privilege level
+ * bits 4-7 original privilege level when privilege level has been changed
+ * bits 8 indicates current privilege level has changed
+ * bits 9-22 unused
+ * bits 23 indicate distilled configuration
+ * bits 24-31 privilege modification flags
+ *
+ */
+
+#define PRIV_MIN 0x0
+#define PRIV_NULL 0x0 /* PRIV level means nothing. */
+#define PRIV_USER 0x1 /* No special privileges */
+#define PRIV_OPR 0xf /* Operator */
+#define PRIV_CONF 0xf /* Allowed to do configuration */
+#define PRIV_ROOT 0xf /* The Supreme Administrator */
+#define PRIV_MAX 0xf
+#define PRIV_INTERACTIVE 0x00400000 /* Interactive command */
+#define PRIV_CHANGED 0x00000100 /* Privilege level has changed */
+#define PRIV_DISTILLED 0x00800000 /* Configuration to be distilled */
+#define PRIV_INTERNAL 0x01000000 /* Command "for internal use only" */
+#define PRIV_UNSUPPORTED 0x02000000 /* Hidden unsupported command */
+#define PRIV_USER_HIDDEN 0x04000000 /* Hidden command from disabled user */
+#define PRIV_SUBIF 0x08000000 /* Allowed on subinterfaces */
+#define PRIV_HIDDEN 0x10000000 /* Hidden commands. Subtree rooted at
+ * this keyword is not searched. */
+#define PRIV_DUPLICATE 0x20000000 /* Keyword is a duplicate for
+ * split parse chains */
+#define PRIV_NONVGEN 0x40000000 /* Keywords that do not NVGEN */
+#define PRIV_NOHELP 0x80000000 /* Keywords that do not provide help */
+#define DEFAULT_PRIV PRIV_USER /* Default user privilege level */
+
+#define PRIV_PSYNALC 0x00200000 /* Keywords that are not used by synalc */
+
+#define TRANS_PRIV_PRIV_MASK 0xf
+#define TRANS_PRIV_FLAGS_OFFSET 9
+#define TRANS_PRIV_FLAGS_GET(priv) ((priv) << TRANS_PRIV_FLAGS_OFFSET)
+#define TRANS_PRIV_FLAGS_SET(priv) ((priv) >> TRANS_PRIV_FLAGS_OFFSET)
+
+/*
+ *
+ */
+#define RMATCH_IP 0x00100000
+#define RMATCH_OSI 0x00200000
+#define RMATCH_NOVELL 0x00400000
+#define RMATCH_NONE 0x80000000
+
+#define RMATCH_ARGS 0x01000000
+#define RMATCH_NO_ARGS 0x02000000
+#define RMATCH_TAG_REQUIRED 0x04000000
+#define RMATCH_NO_TAG 0x08000000
+#define RMATCH_NO_KEY_HELP 0x10000000
+
+/******************************************************************
+ * Data Structures
+ ******************************************************************/
+
+
+typedef struct trans_priv_ {
+ uint cur_priv : 4;
+ uint def_priv : 4;
+ uint PACKED(flags : 23);
+ uint PACKED(priv_changed : 1);
+#ifdef OBJECT_4K
+ uint pad; /* see CSCdi32916, before eliminating this pad */
+#endif
+} trans_priv;
+
+typedef const struct general_keyword_struct_ {
+ const char *str; /* The string to match */
+ const char *help; /* Help string */
+ trans_priv *priv; /* Privilege and flags of this keyword */
+ int offset; /* CSB offset to store value if keyword matches */
+ uint val; /* Value to store */
+ int minmatch; /* min number of chars required to match */
+ uint flags; /* white space and help flags */
+} general_keyword_struct;
+
+typedef const struct keyword_struct_ {
+ const char *str;
+ const char *help;
+ trans_priv *priv;
+} keyword_struct;
+
+typedef const struct keyword_mm_struct_ {
+ const char *str;
+ const char *help;
+ trans_priv *priv;
+ int minmatch;
+} keyword_mm_struct;
+
+typedef const struct keyword_id_struct_ {
+ const char *str; /* The keyword */
+ const char *help; /* Help string for this keyword */
+ trans_priv *priv; /* Privilege of this keyword */
+ int offset; /* CSB offset to store value if keyword matches */
+ uint val; /* Value to store */
+} keyword_id_struct;
+
+typedef struct dynamic_number_struct_ {
+ int offset; /* CSB offset to store parsed number */
+ uint lower; /* Lower limit we'll accept */
+ uint upper; /* Upper limit */
+ const char *help; /* The long help string */
+ uint flags; /* flags: hex, octal, decimal allowed,
+ whitespace allowed, to help or not to help */
+} dynamic_number_struct;
+
+typedef const struct dynamic_number_struct_ number_struct;
+
+typedef const struct signed_number_struct_ {
+ int offset; /* CSB offset to store parsed number */
+ signed int lower; /* Lower limit we'll accept */
+ signed int upper; /* Upper limit */
+ const char *help; /* The long help string */
+} signed_number_struct;
+
+typedef void (*parser_number_func)(parseinfo *, uint *, uint *);
+
+
+
+
+
+typedef const struct keyword_id_mm_struct_ {
+ const char *str; /* The keyword */
+ const char *help; /* Help string for this keyword */
+ trans_priv *priv; /* Privilege of this keyword */
+ int offset; /* CSB offset to store value if keyword matches */
+ uint val; /* Value to store */
+ int minmatch; /* minimum number of char to match */
+} keyword_id_mm_struct;
+
+typedef const struct keyword_options_ {
+ const char *keyword;
+ const char *help;
+ uint val;
+} keyword_options;
+
+extern keyword_options permitdeny_options[];
+
+typedef const struct keyword_option_struct_ {
+ keyword_options *options;
+ uint offset;
+ trans_priv *priv;
+ uint flags;
+} keyword_option_struct;
+
+
+#ifdef IOS_PARSER
+
+typedef const struct number_func_struct_ {
+ int offset; /* CSB offset to store parsed number */
+ parser_number_func func; /* Function to call to set range */
+ const char *help; /* The long help string */
+} number_func_struct;
+
+typedef void (*parser_number_help_func)(parseinfo *, uint *, uint *,const char **);
+typedef const struct number_help_func_struct_ {
+ int offset; /* CSB offset to store parsed number */
+ parser_number_help_func func; /* Function to set range and help string */
+} number_help_func_struct;
+
+
+#define PARAMS_STRUCT_COMMON \
+ const char *str; /* Keyword to match */ \
+ int offset; /* CSB offset to store parsed number */ \
+ uint lower; /* Lower range of parsed number */ \
+ uint upper; /* Upper range of parsed number */ \
+ void *func; /* func to call if parse is successful */ \
+ int subfunc; /* Subfunction code */ \
+ const char *keyhelp;/* Keyword help string */ \
+ const char *varhelp;/* Variable help string */ \
+ trans_priv *priv; /* Privilege of the keyword */ \
+ uint flags; /* Look for trailing whitespace, no whitespace, etc */
+
+typedef const struct params_struct_ {
+ PARAMS_STRUCT_COMMON
+} params_struct;
+
+typedef const struct params_struct_alist {
+ PARAMS_STRUCT_COMMON
+ uint lower2; /* Lower range of alternate parsed number */
+ uint upper2; /* Upper range of alternate parsed number */
+} params_struct_alist;
+
+typedef const struct print_struct_ {
+ const char * str;
+} print_struct;
+
+typedef const struct char_struct_ {
+ const character;
+} char_struct;
+
+typedef const struct string_struct_ {
+ int offset; /* CSB offset to store parsed string */
+ const char *help; /* Help message for this string */
+} string_struct;
+
+typedef const struct test_bool_struct_ {
+ boolean *var; /* Pointer to the variable to be tested */
+ transition *zero; /* Go here if variable == NULL */
+ transition *nonzero; /* Go here if variable != NULL */
+} test_bool_struct;
+
+typedef const struct test_int_struct_ {
+ int *var; /* Pointer to the variable to be tested */
+ transition *zero; /* Go here if variable == NULL */
+ transition *nonzero; /* Go here if variable != NULL */
+} test_int_struct;
+
+typedef const struct test_func_struct_ {
+ boolean (* func)(void);
+ transition *zero; /* Go here if variable == NULL */
+ transition *nonzero; /* Go here if variable != NULL */
+} test_func_struct;
+
+typedef const struct test_line_struct_ {
+ uint type; /* bit field of valid line types */
+ transition *zero; /* Go here if line range is valid */
+ transition *nonzero; /* Go here if line range is invalid */
+} test_line_struct;
+
+typedef const struct hexdata_struct_ {
+ int bufoffset; /* CSB offset to store parsed hex bytes */
+ int numoffset; /* CSB offset for number of bytes stored */
+ const char *help; /* Help string for this address */
+ uint bufmax; /* number of bytes in output buffer */
+} hexdata_struct;
+
+typedef const struct char_struct2_ {
+ const char character;
+ const char *help;
+} char_struct2;
+
+/* TCP & UDP port information */
+
+typedef const struct portinfo_ {
+ ushort port; /* port number */
+ const char *str; /* port name */
+ const char *help; /* help string */
+ uchar minmatch; /* min match */
+} portinfo;
+
+typedef const struct portparse_struct_ {
+ int offset; /* CSB offset to store parsed port */
+} portparse_struct;
+
+/* New protocol name/address parsing scheme
+ *
+ * The specification of which protocols are valid for parsing is done
+ * using a string, interpreted as a series of two-character codes.
+ * My convension is that protocol groups are named with two capital
+ * letters, and individual protocols are named with a capital and
+ * a lowercase letter. However, this convension is nowhere enforced
+ * or relied on by code. It serves mearly to help me keep these
+ * names unique.
+ *
+ * Any changes to this list should be reflected in the link_names
+ * table in actions.c that maps codes (both individual and group)
+ * to names and LINK_... macros.
+ */
+
+#define PMATCH_EXCLUDE "E:" /* Exclude following protocols */
+#define PMATCH_INCLUDE "I:" /* Include following protocols */
+
+#define PMATCH_ALL "AL" /* All protocols */
+#define PMATCH_DGRAM "DG" /* All datagram protocols */
+
+#define PMATCH_CDP "Cd"
+#define PMATCH_IP "Ip"
+
+
+typedef const struct protoname_struct_ {
+ int variable; /* CSB offset to store parsed link type */
+ const char *match_spec; /* Specification of acceptable protocols */
+} protoname_struct;
+
+typedef const struct protoaddr_struct_ {
+ int num_offset;
+ int addr_offset;
+ const char *match_spec;
+} protoaddr_struct;
+
+
+#endif /* IOS_PARSER */
+
+
+
+
+
+typedef const struct help_struct_ {
+ const char *str;
+ transition *eol;
+} help_struct;
+
+typedef const struct general_string_struct_ {
+ int offset; /* CSB offset to store parsed string */
+ const char *help; /* Help message for this string */
+ uint flags; /* Flags affecting how string is parsed */
+} general_string_struct;
+
+typedef const struct set_struct_ {
+ int offset; /* CSB offset to store value */
+ uint val; /* Value to store */
+} set_struct;
+
+typedef const struct test_struct_ {
+ int offset; /* CSB offset to numeric variable to test */
+ uint val; /* The value to test it against */
+ transition *equal; /* Go here if == */
+ transition *notequal; /* Go here if != */
+ transition *lt; /* Go here if < */
+ transition *gt; /* Go here if > */
+} test_struct;
+
+typedef const struct eols_struct_ {
+ void *func;
+ int subfunc;
+} eols_struct;
+
+typedef const struct nvgens_struct_ {
+ void *func;
+ int subfunc;
+} nvgens_struct;
+
+typedef const struct addrparse_struct_ {
+ int offset; /* CSB offset to store parsed address */
+ const char *help; /* Help string for this address */
+ uint type; /* Type of addres to parse */
+ uint flag; /* How to parse (e.g. addr only, addr or hostname) */
+} addrparse_struct;
+
+
+/* Same thing as an addrparse_struct, except without the flag */
+typedef const struct addrparse_nf_struct_ {
+ int offset; /* CSB offset to store parsed address */
+ const char *help; /* Help string for this address */
+ uint type; /* Type of addres to parse */
+} addrparse_nf_struct;
+
+
+typedef const struct ipaddrparse_struct_ {
+ int offset; /* CSB offset to store parsed address */
+ const char *help; /* Help string for this address */
+ int host;
+ int flag;
+} ipaddrparse_struct;
+
+typedef const struct ipmask_struct_ {
+ int mask; /* CSB offset to store parsed mask */
+ const char *help; /* Help string */
+} ipmask_struct;
+
+typedef const struct ipaddrmask_struct_ {
+ int addr; /* CSB offset to store parsed address */
+ int mask; /* CSB offset to store parsed mask */
+ const char *help; /* Help string */
+} ipaddrmask_struct;
+
+
+/* Month of the year */
+
+typedef const struct month_struct_ {
+ int offset; /* CSB offset */
+ const char *help;
+} month_struct;
+
+/* Day of the week */
+
+typedef const struct day_struct_ {
+ int offset; /* CSB offset */
+ const char *help;
+} day_struct;
+
+typedef const struct timesec_struct_ {
+ int var1;
+ int var2;
+ int var3;
+ const char *help;
+} timesec_struct;
+
+typedef boolean (* testexpr_func)(parseinfo *, transition *);
+typedef const struct testexpr_struct_ {
+ transition *fal;
+ const testexpr_func func;
+} testexpr_struct;
+
+typedef struct addr_func_ {
+ uint addr_type;
+ short_help_func get_short_help;
+ match_gen_func func;
+} addr_func;
+
+typedef struct priv_struct_ {
+ trans_priv *priv;
+ transition *fail;
+} priv_struct;
+
+typedef const struct mode_struct_ {
+ int offset;
+ uint flags;
+} mode_struct;
+
+
+extern addr_func *addr_funcs;
+
+/******************************************************************
+ * Function prototypes
+ ******************************************************************/
+
+extern void nvgen_token(parseinfo *, transition *, const char *);
+boolean help_check(parseinfo *);
+void help_or_error(parseinfo *, int, const char *, boolean);
+boolean match_whitespace2(char *, int *, boolean);
+boolean match_number(parseinfo *, uint, uint, int *, uint *, uint, const char *);
+boolean match_decimal(char *, uint, uint, int *, ushort *);
+boolean match_hexadecimal(char *, int *, ushort *);
+boolean match_ulong_decimal(char *, ulong, ulong, int *, ulong *);
+boolean match_ulong_octal(char *, ulong, ulong, int *, ulong *);
+boolean match_ulong_hexadecimal(char *, ulong, ulong, int *, ulong *);
+boolean match_char(char *, int *, char);
+boolean get_name(char *buf, char *name, int *pi, int buflen);
+void save_ambig_string(parseinfo *, const char *, const char *);
+void save_help_long(parseinfo *, const char *, const char *, uint);
+uint copy_varstring(char *, char *, uint, uint);
+void multiple_funcs_action(parseinfo *, transition *, test_struct * const);
+void display_action(parseinfo *, transition *, help_struct * const);
+void NONE_action(parseinfo *);
+void no_alt_action(parseinfo *);
+void link_point_action(parseinfo *);
+void NOP_action(parseinfo *, transition *);
+void general_number_short_help_http(uint *, uint, uint, char *, boolean);
+void general_keyword_action(parseinfo *, transition *, general_keyword_struct * const);
+void keyword_action(parseinfo *, transition *, keyword_struct * const);
+void keyword_mm_action(parseinfo *, transition *, keyword_mm_struct * const);
+void keyword_id_action(parseinfo *, transition *, keyword_id_struct * const);
+void keyword_orset_action(parseinfo *, transition *, keyword_id_struct * const);
+void keyword_ortest_action(parseinfo *, transition *, keyword_id_struct * const);
+void keyword_optws_action(parseinfo *, transition *, keyword_struct * const);
+void eol_action(parseinfo *, transition *, void (*)(parseinfo *));
+void eols_action(parseinfo *, transition *, eols_struct * const);
+void eoli_action(parseinfo *, transition *, eols_struct * const);
+void eolns_action(parseinfo *, transition *, void (*)(parseinfo *));
+void help_action(parseinfo *, transition *, help_struct * const);
+void func_action(parseinfo *, transition *, void (*)(parseinfo *));
+void set_action(parseinfo *, transition *, set_struct * const);
+void test_action(parseinfo *, transition *, test_struct * const);
+void ipmask_action (parseinfo *, transition *, ipmask_struct * const);
+void ipaddrmask_action (parseinfo *, transition *, ipaddrmask_struct * const);
+void day_action(parseinfo *, transition *, day_struct * const);
+void month_action(parseinfo *, transition *, month_struct * const);
+void timesec_action(parseinfo *, transition *, timesec_struct * const);
+void nvgens_action(parseinfo *, transition *, nvgens_struct * const);
+void nvgenns_action(parseinfo *, transition *, void (*)(parseinfo *));
+void noprefix_action(parseinfo *, transition *);
+void general_number_action(parseinfo *, transition *, number_struct * const);
+void signed_number_action(parseinfo *, transition *, signed_number_struct * const);
+void generic_addr_action(parseinfo *, transition *, addrparse_struct * const);
+void generic_addr_noflag_action(parseinfo *, transition *, addrparse_nf_struct * const);
+boolean eol_check(parseinfo *);
+void priv_action(parseinfo *, transition *, priv_struct * const);
+void mode_action(parseinfo *, transition *, mode_struct *const);
+void comment_action(parseinfo *, transition *);
+void testexpr_action(parseinfo *, transition *, testexpr_struct * const);
+void general_string_action(parseinfo *, transition *, general_string_struct * const);
+boolean match_partial_keyword(parseinfo *, const char *, int *pi,
+ const char *, int, uint, uint);
+void keyword_option_action(parseinfo *, transition *, keyword_option_struct * const);
+
+#ifdef IOS_PARSER
+
+boolean match_octal(char *, uint, uint, int *, ushort *);
+boolean match_minusone(char *, int *);
+void general_number_short_help(uint *, uint, uint, char *);
+void whitespace_action(parseinfo *, transition *);
+void print_action(parseinfo *, transition *, print_struct * const);
+void char_action(parseinfo *, transition *, char_struct * const);
+void char_number_action(parseinfo *, transition *, number_struct * const);
+void test_boolean_action(parseinfo *, transition *, test_bool_struct * const);
+void test_int_action(parseinfo *, transition *, test_int_struct * const);
+void test_func_action(parseinfo *, transition *, test_func_struct * const);
+void number_func_action(parseinfo *, transition *, number_func_struct * const);
+void number_help_func_action(parseinfo *, transition *, number_help_func_struct * const);
+void hexdata_action(parseinfo *, transition *, hexdata_struct * const);
+void keyword_id_mm_action(parseinfo *, transition *, keyword_id_mm_struct * const);
+void alt_help_action(parseinfo *, transition *, void (*)(parseinfo *));
+void alt_helps_action(parseinfo *, transition *, eols_struct * const);
+void params_action(parseinfo *, transition *, params_struct * const);
+void params_action_alist(parseinfo *, transition *, params_struct_alist * const);
+void keyword_nows_action(parseinfo *, transition *, keyword_struct * const);
+
+void keyword_trans_action(parseinfo *, transition *, keyword_struct *const);
+
+#endif /* IOS_PARSER */
+#endif /* __PARSER_ACTIONS_H__ */
+
+
+
+
+
+
diff --git a/data/mnet/Common/cli/include/parser_api.h b/data/mnet/Common/cli/include/parser_api.h
new file mode 100644
index 0000000..de5dd96
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_api.h
@@ -0,0 +1,13 @@
+#ifndef __PARSER_ACTIONS_H__
+#define __PARSER_ACTIONS_H__
+
+
+/*
+ * parser_init.cpp exported routines
+ */
+extern void cli_parser_init (void);
+
+
+
+#endif /* __PARSER_ACTIONS_H__ */
+
diff --git a/data/mnet/Common/cli/include/parser_commands.h b/data/mnet/Common/cli/include/parser_commands.h
new file mode 100644
index 0000000..356c8b7
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_commands.h
@@ -0,0 +1,27 @@
+#ifndef __PARSER_COMMANDS_H__
+#define __PARSER_COMMANDS_H__
+
+extern boolean cfg_dirty( void );
+extern void write_memory( parseinfo *);
+extern void reload_command( parseinfo *);
+extern void exit_config_command( parseinfo *);
+extern void parser_help(parseinfo *);
+
+extern void capsGetIPAddress( char * );
+extern void capsGetIPGateway( char * );
+extern void capsGetIPNetmask( char * );
+extern void capsGetIPBroadcast( char * );
+
+
+extern int isTelnetdEnabled( void );
+extern int isHttpEnabled( void );
+extern int isFtpdEnabled( void );
+extern int isTftpdEnabled( void );
+extern int isCronEnabled( void );
+extern int isSyslogdEnabled( void );
+extern int isBootpdEnabled( void );
+extern int isRcpdEnabled( void );
+extern int getHttpPort( void );
+
+#endif /* __PARSER_COMMANDS_H_ */
+
diff --git a/data/mnet/Common/cli/include/parser_debug.h b/data/mnet/Common/cli/include/parser_debug.h
new file mode 100644
index 0000000..b6e1f3a
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_debug.h
@@ -0,0 +1,36 @@
+/* $Id: parser_debug.h,v 10.1 1998/06/11 22:03:31 sutton Exp $
+ * $Source: /export/sbcc/cepro/os/parser/src/parser_debug.h,v $
+ *------------------------------------------------------------------
+ * Cisco MicroWeb Server Version 2
+ *
+ * File: parser_debug.h
+ * Description: Parser Debug macros
+ * Owner: Prasanna Parthasarathy
+ * Notes:
+ *
+ * Copyright (c) 1997 by cisco Systems, Inc.
+ * All rights reserved.
+ *------------------------------------------------------------------
+ * $Log: parser_debug.h,v $
+ * Revision 10.1 1998/06/11 22:03:31 sutton
+ * code merge
+ *
+ * Revision 1.2 1997/05/14 22:12:19 pparthas
+ * Removed test_* files. Included some files for Show routines
+ * and cleaned-up file structure ( not source code ;-) )
+ *
+ *------------------------------------------------------------------
+ * $Endlog$
+ */
+
+/* Function to fire up parser debugging */
+extern void debug_parser_init(void);
+
+/*
+ * The actual debugging flags are defined in parser_debug_flags.h.
+ * We include that file twice, once to define the flags themselves
+ * and once to define the indices that the parser uses.
+ */
+#include "parser_debug_flags.h"
+#define __DECLARE_DEBUG_NUMS__
+#include "parser_debug_flags.h"
diff --git a/data/mnet/Common/cli/include/parser_debug_flags.h b/data/mnet/Common/cli/include/parser_debug_flags.h
new file mode 100644
index 0000000..7f7cecf
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_debug_flags.h
@@ -0,0 +1,13 @@
+#include <../include/debug_macros.h>
+
+/* Now define the actual flags and the array that points to them */
+DEBUG_ARRDECL(parser_debug_arr)
+
+DEBUG_FLAG(parser_ambig_debug,DEBUG_PARSER_AMBIG,"Parser ambiguity")
+DEBUG_FLAG(parser_help_debug,DEBUG_PARSER_HELP,"Help message")
+DEBUG_FLAG(parser_mode_debug,DEBUG_PARSER_MODE,"Parser mode")
+DEBUG_FLAG(parser_alias_debug,DEBUG_PARSER_ALIAS,"Parser aliases")
+DEBUG_FLAG(parser_priv_debug,DEBUG_PARSER_PRIV,"Privilege level")
+DEBUG_FLAG(parser_http_debug,DEBUG_PARSER_HTTP,"Parser HTTP processing")
+
+DEBUG_ARRDONE
diff --git a/data/mnet/Common/cli/include/parser_defs_config.h b/data/mnet/Common/cli/include/parser_defs_config.h
new file mode 100644
index 0000000..4d7aa2b
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_defs_config.h
@@ -0,0 +1,28 @@
+/* Terminal and line parameter defines */
+enum TERM_LINE_PARAMS {
+ TERM_LENGTH,
+ TERM_WIDTH,
+ TERM_MONITOR,
+};
+
+/* Configuration sources */
+#define PARSER_CONF_NONE 0 /* No source identified */
+#define PARSER_CONF_TERM 1 /* Config from terminal */
+#define PARSER_CONF_MEM 2 /* Config from NV memory */
+#define PARSER_CONF_NET 3 /* Config from a TFTP host */
+#define PARSER_CONF_OVERWRITE_NET 4 /* Config from a TFTP host and o
+verwrite config */
+#define PARSER_CONF_BATCH 5 /* Not from terminal */
+#define PARSER_CONF_HTTP 6 /* Config from HTTP server */
+
+
+/* Enable defines */
+#define ENABLE_PASSWORD 1
+#define ENABLE_SECRET 2
+
+/* How many characters to save at the end of config buffers to guarantee
+ * that "\nend" gets written.
+ */
+#define ENDSTRLEN 5
+
+#define MAXTTYLENGTH 512
diff --git a/data/mnet/Common/cli/include/parser_defs_exec.h b/data/mnet/Common/cli/include/parser_defs_exec.h
new file mode 100644
index 0000000..8c57b49
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_defs_exec.h
@@ -0,0 +1,86 @@
+/* Global commands */
+#define HISTORY 0
+#define HISTORY_ON 1
+#define HISTORY_OFF 2
+#define HISTORY_PRINT 3
+#define HISTORY_SIZE 4
+#define DUMP 5
+
+/* Exec and privileged command function defines */
+
+#define CMD_CONNECT_DEFAULT 1
+#define CMD_CONNECT_RLOGIN 2
+#define CMD_CONNECT_TELNET 3
+#define CMD_CONNECT_TN3270 4
+#define CMD_DISABLE 5
+#define CMD_ENABLE 6
+#define CMD_END 7 /* Analogous to exit, but is NVGEN'ed */
+#define CMD_EXIT 8
+#define CMD_QUIT 9
+
+/* Write command destinations */
+#define WRITE_UNUSED 0
+#define WRITE_CORE 1
+#define WRITE_ERASE 2
+#define WRITE_MEMORY 3
+#define WRITE_NETWORK 4
+#define WRITE_TERMINAL 5
+
+
+
+/* BEGIN FROM parser_defs_flash.h */
+
+/* Copy command defines */
+/* Source and destinations for copy command */
+#define COPY_UNUSED 0
+#define COPY_FLASH_TFTP 1
+#define COPY_TFTP_FLASH 2
+#define COPY_TFTP_BOOTFLASH 3
+#define COPY_BOOTFLASH_TFTP 4
+#define COPY_RUNNING_CONFIG_TFTP 5
+#define COPY_STARTUP_CONFIG_TFTP 6
+#define COPY_TFTP_RUNNING_CONFIG 7
+#define COPY_TFTP_STARTUP_CONFIG 8
+#define COPY_FFFFFFFF_FLASH 9 /* OBSOLETE */
+#define COPY_VERIFY_FLASH 10
+#define COPY_SSE_MEMORY 11
+#define COPY_ERASE_FLASH 12
+#define COPY_ERASE_BOOTFLASH 13
+#define COPY_VERIFY_BOOTFLASH 14
+#define COPY_MOP_FLASH 15
+#define COPY_MOP_BOOTFLASH 16
+#define COPY_FLASH_RCP 17
+#define COPY_RCP_FLASH 18
+#define COPY_RCP_BOOTFLASH 19
+#define COPY_BOOTFLASH_RCP 20
+#define COPY_RUNNING_CONFIG_RCP 21
+#define COPY_STARTUP_CONFIG_RCP 22
+#define COPY_RCP_RUNNING_CONFIG 23
+#define COPY_RCP_STARTUP_CONFIG 24
+#define COPY_RUNNING_CONFIG 25
+#define COPY_STARTUP_CONFIG 26
+#define COPY_TFTP 27
+#define COPY_RCP 28
+#define COPY_FLHLOG 29
+#define COPY_RUNNING_CONFIG_DISK 30
+#define COPY_STARTUP_CONFIG_DISK 31
+#define COPY_DISK_STARTUP_CONFIG 32
+#define COPY_DISK_FLASH 33
+#define COPY_FLASH_DISK 34
+#define COPY_DISK_TFTP 35
+#define COPY_TFTP_DISK 46
+#define COPY_DISK_DISK 47
+#define COPY_TECHSUPPORT_DISK 48
+#define COPY_TECHSUPPORT_TFTP 49
+
+#define COPY_DISK_BIOS 50
+
+/* END FROM parser_defs_flash.h */
+
+
+#define DEFAULT_PING_PACKETS 5
+
+#define SHOW_MEM_TERSE 1
+#define SHOW_MEM_FREE 2
+#define SHOW_MEM_PAGES 3
+
diff --git a/data/mnet/Common/cli/include/parser_errno.h b/data/mnet/Common/cli/include/parser_errno.h
new file mode 100644
index 0000000..bb25ccf
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_errno.h
@@ -0,0 +1,53 @@
+#ifndef _PARSER_ERRNO_H
+#define _PARSER_ERRNO_H
+
+#define S_parser_PROGRAMMING_ERROR (M_parser | 1)
+#define S_parser_NVRAM_WRITE_ERROR (M_parser | 2)
+#define S_parser_NVRAM_NULL_WRITE (M_parser | 3)
+#define S_parser_NVRAM_READ_ERROR (M_parser | 4)
+#define S_parser_NVRAM_BAD (M_parser | 5)
+#define S_parser_NVRAM_CRC_FAIL (M_parser | 6)
+#define S_parser_SYNTAX_AMBIGUOUS (M_parser | 7)
+#define S_parser_SYNTAX_UNKNOWN (M_parser | 8)
+#define S_parser_SYNTAX_INCOMPLETE (M_parser | 9)
+#define S_parser_SYNTAX_INVALID (M_parser | 10)
+#define S_parser_SYNTAX_NULL_STRING (M_parser | 11)
+#define S_parser_SYNTAX_INVALID_IPADDR_FORMAT (M_parser | 12)
+#define S_parser_SYNTAX_INVALID_HOSTNAME_FORMAT (M_parser | 13)
+#define S_parser_IPADDR_RESERVED (M_parser | 14)
+#define S_parser_IPADDR_NO_NAME_SERVER (M_parser | 15)
+#define S_parser_IPADDR_HOSTNAME_LOOKUP_FAILED (M_parser | 16)
+#define S_parser_RESOURCE_ALLOCATION_ERROR (M_parser | 17)
+
+#define S_parser_SYNTAX_INVALID_NETMASK_FORMAT (M_parser | 18)
+#define S_parser_SYNTAX_INVALID_NETMASK_CONTIGUOUS (M_parser | 19)
+#define S_parser_SYNTAX_INVALID_NETMASK_IPADDR_MISMATCH (M_parser | 20)
+
+/**************** ERROR CODE DOCUMENTATION ********************************
+
+S_parser_SYNTAX_NULL_STRING - input string is null
+S_parser_SYNTAX_INVALID_IPADDR_FORMAT - invalid dotted-decimal notation
+S_parser_SYNTAX_INVALID_HOSTNAME_FORMAT - invalid string for a hostname
+
+For parser_ipaddr_or_hostname() api, if the input flag had
+IPADDR_MARTIAN_TEST_REQUIRED as TRUE, the following error code
+is also possible.
+
+S_parser_IPADDR_RESERVED - the IP address is one of the reserved IP addresses
+
+For parser_ipaddr_or_hostname(0 api, if input flag had
+IPADDR_HOSTNAME_ALLOWED as TRUE, the folllowing error codes are also possible.
+
+S_parser_IPADDR_NO_NAME_SERVER - no ip name servers configured to do DNS lookup
+S_parser_IPADDR_HOSTNAME_LOOKUP_FAILED - DNS resolver failed on hostname lookup
+
+S_parser_RESOURCE_ALLOCATION_ERROR - internal error - unable to acquire resource
+
+
+S_parser_SYNTAX_INVALID_NETMASK_FORMAT - Netmask is malformed
+S_parser_SYNTAX_INVALID_NETMASK_CONTIGUOUS - Netmask binary format should
+ have contiguous 1
+
+******************************************************************************/
+
+#endif /* _PARSER_ERRNO_H */
diff --git a/data/mnet/Common/cli/include/parser_if.h b/data/mnet/Common/cli/include/parser_if.h
new file mode 100644
index 0000000..1a10371
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_if.h
@@ -0,0 +1,135 @@
+#ifndef __PARSER_IF_H__
+#define __PARSER_IF_H__
+
+
+#define CLI_MODULE_ID 100
+#define CLI_MAX_STRING_LEN 128
+
+#include <vxworks.h>
+#include <stdioLib.h>
+#include <tyLib.h>
+#include <taskLib.h>
+#include <errnoLib.h>
+#include <lstLib.h>
+#include <inetLib.h> /* for INET_ADDR_LEN */
+#include <timers.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <msgQLib.h>
+#include <sigLib.h>
+
+
+#include <../include/cli_parser_private.h>
+#include <../include/pstypes.h>
+#include <../include/psvxif.h>
+#include <../include/imsg.h>
+#include <../include/imc.h>
+#include <../include/address.h>
+#include <../include/parsertypes.h>
+#include <../include/config.h>
+#include <../include/parser_sim.h>
+#include <../include/parser.h>
+#include <../include/parser_defs_exec.h>
+#include <../include/parser_input.h>
+#include <../include/parser_sim.h>
+#include <../include/parser_util.h>
+#include <../include/parser_commands.h>
+#include <../include/nv.h>
+#include <../include/parser_errno.h>
+#include <../include/parser_ModNum.h>
+#include <../include/defs.h>
+#include <../include/parser_init.h>
+#include <../include/macros.h>
+#include <../include/parser_actions.h>
+
+static long nvgen_int;
+static char nvgen_string[CLI_MAX_STRING_LEN+1];
+
+#define SET_INT_MIB(mibtag,obj,def,string) if (csb->sense) {\
+ if (oam_setMibIntVar(CLI_MODULE_ID,mibtag,obj) !=STATUS_OK)\
+ printf(string);\
+ } else {\
+ if (oam_setMibIntVar(CLI_MODULE_ID,mibtag,def) !=STATUS_OK)\
+ printf(string);\
+ }
+
+#define NVGEN_INT_MIB(mibtag,string) if (csb->nvgen) {\
+ if (oam_getMibIntVar(mibtag,&nvgen_int) !=STATUS_OK) {\
+ printf(string);\
+ } else {\
+ printf("\n %s %d",csb->nv_command,nvgen_int);\
+ }\
+ return;\
+ }
+
+#define NVGEN_IP_MIB(mibtag,string) if (csb->nvgen) {\
+ if (oam_getMibIntVar(mibtag,&nvgen_int) !=STATUS_OK) {\
+ printf(string);\
+ } else {\
+ address_string(nvgen_int,nvgen_string);\
+ printf("\n %s %s",csb->nv_command,nvgen_string);\
+ }\
+ return;\
+ }
+
+#define NVADDGEN_INT_MIB(mibtag,string,first,last) if (csb->nvgen) {\
+ if (oam_getMibIntVar(mibtag,&nvgen_int) !=STATUS_OK) {\
+ printf(string);\
+ } else {\
+ if (first)\
+ printf("\n %s %d",csb->nv_command,nvgen_int);\
+ else\
+ printf(" %d",nvgen_int);\
+ }\
+ if (last)\
+ return;\
+ }
+
+#define NVGEN_STRING_MIB(mibtag,string) if (csb->nvgen) {\
+ if (oam_getMibByteAry(mibtag,nvgen_string,CLI_MAX_STRING_LEN) !=STATUS_OK) {\
+ printf(string);\
+ } else {\
+ printf("\n %s %s",csb->nv_command,nvgen_string);\
+ }\
+ return;\
+ }
+
+#define NVADDGEN_STRING_MIB(mibtag,string,first,last) if (csb->nvgen) {\
+ if (oam_getMibByteAry(mibtag,nvgen_string,CLI_MAX_STRING_LEN) !=STATUS_OK) {\
+ printf(string);\
+ } else {\
+ if (first)\
+ printf("\n %s %s",csb->nv_command,nvgen_string);\
+ else\
+ printf(" %s",nvgen_string);\
+ }\
+ if (last)\
+ return;\
+ }
+
+
+#define NVGEN_BOOL_MIB(mibtag,string) if (csb->nvgen) {\
+ if (oam_getMibIntVar(mibtag,&nvgen_int) !=STATUS_OK) {\
+ printf(string);\
+ } else {\
+ if (nvgen_int)\
+ printf("\n %s enable",csb->nv_command);\
+ else\
+ printf("\n no %s enable",csb->nv_command);\
+ }\
+ return;\
+ }
+
+#define NVGEN_TIMER_MIB(mibtag,timer) if (csb->nvgen) {\
+ oam_getMibIntVar(mibtag,&nvgen_int);\
+ printf("\n\t %s %s %d",csb->nv_command,timer,nvgen_int);\
+ return;\
+ }
+
+#define NVADDGEN_TIMER_MIB(mibtag,timer) if (csb->nvgen) {\
+ oam_getMibIntVar(mibtag,&nvgen_int);\
+ printf("\n\t %s %s %d",csb->nv_command,timer,nvgen_int);\
+ }
+
+#endif
diff --git a/data/mnet/Common/cli/include/parser_init.h b/data/mnet/Common/cli/include/parser_init.h
new file mode 100644
index 0000000..6da3562
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_init.h
@@ -0,0 +1,38 @@
+#ifndef __PARSER_INIT_H
+#define __PARSER_INIT_H
+
+
+
+#define MAXCSB 32
+
+/*
+ * Externals
+ */
+extern parser_mode *exec_mode;
+extern parser_mode *config_mode;
+
+extern void test_parser_init(void);
+extern void parser_pipe_init(void);
+extern void show_os_chain_init(void);
+extern void parser_modes_init(void);
+extern void command_parser_init(void);
+extern void exec_parser_init(void);
+extern void parse_pager_init(void);
+extern void parser_sema_init(void);
+extern void parser_task_init(void);
+extern void parser_iowork_init(void);
+extern void parser_configure(void);
+extern parseinfo* get_csb(const char*);
+extern void BuildPrompt(parseinfo *, tt_soc*);
+
+extern void console_main(void);
+extern void parser_init(void);
+extern void getPrompt( parseinfo*, char*, char* );
+extern void processCommand( tpPARSERSIM );
+
+extern boolean config_prompt;
+extern int consoleFd;
+extern void parser_check();
+
+extern tBSEMAPHORE configSemId;
+#endif __PARSER_INIT_H
diff --git a/data/mnet/Common/cli/include/parser_input.h b/data/mnet/Common/cli/include/parser_input.h
new file mode 100644
index 0000000..3faf1e1
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_input.h
@@ -0,0 +1,84 @@
+#ifndef __PARSER_INPUT_H__
+#define __PARSER_INPUT_H__
+
+
+/* This should be >= MAX_TELNET_SESSIONS in telnetLib.c
+ * so that all telnet sessions can monitor
+ */
+#define MAX_FDS 5
+
+#define LINES 24
+#define LENGTH_DEFAULT LINES
+
+#define MAX_USERNAME_LEN 256
+#define MAX_PASSWD_LEN 256
+#define MAX_RETRIES 3
+#define MAXHOSTNAMELEN 64
+
+
+#define DEFAULT_EXEC_TIMEOUT ( 10 * 60 )
+
+#define IO_SIGINT 0x01
+#define IO_EXEC_TIMEOUT 0x02
+#define IO_SIGFLAGS_DELETED 0x00001000
+#define MAX_HISTORY 5
+
+typedef struct ioInfo {
+ parseinfo *csb;
+ tCSEMAPHORE ioSemId;
+ tUOCTET4 ioModuleId;
+ tUOCTET4 requestId;
+ tUOCTET4 flags;
+ tUOCTET4 sockFd;
+ tpOCTET execHistory[MAX_HISTORY];
+ tpOCTET configHistory[MAX_HISTORY];
+} tIOINFO,*tpIOINFO;
+
+typedef enum {
+ IO_RAW_MODE = 0,
+ IO_LINE_MODE,
+ IO_ECHO_MODE
+} tTERMINALMODE;
+
+/* Extern Declarations */
+extern tCSEMAPHORE initSemId;
+extern int consoleFd;
+extern tINT fdArray[MAX_FDS];
+extern boolean cgipipeDone;
+extern tINT cgiStatus;
+extern tINT cgiMode;
+/*extern tUID cgiUid;*/
+extern char usrPrompt[];
+extern char passwdPrompt[];
+extern char loginErrMsg[];
+
+extern tOCTET2 registerFd( tINT );
+extern tOCTET2 unregisterFd( tINT );
+/*extern void io_work(tINT, tINT, boolean, tUID, SEM_ID, boolean );*/
+extern void cgi_io_work(tINT, tINT );
+extern tOCTET2 io_more_buffer( tINT, char *, time_t );
+extern void moreFileOrBuffer( int , parseinfo *, int, boolean , time_t );
+
+extern tINT ioSetTerminalMode( int, tTERMINALMODE ) ;
+extern void show_techsupport( parseinfo *) ;
+extern void startIOTimer( parseinfo *csb );
+extern void stopIOTimer( parseinfo *csb );
+extern STATUS setExecTimeout(parseinfo *csb );
+
+
+extern FUNCPTR cli_logoutf;
+extern int cli_logVar;
+extern int ShellTask;
+extern int SSHTask;
+extern int installedVxShell;
+extern int TelnetTask;
+extern int ConsoleTask;
+extern boolean ExitFlag;
+extern int infd;
+extern int outfd;
+extern BOOL defaultUserInUse;
+
+#define PARSE_ADD_BOOT_PARAM 50
+#define PARSE_ADD_VXSH_CHAIN 51
+
+#endif /* __PARSER_INPUT_H_ */
diff --git a/data/mnet/Common/cli/include/parser_modes.h b/data/mnet/Common/cli/include/parser_modes.h
new file mode 100644
index 0000000..e51bc99
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_modes.h
@@ -0,0 +1,8 @@
+#ifndef __PARSER_MODES_H
+#define __PARSER_MODES_H
+
+#define PARSER_MODE_NONE 0x0001
+#define PARSER_MODE_ALIASES 0x0002
+#define PARSER_MODE_PRIVILEGE 0x0004
+
+#endif
diff --git a/data/mnet/Common/cli/include/parser_privilege.h b/data/mnet/Common/cli/include/parser_privilege.h
new file mode 100644
index 0000000..fef59b7
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_privilege.h
@@ -0,0 +1,19 @@
+#ifndef __PARSER_PRIVILEGE_H__
+#define __PARSER_PRIVILEGE_H__
+
+typedef struct privq_ {
+ struct privq_ *next; /* Next queue entry */
+ trans_priv *priv; /* Priv pointer */
+} privq;
+
+typedef struct priv_nvgenq_ {
+ struct priv_nvgenq_ *next; /* Next queue entry */
+ uint level; /* Priv level */
+ char command[PARSEBUF]; /* Current command */
+} priv_nvgenq;
+
+
+extern void priv_push(parseinfo *, trans_priv *);
+extern boolean nvgen_privilege (parseinfo *, trans_priv *, const char *);
+
+#endif /* __PARSER_PRIVILEGE_H__ */
diff --git a/data/mnet/Common/cli/include/parser_sim.h b/data/mnet/Common/cli/include/parser_sim.h
new file mode 100644
index 0000000..66b6d5f
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_sim.h
@@ -0,0 +1,33 @@
+#ifndef __PARSER_SIM_H
+#define __PARSER_SIM_H
+
+typedef struct parser_sim {
+ tCOMSIM comsim; /* Generic Interaction Module */
+ tOCTET command[PARSEBUF]; /* Command to be processed */
+ tOCTET lastchar; /* For Help Processing */
+ void *index; /* For More Processing */
+ tOCTET4 maxCount; /* For More Processing */
+ parseinfo *csb; /* CSB of I/O Task */
+} tPARSERSIM, *tpPARSERSIM;
+
+
+#define mFILL_PARSER_SIM( pParserSim, Csb, origin, dest, service, request, \
+ cmd, Lastchar, Index, MaxCount ) \
+ { \
+ tpCOMSIM pComSim = &(pParserSim->comsim); \
+ strcpy( (pParserSim->command), cmd ); \
+ pParserSim->csb = Csb; \
+ pParserSim->lastchar = Lastchar; \
+ pParserSim->index = Index; \
+ pParserSim->maxCount = MaxCount; \
+ mFILL_COM_SIM( pComSim, origin, dest, service, request, NULL, 0, 0); \
+ }
+
+
+#define PARSER_CMD_PROC_REQ 0x3100
+#define PARSER_CMD_PROC_IND 0x3200
+
+#define IO_WAIT_COMPLETE_IND 0xF2FE
+#define IO_CMD_COMPLETE_IND 0xF2FF
+
+#endif /* __PARSER_SIM_H */
diff --git a/data/mnet/Common/cli/include/parser_util.h b/data/mnet/Common/cli/include/parser_util.h
new file mode 100644
index 0000000..0f3b306
--- /dev/null
+++ b/data/mnet/Common/cli/include/parser_util.h
@@ -0,0 +1,21 @@
+#ifndef __PARSER_UTIL_H__
+#define __PARSER_UTIL_H__
+
+#define FUNCARGS0(argArray)
+#define FUNCARGS1(argsArray) argsArray[0]
+#define FUNCARGS2(argsArray) FUNCARGS1((argsArray)) ## , ## \
+ argsArray[1]
+#define FUNCARGS3(argsArray) FUNCARGS2((argsArray)) ## , ## argsArray[2]
+#define FUNCARGS4(argsArray) FUNCARGS3((argsArray)) ## , ## argsArray[3]
+#define FUNCARGS5(argsArray) FUNCARGS4((argsArray)) ## , ## argsArray[4]
+
+#define ARGS(argsArray,numArgs) FUNCARGS##numArgs(argsArray)
+
+extern boolean null (const char *s);
+extern char *deblank( const char *);
+extern boolean yes_or_no( const char *, boolean, boolean );
+extern boolean confirm( char *);
+
+extern void parser_return(parseinfo *, int errno_val);
+
+#endif /* __PARSER_UTIL_H_ */
diff --git a/data/mnet/Common/cli/include/parsertypes.h b/data/mnet/Common/cli/include/parsertypes.h
new file mode 100644
index 0000000..fc05d4e
--- /dev/null
+++ b/data/mnet/Common/cli/include/parsertypes.h
@@ -0,0 +1,145 @@
+#ifndef __PARSERTYPES_H__
+#define __PARSERTYPES_H__
+
+/* A BIG KLUDGE */
+
+typedef void tt_soc;
+
+#define NULLTTY (( void *) -1 )
+
+/* Check parser_util.c */
+/* A BIG KLUDGE */
+
+#define SCREEN_WIDTH 80
+
+#define sstrncpy strncpy
+
+/* FROM parser_defbreaksets.h */
+
+/* Break character set for the exec and config command levels.
+ */
+#define EXEC_BREAKSET "\r\n?\t"
+#define CONFIG_BREAKSET "\r\n\032?\t"
+#define NVCONFIG_BREAKSET "\r\n"
+
+/* FROM parser_defbreaksets.h */
+
+
+/* FROM sys/h/globs.h */
+
+/*
+ * define data structure for named things.
+ * NAMEDTHINGMACRO defines those fields common to all named things.
+ * This allows common code to find named things in queues, and so on.
+ */
+
+#define NAMEDTHINGNAMELEN 20
+#define NAMEDTHINGMACRO \
+ char name[NAMEDTHINGNAMELEN+1];
+/* FROM sys/h/globs.h */
+
+
+#define NULLFUNC ((void *) 0)
+
+#define EXEC_MODE 1
+#define CONFIG_MODE 2
+/*
+ * Define forward references to major system types
+ */
+
+#define STRUCTURE_REF(str) typedef struct str ## _ str
+
+STRUCTURE_REF(nvtype); /* h/config.h */
+STRUCTURE_REF(nvtype_private); /* h/config.h */
+STRUCTURE_REF(parseinfo); /* h/config.h */
+STRUCTURE_REF(parser_mode); /* h/config.h */
+STRUCTURE_REF(parser_alias); /* h/config.h */
+
+/*
+ * Can't use STRUCTURE_REF for transition because
+ * it is a constant.
+ */
+typedef const struct transition_ transition; /* h/config.h */
+
+/*
+ * Type Definitions -- note that these are really compiler specific
+ */
+
+#if !defined(_SIZE_T) && !defined(_GCC_SIZE_T)
+#define _SIZE_T
+
+#ifdef __GNUC__
+#define _GCC_SIZE_T
+/*
+ typedef __typeof__ (sizeof (0)) size_t;
+*/
+#else
+typedef unsigned int size_t;
+#endif /* __GNUC__ */
+
+#endif /* _SIZE_T */
+
+#ifdef caddr_t
+#undef caddr_t
+typedef unsigned char *caddr_t;
+#endif
+
+/*
+ * Size specific defines
+ */
+typedef signed char int8;
+typedef signed short int16;
+typedef signed long int32;
+typedef signed long long int64;
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef unsigned long uint32;
+typedef unsigned long long uint64;
+typedef unsigned char tinybool;
+typedef void forktype;
+
+/*
+ * Queuetype data structure
+ */
+typedef struct queuetype_ {
+ void *qhead; /* head of queue */
+ void *qtail; /* tail of queue */
+ int count; /* possible count */
+ int maximum; /* maximum entries */
+} queuetype;
+
+
+#define QUEUESIZE(q) queuesize_inline(q)
+#define QUEUEFULL(q) queuefull_inline(q)
+#define QUEUEFULL_RESERVE(q, reserve) \
+ queuefull_reserve_inline(q, reserve)
+#define QUEUEEMPTY(q) queueempty_inline(q)
+#define QUEUEMAXIMUM(q) queuemax_inline(q)
+
+
+typedef struct nexthelper_ {
+ struct nexthelper_ *next;
+ unsigned char data[0];
+} nexthelper;
+
+
+/*
+ * Define the PACKED macro
+ */
+#if defined(__mips) || defined(__mc68000) || defined(__PPC__)
+#define PACKED(item) item __attribute__ ((packed))
+#else
+#define PACKED(item) item
+#endif
+
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+
+#ifdef NOTHING
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+
+#endif __PARSERTYPES_H__
+
diff --git a/data/mnet/Common/cli/include/platdef.h b/data/mnet/Common/cli/include/platdef.h
new file mode 100644
index 0000000..1891efb
--- /dev/null
+++ b/data/mnet/Common/cli/include/platdef.h
@@ -0,0 +1,229 @@
+#ifndef _PLATDEF_H_
+#define _PLATDEF_H_
+
+#include <stddef.h> /* _LITTLE_ENDIAN, _BIG_ENDIAN */
+
+ /*
+ **
+ ** some basic defines
+ **
+ */
+
+#define NO_PROTECT 0
+#define PROTECT 1
+
+#define RC_NONE 0
+#define RC_OK OK
+#define RC_ERR ERROR
+
+#if 0
+#define _LITTLE_ENDIAN_ 1234
+#define _BIG_ENDIAN_ 4321
+#define LITTLE_ENDIAN _LITTLE_ENDIAN_
+#define BIG_ENDIAN _BIG_ENDIAN_
+
+#define BYTE_ORDER _BYTE_ORDER
+#endif
+#define LITTLE_ENDIAN _LITTLE_ENDIAN
+#define BIG_ENDIAN _BIG_ENDIAN
+
+#define _ASCII_CHAR_ abcd
+
+#define PRIVATE static /* local routines, can be changed to make some routines
+ visible for debugging */
+
+/*
+** INCLUDES
+*/
+
+/* common includes */
+
+
+
+/* system specific includes. They contain primitive data type definitions */
+
+
+#ifdef UNIX
+#ifdef SUNSOL24
+#define PStypeString ((tOCTET *) "Sun Solaris 2.4")
+#endif
+#include <psunif.h>
+#endif
+
+
+#ifdef VXWORKS
+#ifdef VXWORKS53
+#define PStypeString((tOCTET *) "vxWorks 5.3")
+#endif
+#endif
+
+ /*
+ **
+ ** Basic defines
+ **
+ */
+
+
+#ifndef BYTE_ORDER /* byte order should be defined in platform file */
+#error Unrecognized Platform
+#endif
+
+#ifndef CHAR_SET
+#error Unrecognized Platform
+#endif
+
+#define PSNONSTDIO 1
+#define PSSTDIO 0
+
+/*
+** Macros
+*/
+
+
+/* Data representation macros */
+
+ /*
+ **
+ ** Macros for data conversion are:
+ ** mPS_2OCTET_TO_NET: convert 2 octets to network format
+ ** mPS_4OCTET_TO_NET: convert 4 octets to network format
+ ** mPS_2OCTET_TO_HOST: convert 2 octets to host format
+ ** mPS_4OCTET_TO_HOST: convert 4 octets to host format
+ **
+ */
+
+#if (BYTE_ORDER == _BIG_ENDIAN_)
+
+#define mPS_2OCTET_TO_NET(pdest) \
+ (*(pdest))= ((*(pdest))<<8) \
+ | ( ((*(pdest))>>8) & 0x00ff)
+
+#define mPS_4OCTET_TO_NET(pdest) \
+ (*(pdest))= ( ((*(pdest))>>24) & 0x000000ff) \
+ | ((*(pdest))<<24) \
+ | (0x0000ff00 & ((*(pdest)) >> 8)) \
+ | ( 0x00ff0000 & ((*(pdest)) << 8))
+
+#define mPS_2OCTET_TO_HOST mPS_2OCTET_TO_NET
+
+#define mPS_4OCTET_TO_HOST mPS_4OCTET_TO_NET
+
+
+#else /* LITTLE_ENDIAN (this is the chosen network order) */
+
+#define mPS_2OCTET_TO_NET(pdest)
+#define mPS_4OCTET_TO_NET(pdest)
+#define mPS_2OCTET_TO_HOST(pdest)
+#define mPS_4OCTET_TO_HOST(pdest)
+
+#endif /* BIG_ENDIAN */
+
+
+#if (CHAR_SET == _ASCII_CHAR_SET_)
+
+#define mPS_OCTET_TO_HOST( pField, len)
+
+#define mPS_OCTET_TO_NET( pField, len)
+
+#else
+
+XXX not supported
+
+#endif /* CHAR_SET */
+
+
+
+/*
+** prototypes for remaining platform specific services
+*/
+
+
+/* Any platform specific initialization and auxilary functions */
+
+extern tOCTET2 PS_Init (tOCTET2 ioType, tOCTET4 hInst, tOCTET4 hPInst, void *cmdParam,
+ tOCTET2 nCmdShow);
+
+extern tOCTET2 PSWaitForEvent (tpEVENT pEvent, tOCTET4 *p1, tOCTET4 *p2, tOCTET4 *p3,
+ struct timeval *pTimeout);
+
+/* Timer Tic (hearbeat) Service Interface */
+
+
+extern tOCTET2 PS_TimerInit (void (*tickhandler)(tOCTET2 tick_gran));
+extern tOCTET2 PS_TimerTerm (void);
+extern tMSECTIME PS_MsecTime (void);
+extern tSECTIME PS_SecTime (void);
+extern char *PS_GetAscTime (void);
+
+ /*
+ **
+ ** Memory management and other macros defined in
+ ** platform specific include files
+ **
+ */
+
+
+ /*
+ **
+ ** Events
+ **
+ */
+
+extern tEVENT or_timer_event;
+extern tEVENT or_network_event;
+extern tEVENT ij_cr_event;
+extern tEVENT ij_cag_event;
+extern tEVENT ij_db_event;
+
+
+ /*
+ **
+ ** I/O, logging and tracing
+ **
+ */
+
+#ifndef PS_getopt
+extern int PS_getopt (int argc, tOCTET **argv, char *opts);
+#endif
+#ifndef PS_Printf
+extern void PS_Printf (char *lpszFormat);
+#endif
+extern void PS_ErrPrintf ( int errCode, const char *szFormat, ...);
+
+
+ /*
+ **
+ ** data buffer management
+ **
+ */
+
+tOCTET *PS_alloc_buf(tOCTET4 bufsz);
+tOCTET2 PS_Heap_Verify(char *pMem);
+void PS_free_buf(void *pBuf);
+
+
+/* Exit Function */
+
+void PS_AtExit(void (*func) (void));
+void PS_CleanUp(void);
+void PS_kickSched(void);
+
+/* Various status registration functions */
+
+void PS_Reg_Status(void (*func) (void));
+void PS_Reg_Trace(void (*func) (tOCTET2 type, tOCTET2 onOff));
+void PS_Rreg_GetNextServer(char * (*func) (char *server, tOCTET2 *selected));
+void PS_Rreg_SelectServer(tUOCTET2 (*func) (char *server));
+void PS_Reg_MaskFunc(void (*func) (void));
+
+#endif /* _PLATDEF_H */
+
+
+
+
+
+
+
+
+
+
diff --git a/data/mnet/Common/cli/include/pstypes.h b/data/mnet/Common/cli/include/pstypes.h
new file mode 100644
index 0000000..71ad0a2
--- /dev/null
+++ b/data/mnet/Common/cli/include/pstypes.h
@@ -0,0 +1,82 @@
+#ifndef _PSTYPES_H_
+#define _PSTYPES_H_
+
+
+typedef char tOCTET; /* signed octet */
+typedef unsigned char tUOCTET; /* unsigned octet */
+typedef int tINT; /* Integer */
+typedef short tOCTET2; /* signed 2 octets */
+typedef short s_size_t; /* signed size_t */
+typedef unsigned us_size_t; /* unsigned size_t */
+typedef long tOCTET4; /* signed 4 octets */
+typedef unsigned short tUOCTET2; /* unsigned 2 octets */
+typedef unsigned long tUOCTET4; /* unsigned 4 octets */
+typedef FILE tFILE;
+typedef int tTASKID;
+typedef int boolean;
+typedef uint32_t ipaddrtype;
+
+ /*
+ **
+ ** Basic data type pointers
+ **
+ */
+
+typedef char * tpOCTET;
+typedef unsigned char * tpUOCTET;
+typedef short * tpOCTET2;
+typedef long * tpOCTET4;
+typedef unsigned short * tpUOCTET2;
+typedef unsigned long * tpUOCTET4;
+
+/*
+ * libc data types
+ */
+typedef FILE * tpFILE;
+
+/*
+ * kernel data types
+ */
+typedef SEM_ID tSEMAPHORE; /* semaphore */
+typedef SEM_ID tCSEMAPHORE; /* counting semaphore */
+typedef SEM_ID tBSEMAPHORE; /* binary semaphore */
+typedef SEM_ID tMSEMAPHORE; /* mutex semaphore */
+
+/*
+ * missing from vxWorks' Posix types
+ */
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+
+/*
+ * Cisco IOS compatibility
+ */
+typedef long long longlong;
+typedef unsigned int uint;
+typedef unsigned char uchar;
+typedef unsigned long ulong;
+typedef unsigned long long ulonglong;
+typedef unsigned long long sys_timestamp;
+
+/*
+ * Special values for data types
+ */
+#ifndef NULLP
+#define NULLP ((void *) 0)
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define PSmalloc(Size) malloc(Size)
+#define PScalloc(Num, Size) calloc(Num,Size)
+#define PSrealloc(Block,Size) realloc(Block,Size)
+#define PSfree(Block) free(Block)
+
+#endif
+
diff --git a/data/mnet/Common/cli/include/psvxif.h b/data/mnet/Common/cli/include/psvxif.h
new file mode 100644
index 0000000..360056e
--- /dev/null
+++ b/data/mnet/Common/cli/include/psvxif.h
@@ -0,0 +1,252 @@
+#ifndef _PSVXIF_H_
+#define _PSVXIF_H_
+
+
+ /*
+ **
+ ** Primitive data types and declarations
+ **
+ */
+
+
+#ifndef CHAR_SET
+#define CHAR_SET _ASCII_CHAR_
+#endif
+
+/*
+ * Borrowed from cdecl.h
+ */
+#if (defined(__STDC__) || defined(__cplusplus)) && !defined(__P)
+#define __P(x) x
+#endif
+
+/*
+ * Set BYTE_ORDER based on cpu family.
+ *
+ * This may need some adjustment if
+ * a cpu can do both byte orders.
+ */
+#ifndef BYTE_ORDER
+
+#if CPU_FAMILY == I80X86
+#define BYTE_ORDER LITTLE_ENDIAN
+
+#elif CPU_FAMILY == SIMNT
+#define BYTE_ORDER LITTLE_ENDIAN
+
+#elif CPU_FAMILY == PPC
+#define BYTE_ORDER BIG_ENDIAN
+
+#else
+#error Unrecognized Platform -- missing BYTE_ORDER
+#endif
+
+#endif /* BYTE_ORDER */
+
+
+/*
+** Make RC_OK and RC_ERROR to match vxworks OK and ERROR
+*/
+
+#ifdef RC_OK
+#undef RC_OK
+#endif
+#define RC_OK OK
+
+#ifdef RC_ERR
+#undef RC_ERR
+#endif
+#define RC_ERR ERROR
+
+#define SIGERR 0xFFFFFFFF
+
+ /*
+ **vxWorks data data types
+ **
+ */
+typedef SEM_B_STATE tSEMBSTAT;
+
+
+
+/*
+ * Task Stack Parameters
+ */
+
+typedef enum {
+ STACK_SIZE = 1,
+ STACK_MARGIN,
+ STACK_CURRENT
+} tSTACKPARAM;
+
+#define KERNEL_PID 1
+#define KERNEL_UID 1
+#define KERNEL_GID 1
+ /*
+ ** List Constant
+ */
+
+#define FIFO_LIST 1
+#define PRIORITY_LIST 2
+#define PROTECTED_LIST PROTECT
+#define UNPROTECTED_LIST NO_PROTECT
+#define BINARY_SEMAPHORE 1
+#define COUNT_SEMAPHORE 2
+#define MUTEX_SEMAPHORE 3
+
+ /*
+ ** vxWorks mutex semphore default flag
+ */
+#define PS_DEFAULT_MUTEX_SEM_FLAG \
+ (SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
+#define PS_DEFAULT_BINARY_SEM_FLAG (SEM_Q_PRIORITY)
+#define PS_DEFAULT_COUNT_SEM_FLAG (SEM_Q_PRIORITY)
+#define PS_DEFAULT_BINARY_SEM_STAT (SEM_FULL)
+#define PS_DEFAULT_COUNT_SEM_COUNT 1
+
+
+/*
+ * Basic constants.
+ */
+#define MAXCHAR 0x7F /* largest positive 8-bit signed num */
+#define MAXUCHAR 0xFF /* largest positive 8-bit unsigned */
+#define MAXSHORT 0x7FFF /* largest positive 16-bit number */
+#define MAXUSHORT 0xFFFF /* largest positive 16-bit number */
+#define MAXINT 0x7FFFFFFFL /* largest positive 32-bit number */
+#define MAXUINT 0xFFFFFFFFL /* largest unsigned 32-bit number */
+#define MAXLONG MAXINT /* largest positive 32-bit number */
+#define MAXULONG MAXUINT /* largest unsigned 32-bit number */
+#define MINCHAR 0x80 /* smallest possible signed 8-bit */
+#define MINSHORT 0x8000 /* smallest possible signed 16-bit */
+#define MININT 0x80000000L /* smallest possible signed 32-bit */
+#define MINLONG MININT /* smallest possible signed 32-bit */
+
+
+ /*
+ ** vxWorks generic constants
+ */
+#define SEM_DEFAULT_TIMEOUT WAIT_FOREVER
+#define SEM_TIMEOUT_NOWAIT NO_WAIT
+ /*
+ **
+ ** Other data types
+ **
+ */
+
+#define tPROCID tOCTET4 /* process identifier */
+#define tPROCID tOCTET4 /* process identifier */
+#define tSEMTYPE tOCTET2 /* semaphore type */
+#define tEVENT tUOCTET2 /* event descriptor */
+#define tpEVENT tUOCTET2 * /* event pointer */
+#define tTIMER timer_t /* timer identifier */
+#define tTIME time_t
+#define tSECTIME tUOCTET4 /* time in seconds */
+#define tMSECTIME tUOCTET4 /* time in milliseconds */
+#define PS_TIMER_GRAN ( (tUOCTET4)50000 ) /* 50 msec */
+#define PS_MSECT_GRAN ( (PS_TIMER_GRAN)/( (tUOCTET4)1000 ) )/* gran in msec*/
+#define mMSEC_TO_TICKS(ms) ((ms)*sysClkRateGet()/1000)
+#define SOCKET int
+
+ /*
+ **
+ ** system resource limites
+ **
+ */
+
+#define MIN_SYS_MEM 25600 /* 25k */
+
+ /*
+ **normalized marcos
+ */
+
+#define PS_TASK_ARGS \
+(int a1,int a2,int a3,int a4,int a5,int a6,int a7,int a8,int a9,int a10)
+
+#define PStaskDelay taskDelay
+#define PStaskDelete taskDelete
+#define PStaskSuspend taskSuspend
+#define PStaskResume taskResume
+#define PStaskRestart taskRestart
+#define PStaskIdSelf taskIdSelf
+
+/*semphore stuff*/
+
+#define PSsemBCreate semBCreate
+#define PSsemCCreate semCCreate
+#define PSsemMCreate semMCreate
+#define PSsemGive semGive
+#define PSsemTake semTake
+#define PSsemGiveForce semGiveForce
+#define PSsemDelete semDelete
+#define PSsemInfo semInfo
+#define PSsemFlush semFlush
+
+/* Timer functions */
+
+#define PStimer_cancel timer_cancel
+#define PStimer_connect timer_connect
+#define PStimer_create timer_create
+#define PStimer_delete timer_delete
+#define PStimer_gettime timer_gettime
+#define PStimer_settime timer_settime
+#define PSclock_gettime clock_gettime
+
+#define PSprintf printf
+#define PS_Printf printf
+#define PSfprintf fprintf
+#define PSfopen fopen
+#define PSfclose fclose
+#define PSfputs fputs
+#define PSfgets fgets
+#define PSfscanf fscanf
+#define PSmemset(dest, val, len) memset(dest, val, len)
+#define PSmemcpy(dest, src, len) memcpy(dest, src, len)
+#define PSmemcmp(dest, src, len) memcmp(dest, src, len)
+#define PSmemmove(dest, src, len) memmove(dest, src, len)
+#define PSstrlen(src) strlen(src)
+#define PSstrrchr(dest, pat) strrchr(dest, pat)
+#define PSstrchr strchr
+#define PSstrdup strdup
+#define PSstrcmp(dest, src) strcmp(dest, src)
+#define PSstrncmp(dest, src, len) strncmp(dest, src, len)
+#define PSstrncasecmp(dest, src, len) strncasecmp(dest, src, len)
+#define PSstrstr strstr
+#define PSassert assert
+#define PStoupper toupper
+#define mPSATEXIT atexit
+
+#ifndef MEMCPY_DEBUG
+#define PSsprintf sprintf
+#define PSstrcat(dest, src) strcat(dest, src)
+#define PSstrncat(dest, src, len) strncat(dest, src, len)
+#define PSstrcpy(dest, src) strcpy(dest, src)
+#define PSstrncpy(dest, src, len) strncpy(dest, src, len)
+#endif /* MEMCPY_DEBUG */
+
+#define PSabs(x) ( ((x) < 0) ? -(x) : (x) )
+#define PSmin(x, y) ( ((x) < (y)) ? (x) : (y) )
+#define PSmax(x, y) ( ((x) < (y)) ? (y) : (x) )
+
+
+ /* For FileSystem / HTTPD
+ *
+ */
+
+#define mVOLNAME "/local"
+
+
+/*
+** more macros
+*/
+
+#define PS_MSEC_TO_TICK(sec) ( sec * sysClkRateGet() )
+#define PSabort() {abort_brp(); abort();}
+#define PSexit(i) {exit_brp();exit(i);}
+#define PSpanic(s) panic(s)
+#define mMYHOSTNAME
+
+
+typedef void (tFREEFUNC)(void *);
+typedef void (* tpFREEFUNC)(void *);
+
+#endif /* _PSVXIF_H_ */
+
diff --git a/data/mnet/Common/cli/include/sys_debug.h b/data/mnet/Common/cli/include/sys_debug.h
new file mode 100644
index 0000000..f0183b6
--- /dev/null
+++ b/data/mnet/Common/cli/include/sys_debug.h
@@ -0,0 +1,20 @@
+#ifndef __SYS_DEBUG_H
+#define __SYS_DEBUG_H
+
+typedef void (*DEBUG_ALL_FUNCTION_PTR)(boolean);
+typedef void (*DEBUG_SHOW_FUNCTION_PTR)(void);
+
+typedef struct {
+ NODE debugNode;
+ void *debugFunction;
+ debug_item_type *debug_items;
+ char *heading;
+} tDEBUG_FUNC_NODE;
+
+extern void sys_debug_init(void);
+extern void invoke_debug_all(boolean);
+extern void invoke_debug_show(void);
+extern STATUS add_debug_all(DEBUG_ALL_FUNCTION_PTR, const debug_item_type*);
+extern STATUS add_debug_show(DEBUG_SHOW_FUNCTION_PTR, const debug_item_type*,
+ const char*);
+#endif __SYS_DEBUG_H
diff --git a/data/mnet/Common/cli/include/ttyutil.h b/data/mnet/Common/cli/include/ttyutil.h
new file mode 100644
index 0000000..fc8bb64
--- /dev/null
+++ b/data/mnet/Common/cli/include/ttyutil.h
@@ -0,0 +1,88 @@
+#ifndef __TTYUTIL_H__
+#define __TTYUTIL_H__
+
+
+
+/* Special Characters Mapping */
+#define CH_NULL 0x00
+#define CH_SOH 0x01
+#define CH_STX 0x02
+#define CH_ETX 0x03
+#define CH_EOT 0x04
+#define CH_ENQ 0x05
+#define CH_ACK 0x06
+#define CH_BEL 0x07 /* the bell character */
+#define CH_BS 0x08
+#define CH_HT 0x09
+#define CH_NL 0x0A
+#define CH_VT 0x0B
+#define CH_NP 0x0C
+#define CH_CR 0x0D
+#define CH_SO 0x0E
+#define CH_SI 0x0F
+#define CH_DLE 0x10
+#define CH_DC1 0x11
+#define CH_DC2 0x12
+#define CH_DC3 0x13
+#define CH_DC4 0x14
+#define CH_NAK 0x15
+#define CH_SYN 0x16
+#define CH_ETB 0x17
+#define CH_CAN 0x18
+#define CH_EM 0x19
+#define CH_SUB 0x1A
+#define CH_ESC 0x1B
+#define CH_FS 0x1C
+#define CH_GS 0x1D
+#define CH_RS 0x1E
+#define CH_US 0x1F
+#define CH_SPC 0x20
+#define CH_DEL 0x7F
+
+#define CH_LT_SQ_BRACE 0x5B
+
+#define CH_EXT 0x80
+
+#define CH_CTRL_B 0x02
+#define CH_CTRL_C 0x03
+#define CH_CTRL_F 0x06
+#define CH_CTRL_N 0x0E
+#define CH_CTRL_P 0x10
+#define CH_CTRL_Z 0x1A
+
+typedef enum {
+ PRIMARY_TASK = 1,
+ SECONDARY_TASK
+} tTTYATTR;
+
+
+/*
+ * Primary/Secondary task abstraction
+ * for hierarchical distribution of signals.
+ */
+extern STATUS ttySignalSecondaryTasks(int fd, int signo);
+extern STATUS taskSetTtyAttr(int fd, tTTYATTR type, BOOL value);
+extern BOOL taskGetTtyAttr(int fd, tTTYATTR type);
+
+/*
+ * Manage list of control characters
+ */
+extern STATUS addSignalChar (int ch, int signo);
+extern STATUS removeSignalChar (int signo);
+
+/*
+ * Provides maintenance of per-task signal mask
+ */
+extern void defaultSignalHandler(int signo);
+
+extern STATUS setTaskSignalFlag (int tid, int signo, BOOL enable);
+extern BOOL isTaskSignalSet (int tid, int signo);
+extern uint32_t getTaskSignalMask (int tid);
+extern STATUS setTaskSignalMask (int tid, uint32_t sigMask);
+
+/*
+ * Quick check to see if a signal has been delivered to current task
+ */
+extern BOOL tty_signal(void);
+
+#endif
diff --git a/data/mnet/Common/cli/include/vxworks_cfg_chain.h b/data/mnet/Common/cli/include/vxworks_cfg_chain.h
new file mode 100644
index 0000000..55f8302
--- /dev/null
+++ b/data/mnet/Common/cli/include/vxworks_cfg_chain.h
@@ -0,0 +1,157 @@
+
+
+
+enum{
+ OTHER,
+ STARTUP_SCRIPT,
+ FLAGS,
+ TARGET_NAME,
+ FTP_PASSWD,
+ USER_NAME,
+ GATEWAY_IP,
+ HOST_IP,
+ BACK_IP,
+ ETHER_IP,
+ FILE_NAME,
+ HOST_NAME,
+ PROC_NUM,
+ UNIT_NUM,
+ BOOT_DEV,
+ EXIT_BOOT_MODE
+};
+
+/***********Boot change**********/
+
+EOLS (exec_bootparam_exit_eol,changeBootParams,EXIT_BOOT_MODE);
+KEYWORD (exec_bootparam_exit,exec_bootparam_exit_eol,no_alt,
+ "exit","Exit from boot param mode",PRIV_ROOT);
+
+EOLS (exec_bootparam_other_eol,changeBootParams,OTHER);
+STRING (exec_bootparam_other_string,exec_bootparam_other_eol,no_alt,OBJ(string,1),"Other");
+KEYWORD (exec_bootparam_other,exec_bootparam_other_string,exec_bootparam_exit,
+ "other","Other string used by applications",PRIV_ROOT);
+
+EOLS (exec_bootparam_script_name_eol,changeBootParams,STARTUP_SCRIPT);
+STRING (exec_bootparam_script_name,exec_bootparam_script_name_eol,no_alt,OBJ(string,1),"Script name");
+KEYWORD (exec_bootparam_script,exec_bootparam_script_name,exec_bootparam_other,
+ "startup_script","Start up script name with directory path",PRIV_ROOT);
+
+EOLS (exec_bootparam_flags_eol,changeBootParams,FLAGS);
+NUMBER (exec_bootparam_flags_number,exec_bootparam_flags_eol,no_alt,OBJ(int,1),0,100,"Flags");
+KEYWORD (exec_bootparam_flags,exec_bootparam_flags_number,exec_bootparam_script,
+ "flags","Flags (f)",PRIV_ROOT);
+
+
+EOLS (exec_bootparam_target_eol,changeBootParams,TARGET_NAME);
+STRING (exec_bootparam_target_name,exec_bootparam_target_eol,no_alt,OBJ(string,1),"Name");
+KEYWORD (exec_bootparam_target,exec_bootparam_target_name,exec_bootparam_flags,
+ "target_name","Target name (tn)",PRIV_ROOT);
+
+
+EOLS (exec_bootparam_ftp_passwd_eol,changeBootParams,FTP_PASSWD);
+STRING (exec_bootparam_ftp_passwd,exec_bootparam_ftp_passwd_eol,no_alt,OBJ(string,1),"Password");
+KEYWORD (exec_bootparam_ftp,exec_bootparam_ftp_passwd,exec_bootparam_target,
+ "ftp_password","Ftp password (pw)",PRIV_ROOT);
+
+EOLS (exec_bootparam_user_eol,changeBootParams,USER_NAME);
+STRING (exec_bootparam_user_name,exec_bootparam_user_eol,no_alt,OBJ(string,1),"Name");
+KEYWORD (exec_bootparam_user,exec_bootparam_user_name,exec_bootparam_ftp,
+ "user","User name",PRIV_ROOT);
+
+EOLS (exec_bootparam_gateway_inet_eol,changeBootParams,GATEWAY_IP);
+STRING (exec_bootparam_gateway_inet_ip,exec_bootparam_gateway_inet_eol,no_alt,OBJ(string,1),"Gateway inet (g)");
+KEYWORD (exec_bootparam_gateway_inet,exec_bootparam_gateway_inet_ip,exec_bootparam_user,
+ "gateway_inet","Gateway inet (g)",PRIV_ROOT);
+
+EOLS (exec_bootparam_host_inet_eol,changeBootParams,HOST_IP);
+STRING (exec_bootparam_host_inet_ip,exec_bootparam_host_inet_eol,no_alt,OBJ(string,1),"Host inet (h)");
+KEYWORD (exec_bootparam_host_inet,exec_bootparam_host_inet_ip,exec_bootparam_gateway_inet,
+ "host_inet","Host inet (h)",PRIV_ROOT);
+
+EOLS (exec_bootparam_inet_backplane_eol,changeBootParams,BACK_IP);
+STRING (exec_bootparam_inet_backplane_ip,exec_bootparam_inet_backplane_eol,no_alt,OBJ(string,1),"Inet on backplane (b)");
+KEYWORD (exec_bootparam_inet_backplane,exec_bootparam_inet_backplane_ip,exec_bootparam_host_inet,
+ "inet_on_backplane","Inet on backplane (b)",PRIV_ROOT);
+
+EOLS (exec_bootparam_inet_ethernet_eol,changeBootParams,ETHER_IP);
+STRING (exec_bootparam_inet_ethernet_ip,exec_bootparam_inet_ethernet_eol,no_alt,OBJ(string,1),"Inet on ethernet (e)");
+KEYWORD (exec_bootparam_inet_ethernet,exec_bootparam_inet_ethernet_ip,exec_bootparam_inet_backplane,
+ "inet_on_ethernet","Inet on ethernet (e)",PRIV_ROOT);
+
+EOLS (exec_boot_change_file_eol,changeBootParams,FILE_NAME);
+STRING (exec_bootparam_file_name,exec_boot_change_file_eol,no_alt,OBJ(string,1),"File name");
+KEYWORD (exec_bootparam_file,exec_bootparam_file_name,exec_bootparam_inet_ethernet,
+ "file_name","File name",PRIV_ROOT);
+
+EOLS (exec_boot_change_host_eol,changeBootParams,HOST_NAME);
+STRING (exec_bootparam_host_name,exec_boot_change_host_eol,no_alt,OBJ(string,1),"Host name");
+KEYWORD (exec_bootparam_host,exec_bootparam_host_name,exec_bootparam_file,
+ "host_name","Host name",PRIV_ROOT);
+
+EOLS (exec_boot_change_processor_eol,changeBootParams,PROC_NUM);
+NUMBER (exec_bootparam_processor_number,exec_boot_change_processor_eol,no_alt,OBJ(int,1),0,9,"Precessor number");
+KEYWORD (exec_bootparam_processor,exec_bootparam_processor_number,exec_bootparam_host,
+ "processor_number","Precessor number",PRIV_ROOT);
+
+EOLS (exec_bootparam_unit_eol,changeBootParams,UNIT_NUM);
+NUMBER (exec_bootparam_unit_number,exec_bootparam_unit_eol,no_alt,OBJ(int,1),0,9,"Unit number");
+KEYWORD (exec_bootparam_unit,exec_bootparam_unit_number,exec_bootparam_processor,
+ "unit_number","Unit number",PRIV_ROOT);
+
+EOLS (exec_bootparam_boot_device_eol,changeBootParams,BOOT_DEV);
+STRING (exec_bootparam_boot_device_name,exec_bootparam_boot_device_eol,no_alt,OBJ(string,1),"Device number");
+KEYWORD (exec_boot_change_boot_device,exec_bootparam_boot_device_name,exec_bootparam_unit,
+ "boot_device","Boot device",PRIV_ROOT);
+
+
+/*************** Boot change *********/
+
+/**************** Enable access to vxworks shell***************/
+EOLNS (cfg_vxsh_enable_eol,EnableVxsh);
+NVGENNS (cfg_vxsh_enable_nvgen,cfg_vxsh_enable_eol,EnableVxsh);
+KEYWORD (cfg_vxsh_enable,cfg_vxsh_enable_nvgen,no_alt,
+ "enable","Enable vxworks shell",PRIV_ROOT);
+
+KEYWORD (cfg_vxsh, cfg_vxsh_enable, no_alt,
+ "vxsh", "Enable vxworks shell", PRIV_ROOT | PRIV_HIDDEN);
+/************ Change password for existing user **********/
+EOLNS (cfg_change_passwd_eol,ChangePasswd);
+STRING (cfg_change_passwd_uname,cfg_change_passwd_eol,no_alt,OBJ(string ,1),"User name");
+NVGENNS (cfg_change_passwd_nvgen,cfg_change_passwd_uname,ChangePasswd);
+KEYWORD (cfg_change_passwd, cfg_change_passwd_nvgen, cfg_vxsh,
+ "change-passwd", "Change password for existing user", PRIV_ROOT);
+/******** Change boot parameters*****************/
+
+EOLNS (cfg_boot_change_eol,setBootParamsMode);
+NVGENNS (cfg_boot_change_nvgen,cfg_boot_change_eol,setBootParamsMode);
+KEYWORD (cfg_boot_change,cfg_boot_change_nvgen,cfg_change_passwd,
+ "boot-params","Change the boot parameters ",PRIV_ROOT);
+/******* Enable SSH access ***********/
+EOLNS (cfg_ssh_enable_eol, EnableSsh);
+NVGENNS (cfg_ssh_enable_nvgen,cfg_ssh_enable_eol,EnableSsh);
+KEYWORD (cfg_ssh_enable,cfg_ssh_enable_nvgen,no_alt,
+ "enable","Enable ssh",PRIV_ROOT);
+KEYWORD (cfg_ssh, cfg_ssh_enable, cfg_boot_change,
+ "ssh", "Enable SSH access", PRIV_ROOT );
+
+/******* Enable SSH access ***********/
+EOLNS (cfg_telnet_enable_eol, EnableTelnet);
+NVGENNS (cfg_telnet_enable_nvgen,cfg_telnet_enable_eol,EnableTelnet);
+KEYWORD (cfg_telnet_enable,cfg_telnet_enable_nvgen,no_alt,
+ "enable","Enable telnet",PRIV_ROOT);
+KEYWORD (cfg_telnet, cfg_telnet_enable, cfg_ssh,
+ "telnet", "Enable telnet access", PRIV_ROOT );
+
+
+
+/************* Add new system user ****************/
+
+EOLNS (cfg_user_name_eol, AddNewUser);
+NUMBER (cfg_user_name_level,cfg_user_name_eol,no_alt,OBJ(int,1),0,1,"User level(0 for super user and 1 for normal user,First user must be super user)");
+STRING (cfg_user_name_usrname,cfg_user_name_level,no_alt,OBJ(string,1),"User name");
+NVGENNS (cfg_user_name_usrname_nvgen,cfg_user_name_usrname,AddNewUser);
+KEYWORD (cfg_user_name, cfg_user_name_usrname_nvgen, cfg_telnet,
+ "username", "Add new system user", PRIV_ROOT);
+
+#undef ALTERNATE
+#define ALTERNATE cfg_user_name
diff --git a/data/mnet/Common/cli/include/vxworks_exec_chain.h b/data/mnet/Common/cli/include/vxworks_exec_chain.h
new file mode 100644
index 0000000..d425afd
--- /dev/null
+++ b/data/mnet/Common/cli/include/vxworks_exec_chain.h
@@ -0,0 +1,229 @@
+/************** Definitions ********************/
+#include "../include/macros.h"
+
+
+#define LongList 1
+#define NormalList 2
+extern BOOL vxsh_flag;
+
+ /*************** Definitions *********/
+
+
+keyword_options cli_month_options[] = {
+ {"january", "JANUARY", 1},
+ {"february", "FEBRUARY", 2},
+ {"march", "MARCH", 3},
+ {"april", "APRIL", 4},
+ {"may", "MAY", 5},
+ {"june", "JUNE", 6},
+ {"july", "JULY", 7},
+ {"august", "AUGUST", 8},
+ {"september", "SEPTEMBER", 9},
+ {"october", "OCTOBER", 10},
+ {"november", "NOVEMBER", 11},
+ {"december", "DECEMBER", 12},
+ { NULL, NULL, 0 }
+};
+
+
+keyword_options vxshell_options[]={
+ {"ldvxsh", "Load Vxworks shell",1 },
+ {"unldvxsh","Load Vxworks shell",2},
+ {"vxsh" ,"Invoke vxworks shell",3},
+ {NULL,NULL,0}
+};
+
+/*********************************/
+
+EOLNS(vxsh_command_string_eol,execVxshCommand);
+TEXT(vxsh_command_string,vxsh_command_string_eol,no_alt,OBJ(string,1),"Enter vxworks commands");
+/******************************* vxsh ************/
+EOLNS (exec_vxsh_eol, vxshCommand);
+STRING (exec_vxsh_string, exec_vxsh_eol, no_alt,OBJ(string,1), "file/env variable name");
+KEYWORD_ID (exec_vxsh_env, exec_vxsh_string, exec_vxsh_eol, OBJ(int,2), 2, "env","Environment variable",PRIV_ROOT);
+KEYWORD_ID (exec_vxsh_file, exec_vxsh_string, exec_vxsh_env,OBJ(int,2), 1, "file","File with directory path ", PRIV_ROOT);
+
+KEYWORD_OPTIONS (exec_vxsh, exec_vxsh_file,no_alt, vxshell_options,OBJ(int,1),PRIV_ROOT | PRIV_HIDDEN,0);
+
+ASSERT (exec_vxsh_option,exec_vxsh,no_alt,vxsh_flag);
+
+/******************/
+
+/************************ Load running configurations ****************************/
+EOLNS (exec_load_running_config_eol,loadRunning);
+KEYWORD (exec_load_running_config,exec_load_running_config_eol,exec_vxsh_option,
+ "load-runnning","Load running configurations", PRIV_ROOT);
+
+/************************ Save running configurations ****************************/
+EOLNS (exec_save_running_config_eol,saveRunning);
+KEYWORD (exec_save_running_config,exec_save_running_config_eol,exec_load_running_config,
+ "save-runnning","Save running configurations", PRIV_ROOT);
+
+/****************/
+/*****************/
+EOLNS (exec_print_file_eol,printFile);
+STRING (exec_print_file_name,exec_print_file_eol,no_alt,
+ OBJ(string,1),"Name of the file to be created");
+KEYWORD (exec_print_file,exec_print_file_name,exec_vxsh_option,
+ "print-file","Print the contents a file",PRIV_ROOT | PRIV_HIDDEN);
+
+/*********************/
+EOLNS (exec_create_eol,createFile);
+STRING (exec_create_file_name,exec_create_eol,no_alt,
+ OBJ(string,1),"Name of the file to be created");
+KEYWORD (exec_create_file,exec_create_file_name,exec_print_file,
+ "create-file","Create a file",PRIV_ROOT | PRIV_HIDDEN);
+
+/*************Set system clock ***********/
+EOLNS (cfg_clock_hour_min_secs_day_month_year_eol, ClockSet);
+NUMBER (cfg_clock_hour_min_secs_day_month_year,cfg_clock_hour_min_secs_day_month_year_eol,
+ no_alt,OBJ(int,6),2000,2050,"Year");
+KEYWORD_OPTIONS (cfg_clock_hour_min_secs_day_month, cfg_clock_hour_min_secs_day_month_year,
+ no_alt, cli_month_options, OBJ(int, 5),
+ PRIV_ROOT, 0);
+NUMBER (cfg_clock_hour_min_secs_day,cfg_clock_hour_min_secs_day_month,
+ cfg_clock_hour_min_secs_day_month_year_eol,OBJ(int,4),1,31,"Day of the month");
+NUMBER (cfg_clock_hour_min_secs,cfg_clock_hour_min_secs_day,no_alt,OBJ(int,3),0,59,"Seconds");
+
+NUMBER (cfg_clock_hour_min,cfg_clock_hour_min_secs,no_alt,OBJ(int,2),0,59,"Minutes");
+NUMBER (cfg_clock_hour,cfg_clock_hour_min,no_alt,OBJ(int,1),0,23,"Hour");
+KEYWORD (cfg_clock, cfg_clock_hour, exec_create_file,
+ "set-clock", "Configure clock", PRIV_ROOT);
+
+
+/*************Log out of shell ************/
+EOLNS (exec_logout_eol, Logout);
+KEYWORD (exec_logout, exec_logout_eol, cfg_clock,
+ "logout", "Log out of shell ", PRIV_ROOT | PRIV_HIDDEN);
+
+
+/************** Set an environment variable ***************/
+EOLNS (exec_setenv_eol, SetEnv);
+pdecl(exec_setenv_args_var_id);
+
+FUNC(exec_setenv_AcceptArg,exec_setenv_args_var_id, AcceptArg);
+
+STRING (exec_setenv_args_string,exec_setenv_AcceptArg,no_alt,OBJ(string,2),"String parameter(may be quoted)");
+KEYWORD_ID (exec_setenv_args_string_id, exec_setenv_args_string, exec_setenv_eol , OBJ(int,2), 3,
+ "string", "String parameter", PRIV_ROOT);
+
+STRING (exec_setenv_args_var,exec_setenv_AcceptArg,no_alt,OBJ(string,2),"variable name");
+KEYWORD_ID (exec_setenv_args_var_id, exec_setenv_args_var, exec_setenv_args_string_id, OBJ(int, 2),2,
+ "var", "Var parameter", PRIV_ROOT);
+
+STRING (exec_setenv_varname,exec_setenv_args_var_id,no_alt,OBJ(string,1),"Variable name");
+KEYWORD (exec_setenv, exec_setenv_varname, exec_logout,
+ "setenv", "Set an environment variable", PRIV_ROOT | PRIV_HIDDEN);
+
+/***********Invoke a function***********/
+
+EOLNS (exec_invoke_eol, Invoke);
+pdecl(exec_invoke_args_number_id);
+
+
+FUNC(exec_invoke_AcceptArg,exec_invoke_args_number_id, AcceptArg);
+
+
+STRING (exec_invoke_args_string,exec_invoke_AcceptArg,no_alt,OBJ(string,2),"String parameter(may be quoted)");
+KEYWORD_ID (exec_invoke_args_string_id, exec_invoke_args_string, exec_invoke_eol , OBJ(int,2), 3,
+ "string", "String parameter", PRIV_ROOT);
+
+STRING (exec_invoke_args_var,exec_invoke_AcceptArg,no_alt,OBJ(string,2),"Variable name");
+KEYWORD_ID (exec_invoke_args_var_id, exec_invoke_args_var, exec_invoke_args_string_id, OBJ(int, 2),2,
+ "var", "Variable parameter", PRIV_ROOT);
+
+NUMBER (exec_invoke_args_number,exec_invoke_AcceptArg,no_alt,OBJ(int,1),0,65256,"Int param value");
+KEYWORD_ID (exec_invoke_args_number_id, exec_invoke_args_number, exec_invoke_args_var_id, OBJ(int, 2),1,
+ "int", "Int parameter", PRIV_ROOT);
+
+STRING (exec_invoke_name,exec_invoke_args_number_id,no_alt,OBJ(string,1),"Function name");
+KEYWORD (exec_invoke, exec_invoke_name, exec_setenv,
+ "invoke", "Invoke a function ", PRIV_ROOT | PRIV_HIDDEN);
+
+/************** load an object module into memory ********************/
+EOLNS (exec_loadmodule_name_eol, LoadModule);
+STRING (exec_loadmodule_name,exec_loadmodule_name_eol,no_alt,OBJ(string,1),"Module name with correct directory path");
+KEYWORD (exec_loadmodule, exec_loadmodule_name, exec_invoke,
+ "load", "Load an object module into memory", PRIV_ROOT | PRIV_HIDDEN);
+
+
+/**************** Rename a file *************/
+EOLNS (exec_rename_command_eol, Rename);
+STRING (exec_rename_command_newfilename,exec_rename_command_eol,no_alt,OBJ(string,2),"New file name");
+STRING (exec_rename_command_filename,exec_rename_command_newfilename,no_alt,OBJ(string,1)," File name");
+KEYWORD (exec_rename_command, exec_rename_command_filename, exec_loadmodule,
+ "rename","Rename a file", PRIV_ROOT);
+
+/**************** copy a file *************/
+EOLNS (exec_copy_command_eol, Copy);
+STRING (exec_copy_command_destname,exec_copy_command_eol,no_alt,OBJ(string,2),"Destination file name");
+STRING (exec_copy_command_srcname,exec_copy_command_destname,no_alt,OBJ(string,1),"Source file name");
+KEYWORD (exec_copy_command, exec_copy_command_srcname, exec_rename_command,
+ "copy", "Copy a file", PRIV_ROOT);
+
+/**************** Delete a file *************/
+EOLNS (exec_delete_command_filename_eol, DeleteFile);
+STRING (exec_delete_command_filename,exec_delete_command_filename_eol,no_alt,OBJ(string,1),"Filename");
+KEYWORD (exec_delete_command, exec_delete_command_filename, exec_copy_command,
+ "delete", "Delete a file", PRIV_ROOT);
+
+/**************** Delete a directory *************/
+EOLNS (exec_rmdir_command_eol, RmDir);
+STRING (exec_rmdir_command_dirname,exec_rmdir_command_eol,no_alt,OBJ(string,1),"Directory name");
+KEYWORD (exec_rmdir_command, exec_rmdir_command_dirname, exec_delete_command,
+ "rmdir", "Delete a directory", PRIV_ROOT);
+
+/**************** Make a directory *************/
+EOLNS (exec_mkdir_command_eol, Mkdir);
+STRING (exec_mkdir_command_dirname,exec_mkdir_command_eol,no_alt,OBJ(string,1),"Directory name");
+KEYWORD (exec_mkdir_command, exec_mkdir_command_dirname, exec_rmdir_command,
+ "mkdir", "Make a directory", PRIV_ROOT);
+
+/**************** Reset network devices and transfer control to boot ROMs*************/
+EOLNS (exec_reload_command_eol, Reload);
+
+KEYWORD (exec_reload_command, exec_reload_command_eol, exec_mkdir_command,
+ "reload", "Reset network devices and transfer control to boot ROMs", PRIV_ROOT);
+
+
+/**************** Change directory *************/
+EOLNS (exec_cd_command_eol, ChangeDir);
+STRING (exec_cd_command_dirname,exec_cd_command_eol,no_alt,OBJ(string,1),"Directory name");
+KEYWORD (exec_cd_command, exec_cd_command_dirname, exec_reload_command,
+ "cd", "Change directory", PRIV_ROOT);
+
+
+/**************** List the contents of a directory ************/
+EOLS (exec_dir_command_eol, Dir,NormalList);
+
+EOLS (exec_dir_command_long_eol, Dir,LongList);
+
+KEYWORD (exec_long_list,exec_dir_command_long_eol,exec_dir_command_eol,"detail","Detailed listing of directory contents",PRIV_ROOT);
+STRING (exec_dirname,exec_long_list,exec_dir_command_eol,OBJ(string,1),"Directory name");
+KEYWORD (exec_dir_command, exec_dirname, exec_cd_command,
+ "dir", "List the contents of a directory", PRIV_ROOT);
+
+
+
+
+/*************Print the current default directory****************/
+EOLNS (exec_pwd_command_eol, Pwd);
+KEYWORD (exec_pwd_command, exec_pwd_command_eol, exec_dir_command,
+ "pwd", "Print the current working directory path", PRIV_ROOT);
+
+
+/*********** Test that a remote host is reachable ***********/
+EOLNS (exec_ping_command_eol, Ping);
+STRING(exec_ping_command_ipaddress,exec_ping_command_eol,no_alt,OBJ(string,1),"Ip address of host");
+KEYWORD (exec_test_command, exec_ping_command_ipaddress, exec_pwd_command,
+ "ping", "Test that a remote host is reachable", PRIV_ROOT);
+
+
+#undef ALTERNATE
+#define ALTERNATE exec_test_command
+
+
+
+
+
+
diff --git a/data/mnet/Common/cli/include/vxworks_show_chain.h b/data/mnet/Common/cli/include/vxworks_show_chain.h
new file mode 100644
index 0000000..8950ad7
--- /dev/null
+++ b/data/mnet/Common/cli/include/vxworks_show_chain.h
@@ -0,0 +1,145 @@
+
+
+/*************** definitions ******************/
+#define TASK_ALL 1
+#define TASK_GEN 2
+#define TASK_DETAIL 3
+#define TASK_SUMMARY 4
+#define NAME 5
+#define ALL 6
+#define SUMMARY 7
+#define DETAIL 8
+
+
+
+/******Shows the symbolic name of machine **********/
+EOLNS (show_host_eol,ShowHost);
+KEYWORD (show_host, show_host_eol, no_alt,"hostname", "Shows the symbolic name of machine", PRIV_MIN);
+
+
+/************** Shows environment variable *****************/
+
+EOLNS (show_env_name_eol,ShowEnv);
+STRING (show_env_name,show_env_name_eol,no_alt,OBJ(string,1),"Variable name");
+KEYWORD (show_env, show_env_name, show_host,"env", "Shows environment variable ", PRIV_MIN | PRIV_HIDDEN);
+
+/*****************look up a symbol by name******************/
+
+EOLS (show_symbol_name_eol,Show_Symbol,NAME);
+STRING (show_symbol_name,show_symbol_name_eol,no_alt,
+ OBJ(string,1),"Symbol name");
+KEYWORD (show_symbol, show_symbol_name,show_env,
+ "symbol", "Look up a symbol by name", PRIV_MIN | PRIV_HIDDEN);
+
+
+
+/***************** Shows the current status for loaded modules ******************/
+EOLS (show_module_name_all,Show_Module,ALL);
+
+EOLS (show_module_name_eol,Show_Module,NAME);
+STRING (show_module_name,show_module_name_eol,show_module_name_all,
+ OBJ(string,1),"Module name with correct directory path");
+KEYWORD (show_module, show_module_name,show_symbol,
+ "module", "Shows the current status for loaded modules ", PRIV_MIN);
+
+
+/************* Shows task information from Task control block *********/
+EOLS (show_task_all_eol,Show_Task,TASK_ALL);
+
+EOLS(show_tasks_general,Show_Task,TASK_GEN);
+
+EOLS (show_tasks_detail_eol,Show_Task,TASK_DETAIL);
+KEYWORD (show_tasks_detail,show_tasks_detail_eol,show_tasks_general,
+ "detail","Displays the task details",PRIV_MIN);
+
+EOLS (show_tasks_summary_eol, Show_Task,TASK_SUMMARY);
+KEYWORD (show_tasks_option,show_tasks_summary_eol,show_tasks_detail,
+ "summary","Displays task summary",PRIV_ROOT);
+
+HEXNUM (show_tasks_tid,show_tasks_option,show_task_all_eol,OBJ(int,1),"Task ID");
+KEYWORD (show_tasks, show_tasks_tid,show_module,
+ "task", "Shows task information from Task control block ", PRIV_MIN);
+
+
+/************* Shows a stack trace of a task *********/
+EOLNS (show_stack_trace_eol, Show_Stack_Trace);
+HEXNUM (show_stack_trace_tid,show_stack_trace_eol,no_alt,OBJ(int,1),"Task ID");
+KEYWORD (show_stack_trace, show_stack_trace_tid,show_tasks,
+ "stack", " Shows a stack trace of a task ", PRIV_MIN);
+
+
+/************* Shows list of system drivers *********/
+EOLNS (show_drivers_eol, Show_Drivers);
+KEYWORD (show_drivers, show_drivers_eol,show_stack_trace,
+ "drivers", " Shows list of system drivers", PRIV_MIN);
+
+/********Shows the list of devices in the system ****************/
+
+EOLNS (show_devices_eol, Show_Devices);
+KEYWORD (show_devices, show_devices_eol,show_drivers,
+ "devices", "Displays devices", PRIV_MIN);
+
+/************** Shows list of file descriptor names in the system**************/
+EOLNS (show_fd_eol, Show_Fd);
+KEYWORD (show_fd, show_fd_eol, show_devices,
+ "fd", "Shows list of file descriptor names in the system", PRIV_MIN);
+
+
+
+/************** Show ip **************/
+EOLNS (show_ip_route_eol,Show_ip_Route);
+KEYWORD (show_ip_route, show_ip_route_eol,no_alt,
+ "route", "Displays ip route", PRIV_MIN);
+
+EOLNS (show_ip_traffic_eol,Show_ip_Traffic);
+KEYWORD (show_ip_traffic, show_ip_traffic_eol, show_ip_route,
+ "traffic", "Displays ip traffic", PRIV_MIN);
+
+
+KEYWORD (show_ip, show_ip_traffic, show_fd,
+ "ip", "Shows ip route / traffic", PRIV_MIN);
+
+
+/************** Shows the attached network interfaces **************/
+EOLNS (show_interfaces_eol, Show_Interfaces);
+KEYWORD (show_interfaces, show_interfaces_eol, show_ip,
+ "interfaces", "Shows list of gp10 interfaces", PRIV_MIN);
+
+
+/************** Show users **************/
+EOLNS (show_users_eol, Show_Users);
+KEYWORD (show_users, show_users_eol, show_interfaces,
+ "users", "Shows list of system users", PRIV_MIN | PRIV_HIDDEN);
+
+
+/************** Show arp **************/
+EOLNS (show_arp_eol, Show_Arp);
+
+KEYWORD (show_arp, show_arp_eol, show_users,
+ "arp", "Shows entries in the system ARP table", PRIV_MIN);
+
+
+/******************* Show Clock ***************/
+EOLNS (show_clock_eol, Show_Clock);
+
+KEYWORD (show_clock, show_clock_eol, show_arp,
+ "clock", "Shows system clock", PRIV_MIN);
+
+
+
+/******************* Show memory ***************/
+EOLS (show_memory_detail_eols, Show_Memory,DETAIL);
+EOLS (show_memory_summary_eols,Show_Memory,SUMMARY);
+KEYWORD (show_memory_detail ,show_memory_detail_eols,no_alt,
+ "detail", "Shows system memory in detail", PRIV_MIN);
+KEYWORD (show_memory_summary,show_memory_summary_eols,show_memory_detail,
+ "summary", "Shows summary of system memory", PRIV_MIN);
+KEYWORD (show_memory, show_memory_summary, show_clock,
+ "memory", "Shows system memory partition blocks and statistics", PRIV_MIN);
+
+
+
+
+
+#undef ALTERNATE
+#define ALTERNATE show_memory