4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
31 * header file for nwamcfg command
42 /* max length of "ncu", "ncp", "loc", "enm", "wlan" */
43 #define NWAM_MAX_TYPE_LEN 5
60 #define CMD_WALKPROP 15
62 #define CMD_MIN CMD_CANCEL
63 #define CMD_MAX CMD_WALKPROP
65 /* one-level resource types */
72 #define RT1_MIN RT1_UNKNOWN
73 #define RT1_MAX RT1_WLAN
75 /* two-level resource types */
79 #define RT2_MIN RT2_UNKNOWN
80 #define RT2_MAX RT2_NCU
82 /* class types for NCU's */
83 #define NCU_CLASS_PHYS 0
84 #define NCU_CLASS_IP 1
85 #define NCU_CLASS_ANY 2
87 #define NCU_CLASS_MIN NCU_CLASS_PHYS
88 #define NCU_CLASS_MAX NCU_CLASS_ANY
90 /* property types, matches NWAM_*_PROP_* from libnwam.h */
92 #define PT_ACTIVATION_MODE 1
97 #define PT_PRIORITY_GROUP 6
98 #define PT_PRIORITY_MODE 7
99 #define PT_LINK_MACADDR 8
100 #define PT_LINK_AUTOPUSH 9
101 #define PT_LINK_MTU 10
102 #define PT_IP_VERSION 11
103 #define PT_IPV4_ADDRSRC 12
104 #define PT_IPV4_ADDR 13
105 #define PT_IPV4_DEFAULT_ROUTE 14
106 #define PT_IPV6_ADDRSRC 15
107 #define PT_IPV6_ADDR 16
108 #define PT_IPV6_DEFAULT_ROUTE 17
109 #define PT_CONDITIONS 18
110 #define PT_ENM_FMRI 19
111 #define PT_ENM_START 20
112 #define PT_ENM_STOP 21
113 #define PT_LOC_NAMESERVICES 22
114 #define PT_LOC_NAMESERVICES_CONFIG 23
115 #define PT_LOC_DNS_CONFIGSRC 24
116 #define PT_LOC_DNS_DOMAIN 25
117 #define PT_LOC_DNS_SERVERS 26
118 #define PT_LOC_DNS_SEARCH 27
119 #define PT_LOC_NIS_CONFIGSRC 28
120 #define PT_LOC_NIS_SERVERS 29
121 #define PT_LOC_LDAP_CONFIGSRC 30
122 #define PT_LOC_LDAP_SERVERS 31
123 #define PT_LOC_DEFAULT_DOMAIN 32
124 #define PT_LOC_NFSV4_DOMAIN 33
125 #define PT_LOC_IPF_CONFIG 34
126 #define PT_LOC_IPF_V6_CONFIG 35
127 #define PT_LOC_IPNAT_CONFIG 36
128 #define PT_LOC_IPPOOL_CONFIG 37
129 #define PT_LOC_IKE_CONFIG 38
130 #define PT_LOC_IPSECPOL_CONFIG 39
131 #define PT_WLAN_BSSIDS 40
132 #define PT_WLAN_PRIORITY 41
133 #define PT_WLAN_KEYNAME 42
134 #define PT_WLAN_KEYSLOT 43
135 #define PT_WLAN_SECURITY_MODE 44
137 * If any new PT_ are defined here, make sure it is added in the same
138 * order into the pt_types array in nwamcfg.c
140 #define PT_MIN PT_UNKNOWN
141 #define PT_MAX PT_WLAN_SECURITY_MODE
143 #define MAX_SUBCMD_ARGS 3
147 void (*cmd_handler
)(struct cmd
*);
151 int cmd_ncu_class_type
;
153 char *cmd_argv
[MAX_SUBCMD_ARGS
+ 1];
156 /* Fuctions for each command */
157 typedef void (cmd_func_t
)(cmd_t
*);
159 extern cmd_func_t cancel_func
, clear_func
, commit_func
, create_func
;
160 extern cmd_func_t destroy_func
, end_func
, exit_func
, export_func
, get_func
;
161 extern cmd_func_t help_func
, list_func
, revert_func
, select_func
, set_func
;
162 extern cmd_func_t verify_func
, walkprop_func
;
164 extern cmd_t
*alloc_cmd(void);
165 extern void free_cmd(cmd_t
*cmd
);
167 extern boolean_t
check_scope(int);
168 extern const char *cmd_to_str(int);
170 extern void nerr(const char *, ...);
171 extern void properr(const char *);
173 extern boolean_t saw_error
;
181 #endif /* _NWAMCFG_H */