xref: /dflybsd-src/sys/dev/raid/vinum/vinumkw.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /*-
286d7f5d3SJohn Marino  * Copyright (c) 1997, 1998
386d7f5d3SJohn Marino  *	Nan Yang Computer Services Limited.  All rights reserved.
486d7f5d3SJohn Marino  *
586d7f5d3SJohn Marino  *  This software is distributed under the so-called ``Berkeley
686d7f5d3SJohn Marino  *  License'':
786d7f5d3SJohn Marino  *
886d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
986d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
1086d7f5d3SJohn Marino  * are met:
1186d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the above copyright
1286d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
1386d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
1486d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
1586d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
1686d7f5d3SJohn Marino  * 3. All advertising materials mentioning features or use of this software
1786d7f5d3SJohn Marino  *    must display the following acknowledgement:
1886d7f5d3SJohn Marino  *	This product includes software developed by Nan Yang Computer
1986d7f5d3SJohn Marino  *      Services Limited.
2086d7f5d3SJohn Marino  * 4. Neither the name of the Company nor the names of its contributors
2186d7f5d3SJohn Marino  *    may be used to endorse or promote products derived from this software
2286d7f5d3SJohn Marino  *    without specific prior written permission.
2386d7f5d3SJohn Marino  *
2486d7f5d3SJohn Marino  * This software is provided ``as is'', and any express or implied
2586d7f5d3SJohn Marino  * warranties, including, but not limited to, the implied warranties of
2686d7f5d3SJohn Marino  * merchantability and fitness for a particular purpose are disclaimed.
2786d7f5d3SJohn Marino  * In no event shall the company or contributors be liable for any
2886d7f5d3SJohn Marino  * direct, indirect, incidental, special, exemplary, or consequential
2986d7f5d3SJohn Marino  * damages (including, but not limited to, procurement of substitute
3086d7f5d3SJohn Marino  * goods or services; loss of use, data, or profits; or business
3186d7f5d3SJohn Marino  * interruption) however caused and on any theory of liability, whether
3286d7f5d3SJohn Marino  * in contract, strict liability, or tort (including negligence or
3386d7f5d3SJohn Marino  * otherwise) arising in any way out of the use of this software, even if
3486d7f5d3SJohn Marino  * advised of the possibility of such damage.
3586d7f5d3SJohn Marino  */
3686d7f5d3SJohn Marino 
3786d7f5d3SJohn Marino /*
3886d7f5d3SJohn Marino  * Command keywords that vinum knows.  These include both user-level
3986d7f5d3SJohn Marino  * and kernel-level stuff
4086d7f5d3SJohn Marino  */
4186d7f5d3SJohn Marino 
4286d7f5d3SJohn Marino /*
4386d7f5d3SJohn Marino  * Our complete vocabulary.  The names of the commands are
4486d7f5d3SJohn Marino  * the same as the identifier without the kw_ at the beginning
4586d7f5d3SJohn Marino  * (i.e. kw_create defines the "create" keyword).  Preprocessor
4686d7f5d3SJohn Marino  * magic in parser.c does the rest.
4786d7f5d3SJohn Marino  *
4886d7f5d3SJohn Marino  * To add a new word: put it in the table below and one of the
4986d7f5d3SJohn Marino  * lists in vinumparser.c (probably keywords).
5086d7f5d3SJohn Marino  */
5186d7f5d3SJohn Marino enum keyword {
5286d7f5d3SJohn Marino 	kw_create,
5386d7f5d3SJohn Marino 	kw_modify,
5486d7f5d3SJohn Marino 	kw_list,
5586d7f5d3SJohn Marino 	kw_l = kw_list,
5686d7f5d3SJohn Marino 	kw_ld,			/* list drive */
5786d7f5d3SJohn Marino 	kw_ls,			/* list subdisk */
5886d7f5d3SJohn Marino 	kw_lp,			/* list plex */
5986d7f5d3SJohn Marino 	kw_lv,			/* list volume */
6086d7f5d3SJohn Marino 	kw_set,
6186d7f5d3SJohn Marino 	kw_rm,
6286d7f5d3SJohn Marino 	kw_mv,			/* move object */
6386d7f5d3SJohn Marino 	kw_move,		/* synonym for mv */
6486d7f5d3SJohn Marino 	kw_start,
6586d7f5d3SJohn Marino 	kw_stop,
6686d7f5d3SJohn Marino 	kw_makedev,		/* make /dev/vinum devices */
6786d7f5d3SJohn Marino 	kw_setdaemon,		/* set daemon flags */
6886d7f5d3SJohn Marino 	kw_getdaemon,		/* set daemon flags */
6986d7f5d3SJohn Marino 	kw_help,
7086d7f5d3SJohn Marino 	kw_drive,
7186d7f5d3SJohn Marino 	kw_partition,
7286d7f5d3SJohn Marino 	kw_sd,
7386d7f5d3SJohn Marino 	kw_subdisk = kw_sd,
7486d7f5d3SJohn Marino 	kw_plex,
7586d7f5d3SJohn Marino 	kw_volume,
7686d7f5d3SJohn Marino 	kw_vol = kw_volume,
7786d7f5d3SJohn Marino 	kw_read,
7886d7f5d3SJohn Marino 	kw_readpol,
7986d7f5d3SJohn Marino 	kw_org,
8086d7f5d3SJohn Marino 	kw_name,
8186d7f5d3SJohn Marino 	kw_concat,
8286d7f5d3SJohn Marino 	kw_striped,
8386d7f5d3SJohn Marino 	kw_raid4,
8486d7f5d3SJohn Marino 	kw_raid5,
8586d7f5d3SJohn Marino 	kw_driveoffset,
8686d7f5d3SJohn Marino 	kw_plexoffset,
8786d7f5d3SJohn Marino 	kw_len,
8886d7f5d3SJohn Marino 	kw_length = kw_len,
8986d7f5d3SJohn Marino 	kw_size = kw_len,
9086d7f5d3SJohn Marino 	kw_state,
9186d7f5d3SJohn Marino 	kw_setupstate,
9286d7f5d3SJohn Marino 	kw_d,			/* flag names */
9386d7f5d3SJohn Marino 	kw_f,
9486d7f5d3SJohn Marino 	kw_r,
9586d7f5d3SJohn Marino 	kw_s,
9686d7f5d3SJohn Marino 	kw_v,
9786d7f5d3SJohn Marino 	kw_w,
9886d7f5d3SJohn Marino 	kw_round,		/* round robin */
9986d7f5d3SJohn Marino 	kw_prefer,		/* prefer plex */
10086d7f5d3SJohn Marino 	kw_device,
10186d7f5d3SJohn Marino 	kw_init,
10286d7f5d3SJohn Marino 	kw_label,
10386d7f5d3SJohn Marino 	kw_resetconfig,
10486d7f5d3SJohn Marino 	kw_writethrough,
10586d7f5d3SJohn Marino 	kw_writeback,
10686d7f5d3SJohn Marino 	kw_raw,
10786d7f5d3SJohn Marino 	kw_replace,
10886d7f5d3SJohn Marino 	kw_resetstats,
10986d7f5d3SJohn Marino 	kw_attach,
11086d7f5d3SJohn Marino 	kw_detach,
11186d7f5d3SJohn Marino 	kw_rename,
11286d7f5d3SJohn Marino 	kw_printconfig,
11386d7f5d3SJohn Marino 	kw_saveconfig,
11486d7f5d3SJohn Marino 	kw_hotspare,
11586d7f5d3SJohn Marino 	kw_detached,
11686d7f5d3SJohn Marino #ifdef VINUMDEBUG
11786d7f5d3SJohn Marino 	kw_debug,		/* go into debugger */
11886d7f5d3SJohn Marino #endif
11986d7f5d3SJohn Marino 	kw_stripe,
12086d7f5d3SJohn Marino 	kw_mirror,
12186d7f5d3SJohn Marino 	kw_info,
12286d7f5d3SJohn Marino 	kw_quit,
12386d7f5d3SJohn Marino 	kw_max,
12486d7f5d3SJohn Marino 	kw_setstate,
12586d7f5d3SJohn Marino 	kw_checkparity,
12686d7f5d3SJohn Marino 	kw_rebuildparity,
12786d7f5d3SJohn Marino 	kw_dumpconfig,
12886d7f5d3SJohn Marino 	kw_retryerrors,
12986d7f5d3SJohn Marino 	kw_invalid_keyword = -1
13086d7f5d3SJohn Marino };
13186d7f5d3SJohn Marino 
13286d7f5d3SJohn Marino struct _keywords {
13386d7f5d3SJohn Marino 	char *name;
13486d7f5d3SJohn Marino 	enum keyword keyword;
13586d7f5d3SJohn Marino };
13686d7f5d3SJohn Marino 
13786d7f5d3SJohn Marino struct keywordset {
13886d7f5d3SJohn Marino 	int size;
13986d7f5d3SJohn Marino 	struct _keywords *k;
14086d7f5d3SJohn Marino };
14186d7f5d3SJohn Marino 
14286d7f5d3SJohn Marino extern struct _keywords keywords[];
14386d7f5d3SJohn Marino extern struct _keywords flag_keywords[];
14486d7f5d3SJohn Marino 
14586d7f5d3SJohn Marino extern struct keywordset keyword_set;
14686d7f5d3SJohn Marino extern struct keywordset flag_set;
147