847ebdc5456804a9c29547a95ac47d8e9599dbca
[bcm963xx.git] / userapps / broadcom / cfm / inc / clidefs.h
1 /*****************************************************************************
2 //
3 //  Copyright (c) 2000-2001  Broadcom Corporation
4 //  All Rights Reserved
5 //  No portions of this material may be reproduced in any form without the
6 //  written permission of:
7 //          Broadcom Corporation
8 //          16215 Alton Parkway
9 //          Irvine, California 92619
10 //  All information contained in this document is Broadcom Corporation
11 //  company private, proprietary, and trade secret.
12 //
13 ******************************************************************************
14 //
15 //  Filename:       clidefs.h
16 //  Author:         Peter T. Tran
17 //  Creation Date:  12/26/01
18 //
19 ******************************************************************************
20 //  Description:
21 //      Define the global types, enums. and constants for CLI.
22 //
23 *****************************************************************************/
24
25 #ifndef __CLIDEFS_H__
26 #define __CLIDEFS_H__
27
28 #include "bcmtypes.h"
29
30 /********************** Global Constants ************************************/
31
32 #define CLI_MAX_BUF_SZ       512
33 #define CLI_BACKSPACE        '\x08'
34
35 /********************** Global Enums ****************************************/
36
37 typedef enum {
38    CLI_FALSE = 0,
39    CLI_TRUE
40 } CLI_BOOL;
41
42 typedef enum {
43    CLI_ACCESS_DISABLED = 0,
44    CLI_ACCESS_LOCAL,
45    CLI_ACCESS_REMOTE,
46    CLI_ACCESS_CONSOLE,
47    CLI_ACCESS_REMOTE_SSH,     // for SSHD
48 } CLI_ACCESS_WHERE;
49
50
51 typedef enum {
52    CLI_STS_OK = 0,
53    CLI_STS_ERR_GENERAL,
54    CLI_STS_ERR_MEMORY,
55    CLI_STS_ERR_FIND,
56    CLI_STS_ERR_MENU_EXIST,
57    CLI_STS_ERR_CMD_EXIST
58 } CLI_STATUS;
59
60 #ifdef BUILD_MENU_DRIVEN_CLI
61 typedef enum {
62    CLI_PROCESS_PROMPT = 0,
63    CLI_PROCESS_HELP,
64    CLI_PROCESS_LINE
65 } CLI_PROCESS;
66
67 /********************** Global Types ****************************************/
68
69 typedef CLI_BOOL (*CLI_VALIDATE_FNC) (char* inputParam);
70
71 typedef struct {
72    char* prompt;
73    char  param[CLI_MAX_BUF_SZ];
74    CLI_VALIDATE_FNC validateFnc;
75 } PARAMS_SETTING, *PPARAMS_SETTING;
76
77 typedef CLI_STATUS (*CLI_FNC) (char* cmdName, int help, void* object);
78
79 typedef struct {
80    char* itemName;
81    char* itemMenu;
82    char* cmdName;
83    char* cmdHelp;
84    void* cmdObject;
85    CLI_FNC cliFnc;
86 } CLI_MENU_ITEM, *PCLI_MENU_ITEM;
87
88 typedef struct {
89    char*          menuName;
90    int            itemNumMax;
91    PCLI_MENU_ITEM items;
92 } CLI_MENU, *PCLI_MENU;
93 #endif /* BUILD_MENU_DRIVEN_CLI */
94
95 #endif