16ba597c5SAnurag S. Maskey /*
26ba597c5SAnurag S. Maskey  * CDDL HEADER START
36ba597c5SAnurag S. Maskey  *
46ba597c5SAnurag S. Maskey  * The contents of this file are subject to the terms of the
56ba597c5SAnurag S. Maskey  * Common Development and Distribution License (the "License").
66ba597c5SAnurag S. Maskey  * You may not use this file except in compliance with the License.
76ba597c5SAnurag S. Maskey  *
86ba597c5SAnurag S. Maskey  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96ba597c5SAnurag S. Maskey  * or http://www.opensolaris.org/os/licensing.
106ba597c5SAnurag S. Maskey  * See the License for the specific language governing permissions
116ba597c5SAnurag S. Maskey  * and limitations under the License.
126ba597c5SAnurag S. Maskey  *
136ba597c5SAnurag S. Maskey  * When distributing Covered Code, include this CDDL HEADER in each
146ba597c5SAnurag S. Maskey  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156ba597c5SAnurag S. Maskey  * If applicable, add the following below this CDDL HEADER, with the
166ba597c5SAnurag S. Maskey  * fields enclosed by brackets "[]" replaced with your own identifying
176ba597c5SAnurag S. Maskey  * information: Portions Copyright [yyyy] [name of copyright owner]
186ba597c5SAnurag S. Maskey  *
196ba597c5SAnurag S. Maskey  * CDDL HEADER END
206ba597c5SAnurag S. Maskey  */
216ba597c5SAnurag S. Maskey /*
226ba597c5SAnurag S. Maskey  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
236ba597c5SAnurag S. Maskey  * Use is subject to license terms.
246ba597c5SAnurag S. Maskey  */
256ba597c5SAnurag S. Maskey 
266ba597c5SAnurag S. Maskey /*
276ba597c5SAnurag S. Maskey  * This file contains hidden implementation structures and APIs of libnwam,
286ba597c5SAnurag S. Maskey  * and is not installed in the proto area.  Implementation is MT safe.
296ba597c5SAnurag S. Maskey  */
306ba597c5SAnurag S. Maskey 
316ba597c5SAnurag S. Maskey 
326ba597c5SAnurag S. Maskey #ifndef _LIBNWAM_IMPL_H
336ba597c5SAnurag S. Maskey #define	_LIBNWAM_IMPL_H
346ba597c5SAnurag S. Maskey 
356ba597c5SAnurag S. Maskey #ifdef	__cplusplus
366ba597c5SAnurag S. Maskey extern "C" {
376ba597c5SAnurag S. Maskey #endif
386ba597c5SAnurag S. Maskey 
396ba597c5SAnurag S. Maskey #include <libnwam_priv.h>
406ba597c5SAnurag S. Maskey #include <libnwam.h>
416ba597c5SAnurag S. Maskey 
426ba597c5SAnurag S. Maskey /*
436ba597c5SAnurag S. Maskey  * We separate global flags (which are applicable to all object types) from
446ba597c5SAnurag S. Maskey  * local flags (which only apply to specific object types).  These definitions
456ba597c5SAnurag S. Maskey  * mask off the global vs. local portions of the flags value, with the former
466ba597c5SAnurag S. Maskey  * being the low-order 32 bits and the latter the high-order 32 bits.
476ba597c5SAnurag S. Maskey  */
486ba597c5SAnurag S. Maskey #define	NWAM_FLAG_GLOBAL_MASK		0xFFFFFFFF
496ba597c5SAnurag S. Maskey #define	NWAM_FLAG_LOCAL_MASK		0xFFFFFFFFULL << 32
506ba597c5SAnurag S. Maskey #define	NWAM_WALK_FILTER_MASK		NWAM_FLAG_LOCAL_MASK
516ba597c5SAnurag S. Maskey 
526ba597c5SAnurag S. Maskey /*
536ba597c5SAnurag S. Maskey  * Maximum object size is the size of a maximally-sized name/values property
546ba597c5SAnurag S. Maskey  * multiplied by the maximum number of properties.  The maximum object size
556ba597c5SAnurag S. Maskey  * and the maximum number of objects are used to determine how much space
566ba597c5SAnurag S. Maskey  * needs to be allocated for door calls to retrieve objects from the
576ba597c5SAnurag S. Maskey  * backend.
586ba597c5SAnurag S. Maskey  */
596ba597c5SAnurag S. Maskey #define	NWAM_MAX_OBJECT_LEN 		\
606ba597c5SAnurag S. Maskey 	((NWAM_MAX_NAME_LEN +		\
616ba597c5SAnurag S. Maskey 	(NWAM_MAX_VALUE_LEN * NWAM_MAX_NUM_VALUES)) * \
626ba597c5SAnurag S. Maskey 	NWAM_MAX_NUM_PROPERTIES)
636ba597c5SAnurag S. Maskey 
646ba597c5SAnurag S. Maskey #define	NWAM_MAX_NUM_OBJECTS		4192
656ba597c5SAnurag S. Maskey 
666ba597c5SAnurag S. Maskey #define	NWAM_MAX_OBJECT_LIST_LEN	\
676ba597c5SAnurag S. Maskey 	(NWAM_MAX_NUM_OBJECTS * NWAM_MAX_NAME_LEN)
686ba597c5SAnurag S. Maskey 
696ba597c5SAnurag S. Maskey #define	NWAM_BACKEND_DOOR_ARG_SIZE      \
706ba597c5SAnurag S. Maskey 	(sizeof (nwam_backend_door_arg_t) + \
716ba597c5SAnurag S. Maskey 	(NWAM_MAX_OBJECT_LEN > NWAM_MAX_OBJECT_LIST_LEN ? \
726ba597c5SAnurag S. Maskey 	NWAM_MAX_OBJECT_LEN : NWAM_MAX_OBJECT_LIST_LEN))
736ba597c5SAnurag S. Maskey 
746ba597c5SAnurag S. Maskey 
756ba597c5SAnurag S. Maskey #define	NWAMD_DOOR_ARG_SIZE		\
766ba597c5SAnurag S. Maskey 	(sizeof (nwamd_door_arg_t) + \
776ba597c5SAnurag S. Maskey 	(NWAMD_MAX_NUM_WLANS * sizeof (nwam_wlan_t));
786ba597c5SAnurag S. Maskey 
796ba597c5SAnurag S. Maskey #define	NWAM_CONF_DIR			"/etc/nwam/"
806ba597c5SAnurag S. Maskey 
816ba597c5SAnurag S. Maskey #define	NWAM_LOC_OBJECT_STRING	"loc"
826ba597c5SAnurag S. Maskey #define	NWAM_LOC_CONF_FILE	NWAM_CONF_DIR "loc.conf"
836ba597c5SAnurag S. Maskey 
846ba597c5SAnurag S. Maskey struct nwam_handle {
856ba597c5SAnurag S. Maskey 	nwam_object_type_t nwh_object_type;
866ba597c5SAnurag S. Maskey 	char nwh_name[NWAM_MAX_NAME_LEN];
876ba597c5SAnurag S. Maskey 	boolean_t nwh_committed;
886ba597c5SAnurag S. Maskey 	void *nwh_data;
896ba597c5SAnurag S. Maskey };
906ba597c5SAnurag S. Maskey 
916ba597c5SAnurag S. Maskey #define	NWAM_OBJECT_NAMES_STRING	"object-names"
926ba597c5SAnurag S. Maskey #define	NWAM_NCP_OBJECT_STRING		"ncp"
936ba597c5SAnurag S. Maskey #define	NWAM_NCP_CONF_FILE_PRE		"ncp-"
946ba597c5SAnurag S. Maskey #define	NWAM_NCP_CONF_FILE_SUF		".conf"
956ba597c5SAnurag S. Maskey #define	NWAM_NCU_LINK_NAME_PRE		"link:"
966ba597c5SAnurag S. Maskey #define	NWAM_NCU_INTERFACE_NAME_PRE	"interface:"
976ba597c5SAnurag S. Maskey 
986ba597c5SAnurag S. Maskey struct nwam_value {
996ba597c5SAnurag S. Maskey 	nwam_value_type_t nwv_value_type;
1006ba597c5SAnurag S. Maskey 	uint_t nwv_value_numvalues;
1016ba597c5SAnurag S. Maskey 	union {
1026ba597c5SAnurag S. Maskey 		boolean_t *nwv_boolean;
1036ba597c5SAnurag S. Maskey 		int64_t *nwv_int64;
1046ba597c5SAnurag S. Maskey 		uint64_t *nwv_uint64;
1056ba597c5SAnurag S. Maskey 		char **nwv_string;
1066ba597c5SAnurag S. Maskey 	} nwv_values;
1076ba597c5SAnurag S. Maskey };
1086ba597c5SAnurag S. Maskey 
1096ba597c5SAnurag S. Maskey /* Used in property table retrieval of property attributes */
1106ba597c5SAnurag S. Maskey #define	NWAM_TYPE_ANY		1
1116ba597c5SAnurag S. Maskey #define	NWAM_CLASS_ANY		1
1126ba597c5SAnurag S. Maskey 
1136ba597c5SAnurag S. Maskey typedef nwam_error_t (*nwam_prop_validate_func_t)(nwam_value_t);
1146ba597c5SAnurag S. Maskey 
1156ba597c5SAnurag S. Maskey /* Used to hold validation/description data for properties */
1166ba597c5SAnurag S. Maskey struct nwam_prop_table_entry {
1176ba597c5SAnurag S. Maskey 	const char *prop_name;
1186ba597c5SAnurag S. Maskey 	nwam_value_type_t prop_type;
1196ba597c5SAnurag S. Maskey 	boolean_t prop_is_readonly;
1206ba597c5SAnurag S. Maskey 	uint_t prop_min_numvalues;
1216ba597c5SAnurag S. Maskey 	uint_t prop_max_numvalues;
1226ba597c5SAnurag S. Maskey 	nwam_prop_validate_func_t prop_validate;
1236ba597c5SAnurag S. Maskey 	const char *prop_description;
1246ba597c5SAnurag S. Maskey 	uint64_t prop_type_membership;
1256ba597c5SAnurag S. Maskey 	uint64_t prop_class_membership;
1266ba597c5SAnurag S. Maskey };
1276ba597c5SAnurag S. Maskey 
1286ba597c5SAnurag S. Maskey struct nwam_prop_table {
1296ba597c5SAnurag S. Maskey 	uint_t num_entries;
1306ba597c5SAnurag S. Maskey 	struct nwam_prop_table_entry *entries;
1316ba597c5SAnurag S. Maskey };
1326ba597c5SAnurag S. Maskey 
1336ba597c5SAnurag S. Maskey #define	NWAM_ENM_OBJECT_STRING	"enm"
1346ba597c5SAnurag S. Maskey #define	NWAM_ENM_CONF_FILE	NWAM_CONF_DIR "enm.conf"
1356ba597c5SAnurag S. Maskey 
1366ba597c5SAnurag S. Maskey #define	NWAM_KNOWN_WLAN_OBJECT_STRING	"known-wlan"
1376ba597c5SAnurag S. Maskey #define	NWAM_KNOWN_WLAN_CONF_FILE	NWAM_CONF_DIR "known-wlan.conf"
1386ba597c5SAnurag S. Maskey 
1396ba597c5SAnurag S. Maskey /* Definitions that are used to map uint64 property values to strings */
1406ba597c5SAnurag S. Maskey #define	NWAM_ACTIVATION_MODE_MANUAL_STRING		"manual"
1416ba597c5SAnurag S. Maskey #define	NWAM_ACTIVATION_MODE_SYSTEM_STRING		"system"
1426ba597c5SAnurag S. Maskey #define	NWAM_ACTIVATION_MODE_PRIORITIZED_STRING		"prioritized"
1436ba597c5SAnurag S. Maskey #define	NWAM_ACTIVATION_MODE_CONDITIONAL_ANY_STRING	"conditional-any"
1446ba597c5SAnurag S. Maskey #define	NWAM_ACTIVATION_MODE_CONDITIONAL_ALL_STRING	"conditional-all"
1456ba597c5SAnurag S. Maskey 
1466ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_IS_STRING			"is"
1476ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_IS_NOT_STRING			"is-not"
1486ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_IS_IN_RANGE_STRING		"is-in-range"
1496ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_IS_NOT_IN_RANGE_STRING		"is-not-in-range"
1506ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_CONTAINS_STRING			"contains"
1516ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_DOES_NOT_CONTAIN_STRING		"does-not-contain"
1526ba597c5SAnurag S. Maskey 
1536ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_NCP_STRING		"ncp"
1546ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_NCU_STRING		"ncu"
1556ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_ENM_STRING		"enm"
1566ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_LOC_STRING		"loc"
1576ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_IP_ADDRESS_STRING	"ip-address"
1586ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_ADV_DOMAIN_STRING	"advertised-domain"
1596ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_SYS_DOMAIN_STRING	"system-domain"
1606ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_ESSID_STRING		"essid"
1616ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_OBJECT_TYPE_BSSID_STRING		"bssid"
1626ba597c5SAnurag S. Maskey 
1636ba597c5SAnurag S. Maskey #define	NWAM_CONDITION_ACTIVE_STRING			"active"
1646ba597c5SAnurag S. Maskey 
1656ba597c5SAnurag S. Maskey #define	NWAM_NAMESERVICES_DNS_STRING			"dns"
1666ba597c5SAnurag S. Maskey #define	NWAM_NAMESERVICES_FILES_STRING			"files"
1676ba597c5SAnurag S. Maskey #define	NWAM_NAMESERVICES_NIS_STRING			"nis"
1686ba597c5SAnurag S. Maskey #define	NWAM_NAMESERVICES_LDAP_STRING			"ldap"
1696ba597c5SAnurag S. Maskey 
1706ba597c5SAnurag S. Maskey #define	NWAM_CONFIGSRC_MANUAL_STRING		"manual"
1716ba597c5SAnurag S. Maskey #define	NWAM_CONFIGSRC_DHCP_STRING		"dhcp"
1726ba597c5SAnurag S. Maskey 
1736ba597c5SAnurag S. Maskey #define	NWAM_NCU_TYPE_LINK_STRING			"link"
1746ba597c5SAnurag S. Maskey #define	NWAM_NCU_TYPE_INTERFACE_STRING			"interface"
1756ba597c5SAnurag S. Maskey 
1766ba597c5SAnurag S. Maskey #define	NWAM_NCU_CLASS_PHYS_STRING			"phys"
1776ba597c5SAnurag S. Maskey #define	NWAM_NCU_CLASS_IP_STRING			"ip"
1786ba597c5SAnurag S. Maskey 
1796ba597c5SAnurag S. Maskey #define	NWAM_IP_VERSION_IPV4_STRING			"ipv4"
1806ba597c5SAnurag S. Maskey #define	NWAM_IP_VERSION_IPV6_STRING			"ipv6"
1816ba597c5SAnurag S. Maskey 
1826ba597c5SAnurag S. Maskey #define	NWAM_ADDRSRC_DHCP_STRING			"dhcp"
1836ba597c5SAnurag S. Maskey #define	NWAM_ADDRSRC_AUTOCONF_STRING			"autoconf"
1846ba597c5SAnurag S. Maskey #define	NWAM_ADDRSRC_STATIC_STRING			"static"
1856ba597c5SAnurag S. Maskey 
1866ba597c5SAnurag S. Maskey #define	NWAM_PRIORITY_MODE_EXCLUSIVE_STRING		"exclusive"
1876ba597c5SAnurag S. Maskey #define	NWAM_PRIORITY_MODE_SHARED_STRING		"shared"
1886ba597c5SAnurag S. Maskey #define	NWAM_PRIORITY_MODE_ALL_STRING			"all"
1896ba597c5SAnurag S. Maskey 
1906ba597c5SAnurag S. Maskey /*
1916ba597c5SAnurag S. Maskey  * Functions that interact with nwamd's door server to request
1926ba597c5SAnurag S. Maskey  * object actions, states or to register for receipt of events from nwamd.
1936ba597c5SAnurag S. Maskey  * See libnwam_door.c.
1946ba597c5SAnurag S. Maskey  */
1956ba597c5SAnurag S. Maskey extern nwam_error_t nwam_request_register_unregister(nwam_request_type_t,
1966ba597c5SAnurag S. Maskey 	const char *);
1976ba597c5SAnurag S. Maskey extern nwam_error_t nwam_request_action(nwam_object_type_t, const char *,
1986ba597c5SAnurag S. Maskey 	const char *, nwam_action_t);
1996ba597c5SAnurag S. Maskey extern nwam_error_t nwam_request_state(nwam_object_type_t, const char *,
2006ba597c5SAnurag S. Maskey 	const char *, nwam_state_t *, nwam_aux_state_t *);
2016ba597c5SAnurag S. Maskey extern nwam_error_t nwam_request_wlan(nwam_request_type_t, const char *,
2026ba597c5SAnurag S. Maskey 	const char *, const char *, uint32_t, uint_t, const char *, boolean_t);
2036ba597c5SAnurag S. Maskey extern nwam_error_t nwam_request_wlan_scan_results(const char *name,
2046ba597c5SAnurag S. Maskey 	uint_t *, nwam_wlan_t **);
2056ba597c5SAnurag S. Maskey extern nwam_error_t nwam_request_active_priority_group(int64_t *);
2066ba597c5SAnurag S. Maskey 
2076ba597c5SAnurag S. Maskey /*
2086ba597c5SAnurag S. Maskey  * Functions that access and manipulate backend representation of data -
2096ba597c5SAnurag S. Maskey  * see libnwam_backend.c.
2106ba597c5SAnurag S. Maskey  */
2116ba597c5SAnurag S. Maskey extern nwam_error_t nwam_read_object_from_backend(char *, char *,
2126ba597c5SAnurag S. Maskey 	uint64_t, void *);
2136ba597c5SAnurag S. Maskey extern nwam_error_t nwam_update_object_in_backend(char *, char *,
2146ba597c5SAnurag S. Maskey 	uint64_t, void *);
2156ba597c5SAnurag S. Maskey extern nwam_error_t nwam_remove_object_from_backend(char *, char *,
2166ba597c5SAnurag S. Maskey 	uint64_t);
2176ba597c5SAnurag S. Maskey 
2186ba597c5SAnurag S. Maskey /*
2196ba597c5SAnurag S. Maskey  * Functions that handle files-specific backend persistent representation
2206ba597c5SAnurag S. Maskey  * of data - see libnwam_files.c.
2216ba597c5SAnurag S. Maskey  */
2226ba597c5SAnurag S. Maskey extern nwam_error_t nwam_read_object_from_files_backend(char *,
2236ba597c5SAnurag S. Maskey 	char *, uint64_t, void *);
2246ba597c5SAnurag S. Maskey extern nwam_error_t nwam_update_object_in_files_backend(char *,
2256ba597c5SAnurag S. Maskey 	char *, uint64_t, void *);
2266ba597c5SAnurag S. Maskey extern nwam_error_t nwam_remove_object_from_files_backend(char *,
2276ba597c5SAnurag S. Maskey 	char *, uint64_t);
2286ba597c5SAnurag S. Maskey 
2296ba597c5SAnurag S. Maskey /*
2306ba597c5SAnurag S. Maskey  * Utility functions for nwam data (values and lists of values) associated
2316ba597c5SAnurag S. Maskey  * with objects - see libnwam_values.c.
2326ba597c5SAnurag S. Maskey  */
2336ba597c5SAnurag S. Maskey nwam_error_t nwam_alloc_object_list(void *);
2346ba597c5SAnurag S. Maskey void nwam_free_object_list(void *);
2356ba597c5SAnurag S. Maskey nwam_error_t nwam_object_list_add_object_list(void *, char *, void *);
2366ba597c5SAnurag S. Maskey nwam_error_t nwam_object_list_remove_object_list(void *, char *);
2376ba597c5SAnurag S. Maskey nwam_error_t nwam_dup_object_list(void *, void *);
2386ba597c5SAnurag S. Maskey nwam_error_t nwam_next_object_list(void *, char *, char **, void *);
2396ba597c5SAnurag S. Maskey nwam_error_t nwam_next_object_prop(void *, char *, char **, nwam_value_t *);
2406ba597c5SAnurag S. Maskey extern nwam_error_t nwam_pack_object_list(void *, char **, size_t *);
2416ba597c5SAnurag S. Maskey extern nwam_error_t nwam_unpack_object_list(char *, size_t, void *);
2426ba597c5SAnurag S. Maskey 
2436ba597c5SAnurag S. Maskey extern const char *nwam_value_type_to_string(nwam_value_type_t);
2446ba597c5SAnurag S. Maskey extern nwam_value_type_t nwam_string_to_value_type(const char *);
2456ba597c5SAnurag S. Maskey extern nwam_error_t nwam_delete_prop(void *, const char *);
2466ba597c5SAnurag S. Maskey extern nwam_error_t nwam_set_prop_value(void *, const char *, nwam_value_t);
2476ba597c5SAnurag S. Maskey extern nwam_error_t nwam_get_prop_value(void *, const char *, nwam_value_t *);
2486ba597c5SAnurag S. Maskey 
2496ba597c5SAnurag S. Maskey /*
2506ba597c5SAnurag S. Maskey  * Utility functions for nwam objects (NCUs, ENMs, locations and known WLANs).
2516ba597c5SAnurag S. Maskey  * See libnwam_object.c.
2526ba597c5SAnurag S. Maskey  */
2536ba597c5SAnurag S. Maskey nwam_error_t nwam_handle_create(nwam_object_type_t, const char *,
2546ba597c5SAnurag S. Maskey 	struct nwam_handle **);
2556ba597c5SAnurag S. Maskey nwam_error_t nwam_read(nwam_object_type_t, const char *, const char *,
2566ba597c5SAnurag S. Maskey 	uint64_t, struct nwam_handle **);
2576ba597c5SAnurag S. Maskey nwam_error_t nwam_create(nwam_object_type_t, const char *, const char *,
2586ba597c5SAnurag S. Maskey 	struct nwam_handle **);
2596ba597c5SAnurag S. Maskey nwam_error_t nwam_get_name(struct nwam_handle *, char **);
2606ba597c5SAnurag S. Maskey nwam_error_t nwam_set_name(struct nwam_handle *, const char *);
2616ba597c5SAnurag S. Maskey nwam_error_t nwam_walk(nwam_object_type_t, const char *,
2626ba597c5SAnurag S. Maskey 	int(*)(struct nwam_handle *, void *), void *, uint64_t, int *,
2636ba597c5SAnurag S. Maskey 	int(*)(struct nwam_handle *, uint64_t, void *));
2646ba597c5SAnurag S. Maskey void nwam_free(struct nwam_handle *);
2656ba597c5SAnurag S. Maskey nwam_error_t nwam_copy(const char *, struct nwam_handle *, const char *,
2666ba597c5SAnurag S. Maskey 	struct nwam_handle **);
2676ba597c5SAnurag S. Maskey nwam_error_t nwam_walk_props(struct nwam_handle *,
2686ba597c5SAnurag S. Maskey 	int(*)(const char *, nwam_value_t, void *), void *, uint64_t, int *);
2696ba597c5SAnurag S. Maskey nwam_error_t nwam_commit(const char *, struct nwam_handle *, uint64_t);
2706ba597c5SAnurag S. Maskey nwam_error_t nwam_destroy(const char *, struct nwam_handle *, uint64_t);
2716ba597c5SAnurag S. Maskey nwam_error_t nwam_enable(const char *, struct nwam_handle *);
2726ba597c5SAnurag S. Maskey nwam_error_t nwam_disable(const char *, struct nwam_handle *);
2736ba597c5SAnurag S. Maskey struct nwam_prop_table_entry *nwam_get_prop_table_entry(struct nwam_prop_table,
2746ba597c5SAnurag S. Maskey 	const char *);
2756ba597c5SAnurag S. Maskey nwam_error_t nwam_get_prop_description(struct nwam_prop_table, const char *,
2766ba597c5SAnurag S. Maskey 	const char **);
2776ba597c5SAnurag S. Maskey nwam_error_t nwam_get_prop_type(struct nwam_prop_table, const char *,
2786ba597c5SAnurag S. Maskey 	nwam_value_type_t *);
2796ba597c5SAnurag S. Maskey nwam_error_t nwam_prop_multivalued(struct nwam_prop_table, const char *,
2806ba597c5SAnurag S. Maskey 	boolean_t *);
2816ba597c5SAnurag S. Maskey nwam_error_t nwam_prop_read_only(struct nwam_prop_table, const char *,
2826ba597c5SAnurag S. Maskey 	boolean_t *);
2836ba597c5SAnurag S. Maskey nwam_error_t nwam_validate_prop(struct nwam_prop_table, struct nwam_handle *,
2846ba597c5SAnurag S. Maskey 	const char *, nwam_value_t);
2856ba597c5SAnurag S. Maskey nwam_error_t nwam_validate(struct nwam_prop_table, struct nwam_handle *,
2866ba597c5SAnurag S. Maskey 	const char **);
2876ba597c5SAnurag S. Maskey nwam_error_t nwam_get_default_proplist(struct nwam_prop_table, uint64_t,
2886ba597c5SAnurag S. Maskey 	uint64_t, const char ***, uint_t *);
2896ba597c5SAnurag S. Maskey nwam_error_t nwam_get_state(const char *, struct nwam_handle *, nwam_state_t *,
2906ba597c5SAnurag S. Maskey 	nwam_aux_state_t *);
2916ba597c5SAnurag S. Maskey 
2926ba597c5SAnurag S. Maskey /*
2936ba597c5SAnurag S. Maskey  * Generic validation functions - see libnwam_util.c.
2946ba597c5SAnurag S. Maskey  */
2956ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_flags(uint64_t, uint64_t);
2966ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_condition(nwam_value_t);
2976ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_boolean(nwam_value_t);
2986ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_uint64(nwam_value_t);
2996ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_domain(nwam_value_t);
3006ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_host_any(nwam_value_t);
3016ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_host_v4(nwam_value_t);
3026ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_route_v4(nwam_value_t);
3036ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_host_v6(nwam_value_t);
3046ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_route_v6(nwam_value_t);
3056ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_host_or_domain(nwam_value_t);
3066ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_file(nwam_value_t);
3076ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_fmri(nwam_value_t);
3086ba597c5SAnurag S. Maskey extern nwam_error_t nwam_valid_mac_addr(nwam_value_t);
3096ba597c5SAnurag S. Maskey 
3106ba597c5SAnurag S. Maskey /* Misc. util functions */
311*69b43529SMichael Hunter extern boolean_t nwam_uid_is_special(void);
3126ba597c5SAnurag S. Maskey extern nwam_error_t nwam_set_smf_string_property(const char *, const char *,
3136ba597c5SAnurag S. Maskey 	const char *, const char *);
3146ba597c5SAnurag S. Maskey extern nwam_error_t nwam_get_smf_string_property(const char *, const char *,
3156ba597c5SAnurag S. Maskey 	const char *, char **);
3166ba597c5SAnurag S. Maskey extern int nwam_make_door_call(const char *, int *, void *, size_t);
3176ba597c5SAnurag S. Maskey extern nwam_error_t nwam_errno_to_nwam_error(int);
3186ba597c5SAnurag S. Maskey 
3196ba597c5SAnurag S. Maskey /* Needed in libnwam_files.c to check if NCP filename is valid */
320