/*
* 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
*/
/*
*/
#ifndef _NCU_H
#define _NCU_H
#include <dhcpagent_ipc.h>
#include <dhcpagent_util.h>
#include <libdladm.h>
#include <libdlpi.h>
#include <libdlwlan.h>
#include <libinetutil.h>
#include <libipadm.h>
#include <libnwam.h>
#include <libnwam_priv.h>
#include <libuutil.h>
#include <pthread.h>
#include "events.h"
extern pthread_mutex_t active_ncp_mutex;
extern pthread_mutex_t active_loc_mutex;
extern char active_loc[];
extern uint64_t wireless_scan_interval;
extern boolean_t wireless_autoconf;
extern boolean_t wireless_strict_bssid;
/*
* NCPs are collections of NCUs. At the moment there is one NCP in the system
* and its expected there will never be many. There is a lock on the NCP which
* must be obtained to add or remove anything from the NCP.
*
* NCUs are also kept in a uu list for easy walking. Each NCU has a lock which
* is used to protect manipulation of its contents. One of its members is a
* reference count which is initialized to 1 when its placed on the NCP. As
* references are passed around that should be manipulated as necessary
* (helper functions YYY provided). It is removed from the NCP by
* ncu_destroy() but the memory containing it is not returned to the free pool
* until the reference count falls to 0.
*
* As we add
* more complex system objects their relationship becomes more complex. That
* is represented by the links within the NCUs. Reference counts should be
* used to maintain the consistency of these links. Care should be used when
* walking more complex structures that might contain cycles.
*/
typedef struct nwamd_wifi_scan {
typedef struct nwamd_link {
char *nwamd_link_mac_addr;
char **nwamd_link_autopush;
} nwamd_link_t;
struct nwamd_if_address {
};
typedef struct nwamd_if {
} nwamd_if_t;
typedef struct nwamd_ncu {
char *ncu_name;
union {
} ncu_node;
} nwamd_ncu_t;
struct nwamd_dhcp_thread_arg {
char *name;
};
/*
* This dladm and ipadm handles are opened before interfaces are initialized
* and closed only when nwamd shuts down.
*/
extern dladm_handle_t dld_handle;
extern ipadm_handle_t ipadm_handle;
extern void nwamd_log_ncus(void);
extern void nwamd_ncu_free(nwamd_ncu_t *);
/* WLAN functions */
extern nwam_error_t nwamd_wlan_select(const char *, const char *, const char *,
extern nwam_error_t nwamd_wlan_set_key(const char *, const char *, const char *,
extern nwam_error_t nwamd_wlan_scan(const char *);
extern void nwamd_wlan_connect(const char *);
extern void nwamd_wlan_monitor_signal(const char *);
extern void nwamd_ncu_create_periodic_scan_event(nwamd_object_t);
extern void nwamd_set_key_name(const char *, const char *, char *, size_t);
/* Link functions */
extern link_state_t nwamd_get_link_state(const char *);
extern const char *nwamd_sockaddr_to_str(const struct sockaddr *, char *,
size_t);
extern void nwamd_propogate_link_up_down_to_ip(const char *, boolean_t);
/* DLPI event hooking */
extern void nwamd_dlpi_add_link(nwamd_object_t);
extern void nwamd_dlpi_delete_link(nwamd_object_t);
/* IP functions */
extern void nwamd_configure_interface_addresses(nwamd_ncu_t *);
extern char *nwamd_get_dhcpinfo_data(const char *, char *);
extern void nwamd_dhcp_release(const char *);
extern void nwamd_add_default_routes(nwamd_ncu_t *);
struct sockaddr *, const char *);
const char *);
const char *);
char ***, uint_t *, const char *);
extern void nwamd_walk_physical_configuration(void);
#endif /* _NCU_H */