http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / inc / clidefs.h
1 /*****************************************************************************
2 # <:copyright-gpl
3 # Copyright 2004 Broadcom Corp. All Rights Reserved.
4 # This program is free software; you can distribute it and/or modify it
5 # under the terms of the GNU General Public License (Version 2) as
6 # published by the Free Software Foundation.
7 # This program is distributed in the hope it will be useful, but WITHOUT
8 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10 # for more details.
11 # You should have received a copy of the GNU General Public License along
12 # with this program; if not, write to the Free Software Foundation, Inc.,
13 # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
14 # :>
15 ******************************************************************************
16 //
17 //  Filename:       clidefs.h
18 //  Author:         Peter T. Tran
19 //  Creation Date:  12/26/01
20 //
21 ******************************************************************************
22 //  Description:
23 //      Define the global types, enums. and constants for CLI.
24 //
25 *****************************************************************************/
26
27 #ifndef __CLIDEFS_H__
28 #define __CLIDEFS_H__
29
30 #include "bcmtypes.h"
31
32 /********************** Global Constants ************************************/
33
34 #define CLI_MAX_BUF_SZ       128
35 #define CLI_BACKSPACE        '\x08'
36
37 /********************** Global Enums ****************************************/
38
39 typedef enum {
40    CLI_FALSE = 0,
41    CLI_TRUE
42 } CLI_BOOL;
43
44 typedef enum {
45    CLI_ACCESS_DISABLED = 0,
46    CLI_ACCESS_LOCAL,
47    CLI_ACCESS_REMOTE,
48    CLI_ACCESS_CONSOLE,
49    CLI_ACCESS_REMOTE_SSH,     // for SSHD
50 } CLI_ACCESS_WHERE;
51
52
53 typedef enum {
54    CLI_STS_OK = 0,
55    CLI_STS_ERR_GENERAL,
56    CLI_STS_ERR_MEMORY,
57    CLI_STS_ERR_FIND,
58    CLI_STS_ERR_MENU_EXIST,
59    CLI_STS_ERR_CMD_EXIST
60 } CLI_STATUS;
61
62 #ifdef BUILD_MENU_DRIVEN_CLI
63 typedef enum {
64    CLI_PROCESS_PROMPT = 0,
65    CLI_PROCESS_HELP,
66    CLI_PROCESS_LINE
67 } CLI_PROCESS;
68
69 /********************** Global Types ****************************************/
70
71 typedef CLI_BOOL (*CLI_VALIDATE_FNC) (char* inputParam);
72
73 typedef struct {
74    char* prompt;
75    char  param[CLI_MAX_BUF_SZ];
76    CLI_VALIDATE_FNC validateFnc;
77 } PARAMS_SETTING, *PPARAMS_SETTING;
78
79 typedef CLI_STATUS (*CLI_FNC) (char* cmdName, int help, void* object);
80
81 typedef struct {
82    char* itemName;
83    char* itemMenu;
84    char* cmdName;
85    char* cmdHelp;
86    void* cmdObject;
87    CLI_FNC cliFnc;
88 } CLI_MENU_ITEM, *PCLI_MENU_ITEM;
89
90 typedef struct {
91    char*          menuName;
92    int            itemNumMax;
93    PCLI_MENU_ITEM items;
94 } CLI_MENU, *PCLI_MENU;
95 #endif /* BUILD_MENU_DRIVEN_CLI */
96
97 #endif