/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* This file contains hidden implementation structures and APIs of libnwam,
* and is not installed in the proto area. Implementation is MT safe.
*/
#ifndef _LIBNWAM_IMPL_H
#define _LIBNWAM_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <libnwam_priv.h>
#include <libnwam.h>
/*
* We separate global flags (which are applicable to all object types) from
* local flags (which only apply to specific object types). These definitions
* mask off the global vs. local portions of the flags value, with the former
* being the low-order 32 bits and the latter the high-order 32 bits.
*/
/*
* multiplied by the maximum number of properties. The maximum object size
* and the maximum number of objects are used to determine how much space
* needs to be allocated for door calls to retrieve objects from the
* backend.
*/
#define NWAM_MAX_OBJECT_LEN \
((NWAM_MAX_NAME_LEN + \
(NWAM_MAX_VALUE_LEN * NWAM_MAX_NUM_VALUES)) * \
#define NWAM_MAX_OBJECT_LIST_LEN \
#define NWAM_BACKEND_DOOR_ARG_SIZE \
(sizeof (nwam_backend_door_arg_t) + \
#define NWAMD_DOOR_ARG_SIZE \
(sizeof (nwamd_door_arg_t) + \
(NWAMD_MAX_NUM_WLANS * sizeof (nwam_wlan_t));
struct nwam_handle {
void *nwh_data;
};
struct nwam_value {
union {
char **nwv_string;
} nwv_values;
};
/* Used in property table retrieval of property attributes */
/* Used to hold validation/description data for properties */
struct nwam_prop_table_entry {
const char *prop_name;
const char *prop_description;
};
struct nwam_prop_table {
};
/* Definitions that are used to map uint64 property values to strings */
/*
* Functions that interact with nwamd's door server to request
* object actions, states or to register for receipt of events from nwamd.
* See libnwam_door.c.
*/
const char *);
const char *, nwam_action_t);
const char *, nwam_state_t *, nwam_aux_state_t *);
uint_t *, nwam_wlan_t **);
/*
* Functions that access and manipulate backend representation of data -
* see libnwam_backend.c.
*/
extern nwam_error_t nwam_read_object_from_backend(char *, char *,
uint64_t, void *);
extern nwam_error_t nwam_update_object_in_backend(char *, char *,
uint64_t, void *);
extern nwam_error_t nwam_remove_object_from_backend(char *, char *,
uint64_t);
/*
* Functions that handle files-specific backend persistent representation
* of data - see libnwam_files.c.
*/
extern nwam_error_t nwam_read_object_from_files_backend(char *,
char *, uint64_t, void *);
extern nwam_error_t nwam_update_object_in_files_backend(char *,
char *, uint64_t, void *);
extern nwam_error_t nwam_remove_object_from_files_backend(char *,
char *, uint64_t);
/*
* Utility functions for nwam data (values and lists of values) associated
* with objects - see libnwam_values.c.
*/
nwam_error_t nwam_alloc_object_list(void *);
void nwam_free_object_list(void *);
nwam_error_t nwam_object_list_add_object_list(void *, char *, void *);
nwam_error_t nwam_object_list_remove_object_list(void *, char *);
nwam_error_t nwam_dup_object_list(void *, void *);
nwam_error_t nwam_next_object_list(void *, char *, char **, void *);
extern const char *nwam_value_type_to_string(nwam_value_type_t);
extern nwam_value_type_t nwam_string_to_value_type(const char *);
extern nwam_error_t nwam_delete_prop(void *, const char *);
/*
* Utility functions for nwam objects (NCUs, ENMs, locations and known WLANs).
* See libnwam_object.c.
*/
struct nwam_handle **);
uint64_t, struct nwam_handle **);
struct nwam_handle **);
int(*)(struct nwam_handle *, void *), void *, uint64_t, int *,
int(*)(struct nwam_handle *, uint64_t, void *));
void nwam_free(struct nwam_handle *);
struct nwam_handle **);
int(*)(const char *, nwam_value_t, void *), void *, uint64_t, int *);
const char *);
const char **);
boolean_t *);
boolean_t *);
const char *, nwam_value_t);
const char **);
nwam_aux_state_t *);
/*
* Generic validation functions - see libnwam_util.c.
*/
/* Misc. util functions */
extern boolean_t nwam_uid_is_special(void);
extern nwam_error_t nwam_set_smf_string_property(const char *, const char *,
const char *, const char *);
extern nwam_error_t nwam_get_smf_string_property(const char *, const char *,
const char *, char **);
extern int nwam_make_door_call(const char *, int *, void *, size_t);
extern nwam_error_t nwam_errno_to_nwam_error(int);
/* Needed in libnwam_files.c to check if NCP filename is valid */
#ifdef __cplusplus
}
#endif
#endif /* _LIBNWAM_IMPL_H */