xref: /freebsd/sys/geom/geom_ctl.h (revision ec3a1a66aad80b656971dcff4277d8ea4967fbb5)
1 /*-
2  * Copyright (c) 2003 Poul-Henning Kamp
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. The names of the authors may not be used to endorse or promote
14  *    products derived from this software without specific prior written
15  *    permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * $FreeBSD$
30  */
31 
32 #ifndef _GEOM_GEOM_CTL_H_
33 #define _GEOM_GEOM_CTL_H_
34 
35 /*
36  * Version number.  Used to check consistency between kernel and libgeom.
37  */
38 #define GEOM_CTL_VERSION	1
39 
40 /*
41  * Primitives.
42  */
43 enum geom_ctl_request {
44 	GEOM_INVALID_REQUEST = 0,
45 	GEOM_CREATE_GEOM,
46 	GEOM_NEW_GEOM,
47 	GEOM_ATTACH,
48 	GEOM_DETACH,
49 	GEOM_CREATE_PROVIDER,
50 	GEOM_DESTROY_PROVIDER,
51 	GEOM_INSERT_GEOM,
52 	GEOM_ELIMINATE_GEOM,
53 	GEOM_WRITE_META,
54 	GEOM_READ_META
55 };
56 
57 #ifdef GEOM_CTL_TABLE
58 struct geom_ctl_req_table {
59 	int             	class;
60 	int             	geom;
61 	int             	provider;
62 	int             	consumer;
63 	int             	params;
64 	int             	meta;
65 	char			*name;
66 	enum geom_ctl_request	request;
67 } gcrt[] = {
68 /*        Cl Ge Pr Co Pa Me Name                Request			*/
69 	{ 1, 1, 1, 0, 1, 0, "create geom",	GEOM_CREATE_GEOM            },
70 	{ 1, 1, 0, 0, 1, 0, "new geom",		GEOM_NEW_GEOM               },
71 	{ 0, 1, 1, 0, 1, 0, "attach",		GEOM_ATTACH                 },
72 	{ 0, 1, 1, 0, 1, 0, "detach",		GEOM_DETACH                 },
73 	{ 0, 1, 0, 0, 1, 0, "create provider",	GEOM_CREATE_PROVIDER        },
74 	{ 0, 1, 1, 0, 1, 0, "destroy provider",	GEOM_DESTROY_PROVIDER       },
75 	{ 1, 1, 1, 0, 1, 0, "insert geom",	GEOM_INSERT_GEOM            },
76 	{ 0, 1, 0, 0, 1, 0, "eliminate geom",	GEOM_ELIMINATE_GEOM         },
77 	{ 0, 1, 0, 0, 1, 1, "write meta",	GEOM_WRITE_META             },
78 	{ 0, 1, 0, 0, 1, 1, "read meta",	GEOM_READ_META              },
79 
80 	/* Terminator entry */
81 	{ 1, 1, 1, 1, 1, 1, "*INVALID*",	GEOM_INVALID_REQUEST        }
82 };
83 
84 #endif /* GEOM_CTL_TABLE */
85 
86 #endif /* _GEOM_GEOM_CTL_H_ */
87