summaryrefslogtreecommitdiff
path: root/usr.sbin/config/ukc.h
blob: b47897475cbe695b41279bd814b6551e0256ca6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*	$OpenBSD: ukc.h,v 1.11 2003/06/25 21:10:12 deraadt Exp $ */

/*
 * Copyright (c) 1999-2001 Mats O Jansson.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _UKC_H
#define _UKC_H

#define P_LOCNAMES	0
#define S_LOCNAMP	1
#define SA_CFROOTS	2
#define I_CFROOTS_SIZE	3
#define I_PV_SIZE	4
#define SA_PV		5
#define P_CFDATA	6
#define P_KERNEL_TEXT	7
#define P_VERSION	8
#define IA_EXTRALOC	9
#define I_NEXTRALOC	10
#define I_UEXTRALOC	11
#define	I_HISTLEN	12
#define	CA_HISTORY	13
#define TZ_TZ		14
#define P_PDEVNAMES	15
#define I_PDEVSIZE	16
#define S_PDEVINIT	17
#define I_NMBCLUSTERS	18
#define I_BUFCACHEPCT	19
#define I_NKMEMPG	20
#define I_SHMSEG	21
#define I_SHMMAXPGS	22
#define NLENTRIES	23

#ifdef UKC_MAIN
struct nlist nl[] = {
	{ "_locnames" },
	{ "_locnamp" },
	{ "_cfroots" },
	{ "_cfroots_size" },
	{ "_pv_size" },
	{ "_pv" },
	{ "_cfdata" },
	{ "_kernel_text" },
	{ "_version" },
	{ "_extraloc" },
	{ "_nextraloc" },
	{ "_uextraloc" },
	{ "_userconf_histlen" },
	{ "_userconf_history" },
	{ "_tz" },
	{ "_pdevnames" },
	{ "_pdevnames_size" },
	{ "_pdevinit" },
	{ "_nmbclust" },
	{ "_bufcachepercent" },
	{ "_nkmempages" },
	{ "_shmseg" },
	{ "_shmmaxpgs" },
	{ NULL },
};
struct nlist knl[] = {
	{ "_locnames" },
	{ "_locnamp" },
	{ "_cfroots" },
	{ "_cfroots_size" },
	{ "_pv_size" },
	{ "_pv" },
	{ "_cfdata" },
	{ "_kernel_text" },
	{ "_version" },
	{ "_extraloc" },
	{ "_nextraloc" },
	{ "_uextraloc" },
	{ "_userconf_histlen" },
	{ "_userconf_history" },
	{ "_tz" },
	{ "_pdevnames" },
	{ "_pdevnames_size" },
	{ "_pdevinit" },
	{ "_nmbclust" },
	{ "_bufcachepercent" },
	{ "_nkmempages" },
	{ "_shmseg" },
	{ "_shmmaxpgs" },
	{ NULL },
};
int	maxdev = 0;
int	totdev = 0;
int	maxpseudo = 0;
int	maxlocnames = 0;
int	base = 16;
int	cnt = -1;
int	lines = 18;
int	oldkernel = 0;
int	nopdev = 0;
#else
extern struct nlist nl[];
extern int maxdev;
extern int totdev;
extern int maxpseudo;
extern int maxlocnames;
extern int base;
extern int cnt;
extern int lines;
extern int oldkernel;
extern int nopdev;
#endif

struct cfdata   *get_cfdata(int);
short	        *get_locnamp(int);
caddr_t	        *get_locnames(int);
int	        *get_extraloc(int);
char	        *get_pdevnames(int);
struct pdevinit *get_pdevinit(int);

int	more(void);
void	pnum(int);
void	pdevnam(short);
void	pdev(short);
int	number(const char *, int *);
int	device(char *, int *, short *, short *);
int	attr(char *, int *);
void	modify(char *, int *);
void	change(int);
void	disable(int);
void	enable(int);
void	show(void);
void	common_attr_val(short, int *, char);
void	show_attr(char *);
void	common_dev(char *, int, short, short, char);
void	common_attr(char *, int, char);
void	add_read(char *, char, char *, int, int *);
void	add(char *, int, short, short);

int	config(void);
void	process_history(int, char *);

#define UC_CHANGE 'c'
#define UC_DISABLE 'd'
#define UC_ENABLE 'e'
#define UC_FIND 'f'
#define UC_SHOW 's'

#endif /* _UTIL_H */