4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1998-1999 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Command line options
39 #define OPTIONS "ac:fhlno:s:tx:vy"
42 * Configuration operations
54 * Names for -c functions
56 static char *state_opts
[] = {
68 * Attachment point specifier types.
80 enum confirm
{ CONFIRM_DEFAULT
, CONFIRM_NO
, CONFIRM_YES
};
82 /* Limit size of sysinfo return */
83 #define SYSINFO_LENGTH 256
84 #define YESNO_STR_MAX 127
88 #define EXIT_OPFAILED 1
89 #define EXIT_NOTSUPP 2
90 #define EXIT_ARGERROR 3
92 /* Macro to figure size of cfga_list_data items */
93 #define SZ_EL(EL) (sizeof ((struct cfga_list_data *)NULL)->EL)
95 /* Maximum number of fields in cfgadm output */
96 #define N_FIELDS (sizeof (all_fields)/sizeof (all_fields[0]))
98 /* printing format controls */
99 #define DEF_SORT_FIELDS "ap_id"
101 #define DEF_COLS "ap_id:type:r_state:o_state:condition"
102 #define DEF_COLS2 NULL
103 #define DEF_COLS_VERBOSE "ap_id:r_state:o_state:condition:info"
104 #define DEF_COLS2_VERBOSE "status_time:type:busy:physid"
105 #define DEF_DELIM " "
107 /* listing field delimiter */
109 #define ARG_DELIM ' '
111 /* listing lengths for various fields */
112 #define STATE_WIDTH 12 /* longest - "disconnected" */
113 #define COND_WIDTH 10 /* longest is the heading - "condition" */
114 #define TIME_WIDTH 12
115 #define TIME_P_WIDTH 14 /* YYYYMMDDhhmmss */
116 /* Date and time formats */
118 * b --- abbreviated month name
120 * Y --- year in the form ccyy
121 * H --- hour(24-hour version)
124 #define FORMAT1 "%b %e %Y"
125 #define FORMAT2 "%b %e %H:%M"
127 /* listing control data */
130 struct field_info
*fld
;
135 struct field_info
*line1
;
136 struct field_info
*line2
;
140 * The first three types are used for filtering and the last for sorting.
143 CFGA_MATCH_PARTIAL
, /* pass if a partial match */
144 CFGA_MATCH_EXACT
, /* pass only if an exact match */
145 CFGA_MATCH_NOFILTER
, /* pass all. Not valid user input */
146 CFGA_MATCH_ORDER
/* compare and return relative order */
153 int (*compare
)(struct cfga_list_data
*, struct cfga_list_data
*,
155 void (*printfn
)(struct cfga_list_data
*, int, char *);
156 cfga_err_t (*set_filter
)(struct cfga_list_data
*, const char *);
159 /* list option strings */
160 static char *list_options
[] = {
169 #define LIST_NOHEADINGS 4
171 #define LIST_SELECT 5
178 /* Selection related */
181 int resp
; /* If set, this cmd arg received a response */
185 cfga_list_data_t
*ldatap
;
186 int req
; /* If set, this list_data was requested by user */
189 /* Filtering related */
190 #define CFGA_DEFAULT_MATCH CFGA_MATCH_EXACT
191 #define LEFT_PAREN '('
192 #define RIGHT_PAREN ')'
193 #define CFGA_DEV_DIR "/dev/cfg"
199 CFGA_PSTATE_ATTR_DONE
,
200 CFGA_PSTATE_VAL_DONE
,
204 typedef struct match_cvt
{
213 #endif /* _CFGADM_H */