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 * $DragonFly: src/sys/dev/raid/vinum/vinumkw.h,v 1.2 2003/06/17 04:28:33 dillon Exp $ 39 */ 40 41 /* 42 * Command keywords that vinum knows. These include both user-level 43 * and kernel-level stuff 44 */ 45 46 /* 47 * Our complete vocabulary. The names of the commands are 48 * the same as the identifier without the kw_ at the beginning 49 * (i.e. kw_create defines the "create" keyword). Preprocessor 50 * magic in parser.c does the rest. 51 * 52 * To add a new word: put it in the table below and one of the 53 * lists in vinumparser.c (probably keywords). 54 */ 55 enum keyword { 56 kw_create, 57 kw_modify, 58 kw_list, 59 kw_l = kw_list, 60 kw_ld, /* list drive */ 61 kw_ls, /* list subdisk */ 62 kw_lp, /* list plex */ 63 kw_lv, /* list volume */ 64 kw_set, 65 kw_rm, 66 kw_mv, /* move object */ 67 kw_move, /* synonym for mv */ 68 kw_start, 69 kw_stop, 70 kw_makedev, /* make /dev/vinum devices */ 71 kw_setdaemon, /* set daemon flags */ 72 kw_getdaemon, /* set daemon flags */ 73 kw_help, 74 kw_drive, 75 kw_partition, 76 kw_sd, 77 kw_subdisk = kw_sd, 78 kw_plex, 79 kw_volume, 80 kw_vol = kw_volume, 81 kw_read, 82 kw_readpol, 83 kw_org, 84 kw_name, 85 kw_concat, 86 kw_striped, 87 kw_raid4, 88 kw_raid5, 89 kw_driveoffset, 90 kw_plexoffset, 91 kw_len, 92 kw_length = kw_len, 93 kw_size = kw_len, 94 kw_state, 95 kw_setupstate, 96 kw_d, /* flag names */ 97 kw_f, 98 kw_r, 99 kw_s, 100 kw_v, 101 kw_w, 102 kw_round, /* round robin */ 103 kw_prefer, /* prefer plex */ 104 kw_device, 105 kw_init, 106 kw_label, 107 kw_resetconfig, 108 kw_writethrough, 109 kw_writeback, 110 kw_raw, 111 kw_replace, 112 kw_resetstats, 113 kw_attach, 114 kw_detach, 115 kw_rename, 116 kw_printconfig, 117 kw_saveconfig, 118 kw_hotspare, 119 kw_detached, 120 #ifdef VINUMDEBUG 121 kw_debug, /* go into debugger */ 122 #endif 123 kw_stripe, 124 kw_mirror, 125 kw_info, 126 kw_quit, 127 kw_max, 128 kw_setstate, 129 kw_checkparity, 130 kw_rebuildparity, 131 kw_dumpconfig, 132 kw_retryerrors, 133 kw_invalid_keyword = -1 134 }; 135 136 struct _keywords { 137 char *name; 138 enum keyword keyword; 139 }; 140 141 struct keywordset { 142 int size; 143 struct _keywords *k; 144 }; 145 146 extern struct _keywords keywords[]; 147 extern struct _keywords flag_keywords[]; 148 149 extern struct keywordset keyword_set; 150 extern struct keywordset flag_set; 151