Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sys / dev / raid / vinum / vinumkw.h
1 /*-
2  * Copyright (c) 1997, 1998
3  *      Nan Yang Computer Services Limited.  All rights reserved.
4  *
5  *  This software is distributed under the so-called ``Berkeley
6  *  License'':
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. All advertising materials mentioning features or use of this software
17  *    must display the following acknowledgement:
18  *      This product includes software developed by Nan Yang Computer
19  *      Services Limited.
20  * 4. Neither the name of the Company nor the names of its contributors
21  *    may be used to endorse or promote products derived from this software
22  *    without specific prior written permission.
23  *
24  * This software is provided ``as is'', and any express or implied
25  * warranties, including, but not limited to, the implied warranties of
26  * merchantability and fitness for a particular purpose are disclaimed.
27  * In no event shall the company or contributors be liable for any
28  * direct, indirect, incidental, special, exemplary, or consequential
29  * damages (including, but not limited to, procurement of substitute
30  * goods or services; loss of use, data, or profits; or business
31  * interruption) however caused and on any theory of liability, whether
32  * in contract, strict liability, or tort (including negligence or
33  * otherwise) arising in any way out of the use of this software, even if
34  * advised of the possibility of such damage.
35  *
36  * $Id: vinumkw.h,v 1.16 2000/02/19 06:52:46 grog Exp grog $
37  * $FreeBSD: src/sys/dev/vinum/vinumkw.h,v 1.18.2.2 2001/05/28 05:56:27 grog Exp $
38  */
39
40 /*
41  * Command keywords that vinum knows.  These include both user-level
42  * and kernel-level stuff
43  */
44
45 /*
46  * Our complete vocabulary.  The names of the commands are
47  * the same as the identifier without the kw_ at the beginning
48  * (i.e. kw_create defines the "create" keyword).  Preprocessor
49  * magic in parser.c does the rest.
50  *
51  * To add a new word: put it in the table below and one of the
52  * lists in vinumparser.c (probably keywords).
53  */
54 enum keyword {
55     kw_create,
56     kw_modify,
57     kw_list,
58     kw_l = kw_list,
59     kw_ld,                                                  /* list drive */
60     kw_ls,                                                  /* list subdisk */
61     kw_lp,                                                  /* list plex */
62     kw_lv,                                                  /* list volume */
63     kw_set,
64     kw_rm,
65     kw_mv,                                                  /* move object */
66     kw_move,                                                /* synonym for mv */
67     kw_start,
68     kw_stop,
69     kw_makedev,                                             /* make /dev/vinum devices */
70     kw_setdaemon,                                           /* set daemon flags */
71     kw_getdaemon,                                           /* set daemon flags */
72     kw_help,
73     kw_drive,
74     kw_partition,
75     kw_sd,
76     kw_subdisk = kw_sd,
77     kw_plex,
78     kw_volume,
79     kw_vol = kw_volume,
80     kw_read,
81     kw_readpol,
82     kw_org,
83     kw_name,
84     kw_concat,
85     kw_striped,
86     kw_raid4,
87     kw_raid5,
88     kw_driveoffset,
89     kw_plexoffset,
90     kw_len,
91     kw_length = kw_len,
92     kw_size = kw_len,
93     kw_state,
94     kw_setupstate,
95     kw_d,                                                   /* flag names */
96     kw_f,
97     kw_r,
98     kw_s,
99     kw_v,
100     kw_w,
101     kw_round,                                               /* round robin */
102     kw_prefer,                                              /* prefer plex */
103     kw_device,
104     kw_init,
105     kw_label,
106     kw_resetconfig,
107     kw_writethrough,
108     kw_writeback,
109     kw_raw,
110     kw_replace,
111     kw_resetstats,
112     kw_attach,
113     kw_detach,
114     kw_rename,
115     kw_printconfig,
116     kw_saveconfig,
117     kw_hotspare,
118     kw_detached,
119 #ifdef VINUMDEBUG
120     kw_debug,                                               /* go into debugger */
121 #endif
122     kw_stripe,
123     kw_mirror,
124     kw_info,
125     kw_quit,
126     kw_max,
127     kw_setstate,
128     kw_checkparity,
129     kw_rebuildparity,
130     kw_dumpconfig,
131     kw_retryerrors,
132     kw_invalid_keyword = -1
133 };
134
135 struct _keywords {
136     char *name;
137     enum keyword keyword;
138 };
139
140 struct keywordset {
141     int size;
142     struct _keywords *k;
143 };
144
145 extern struct _keywords keywords[];
146 extern struct _keywords flag_keywords[];
147
148 extern struct keywordset keyword_set;
149 extern struct keywordset flag_set;