xref: /freebsd/sys/geom/geom_ctl.h (revision f4c5766baa461767ccb595252b1614f1ecc6f1a7)
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 GCTL_VERSION	1
39 
40 /*
41  * Primitives.
42  */
43 enum gctl_request {
44 	GCTL_INVALID_REQUEST = 0,
45 
46 	GCTL_CREATE_GEOM,
47 	GCTL_DESTROY_GEOM,
48 
49 	GCTL_ATTACH,
50 	GCTL_DETACH,
51 
52 	GCTL_CREATE_PROVIDER,
53 	GCTL_DESTROY_PROVIDER,
54 
55 	GCTL_INSERT_GEOM,
56 	GCTL_ELIMINATE_GEOM,
57 
58 	GCTL_CONFIG_GEOM,
59 };
60 
61 #ifdef GCTL_TABLE
62 struct gctl_req_table {
63 	int             	class;
64 	int             	geom;
65 	int             	provider;
66 	int             	consumer;
67 	int             	params;
68 	char			*name;
69 	enum gctl_request	request;
70 } gcrt[] = {
71 /*        Cl Ge Pr Co Pa Name                Request			*/
72 	{ 1, 0, 1, 0, 1, "create geom",		GCTL_CREATE_GEOM            },
73 	{ 0, 1, 0, 0, 1, "destroy geom",	GCTL_DESTROY_GEOM           },
74 	{ 0, 1, 1, 0, 1, "attach",		GCTL_ATTACH                 },
75 	{ 0, 1, 1, 0, 1, "detach",		GCTL_DETACH                 },
76 	{ 0, 1, 0, 0, 1, "create provider",	GCTL_CREATE_PROVIDER        },
77 	{ 0, 1, 1, 0, 1, "destroy provider",	GCTL_DESTROY_PROVIDER       },
78 	{ 1, 1, 1, 0, 1, "insert geom",		GCTL_INSERT_GEOM            },
79 	{ 0, 1, 0, 0, 1, "eliminate geom",	GCTL_ELIMINATE_GEOM         },
80 	{ 0, 1, 0, 0, 1, "config geom",		GCTL_CONFIG_GEOM            },
81 
82 	/* Terminator entry */
83 	{ 1, 1, 1, 1, 1, "*INVALID*",		GCTL_INVALID_REQUEST        }
84 };
85 
86 #endif /* GCTL_TABLE */
87 
88 #endif /* _GEOM_GEOM_CTL_H_ */
89