xref: /freebsd/sys/geom/geom_ctl.h (revision 729362425c09cf6b362366aabc6fb547eee8035a)
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 	GCTL_CREATE_GEOM,
46 	GCTL_DESTROY_GEOM,
47 	GCTL_ATTACH,
48 	GCTL_DETACH,
49 	GCTL_CREATE_PROVIDER,
50 	GCTL_DESTROY_PROVIDER,
51 	GCTL_INSERT_GEOM,
52 	GCTL_ELIMINATE_GEOM,
53 	GCTL_WRITE_META,
54 	GCTL_READ_META
55 };
56 
57 #ifdef GCTL_TABLE
58 struct gctl_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 gctl_request	request;
67 } gcrt[] = {
68 /*        Cl Ge Pr Co Pa Me Name                Request			*/
69 	{ 1, 0, 1, 0, 1, 0, "create geom",	GCTL_CREATE_GEOM            },
70 	{ 0, 1, 0, 0, 1, 0, "destroy geom",	GCTL_DESTROY_GEOM           },
71 	{ 0, 1, 1, 0, 1, 0, "attach",		GCTL_ATTACH                 },
72 	{ 0, 1, 1, 0, 1, 0, "detach",		GCTL_DETACH                 },
73 	{ 0, 1, 0, 0, 1, 0, "create provider",	GCTL_CREATE_PROVIDER        },
74 	{ 0, 1, 1, 0, 1, 0, "destroy provider",	GCTL_DESTROY_PROVIDER       },
75 	{ 1, 1, 1, 0, 1, 0, "insert geom",	GCTL_INSERT_GEOM            },
76 	{ 0, 1, 0, 0, 1, 0, "eliminate geom",	GCTL_ELIMINATE_GEOM         },
77 	{ 0, 1, 0, 0, 1, 1, "write meta",	GCTL_WRITE_META             },
78 	{ 0, 1, 0, 0, 1, 1, "read meta",	GCTL_READ_META              },
79 
80 	/* Terminator entry */
81 	{ 1, 1, 1, 1, 1, 1, "*INVALID*",	GCTL_INVALID_REQUEST        }
82 };
83 
84 #endif /* GCTL_TABLE */
85 
86 #endif /* _GEOM_GEOM_CTL_H_ */
87