/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 2003 Poul-Henning Kamp4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. The names of the authors may not be used to endorse or promote15* products derived from this software without specific prior written16* permission.17*18* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND19* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE21* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE22* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL23* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS24* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)25* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT26* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY27* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*/3031#ifndef _GEOM_GEOM_CTL_H_32#define _GEOM_GEOM_CTL_H_3334#include <sys/ioccom.h>3536/*37* Version number. Used to check consistency between kernel and libgeom.38*/39#define GCTL_VERSION 24041struct gctl_req_arg {42u_int nlen;43char *name;44off_t offset;45int flag;46int len;47void *value;48/* kernel only fields */49void *kvalue;50};5152#define GCTL_PARAM_RD 1 /* Must match VM_PROT_READ */53#define GCTL_PARAM_WR 2 /* Must match VM_PROT_WRITE */54#define GCTL_PARAM_RW (GCTL_PARAM_RD | GCTL_PARAM_WR)55#define GCTL_PARAM_ASCII 45657/* These are used in the kernel only */58#define GCTL_PARAM_NAMEKERNEL 859#define GCTL_PARAM_VALUEKERNEL 1660#define GCTL_PARAM_CHANGED 326162struct gctl_req {63u_int version;64u_int serial;65u_int narg;66struct gctl_req_arg *arg;67u_int lerror;68char *error;69struct gctl_req_table *reqt;7071/* kernel only fields */72int nerror;73struct sbuf *serror;74};7576#define GEOM_CTL _IOW('G', GCTL_VERSION, struct gctl_req)7778#define GEOM_CTL_ARG_MAX 2048 /* maximum number of parameters */7980#define PATH_GEOM_CTL "geom.ctl"8182#endif /* _GEOM_GEOM_CTL_H_ */838485