libnwam.h revision ab32bdf2f746488f918233b2d8cabd5835efe9f3
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * CDDL HEADER START
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * The contents of this file are subject to the terms of the
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * Common Development and Distribution License (the "License").
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * You may not use this file except in compliance with the License.
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * See the License for the specific language governing permissions
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * and limitations under the License.
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * When distributing Covered Code, include this CDDL HEADER in each
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * If applicable, add the following below this CDDL HEADER, with the
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * fields enclosed by brackets "[]" replaced with your own identifying
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * information: Portions Copyright [yyyy] [name of copyright owner]
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * CDDL HEADER END
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * Use is subject to license terms.
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * This file defines the programming interface for libnwam. It is a private
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * (undocumented, subject to change) interface shared between the NWAM GUI and
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson/* Number of strings above; used for internal allocation purposes */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * The descriptive event types shared with nwamd and with the GUI client. With
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * all events other than deInitial, led_interface is always valid. The other
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson * fields are present when indicated, and otherwise must be left unused.
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson deInitial, /* no other fields; new active client */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson deInterfaceUp, /* led_v4address led_prefixlen */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcDHCP, /* DHCP left interface down or with zero addr */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcTimer, /* gave up on DHCP; switching to next best */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcUnplugged, /* interface lost RUNNING flag */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcBetter, /* higher-priority interface became RUNNING */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcNewAP, /* scan completed on higher-priority i/f */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcGone, /* periodic wireless scan showed disconnect */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcFaded, /* periodic scan showed "very weak" signal */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcAllDown, /* all-but-one taken down (initial LLP) */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcUnwanted, /* another higher-priority interface is up */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcSelect, /* different AP selected (forced down/up) */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson dcRemoved, /* interface removed from system */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson struct in_addr led_v4address; /* deInterfaceUp only */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsontypedef struct libnwam_llp_s {
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson int llp_pri; /* lower number => higher priority */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson boolean_t llp_primary; /* selected primary interface */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson boolean_t llp_locked; /* selected is locked */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson boolean_t llp_link_failed; /* unusable due to link failure */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson boolean_t llp_dhcp_failed; /* unusable due to DHCP failure */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson boolean_t llp_link_up; /* datalink layer is up */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson boolean_t llp_need_wlan; /* wlan/AP not yet selected */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson boolean_t llp_need_key; /* wlan key not set */
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsontypedef struct libnwam_wlan_s {
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern libnwam_event_data_t *libnwam_wait_event(void);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern void libnwam_free_event(libnwam_event_data_t *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern libnwam_llp_t *libnwam_get_llp_list(uint_t *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern void libnwam_free_llp_list(libnwam_llp_t *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_set_llp_priority(const char *, int);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_lock_llp(const char *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern libnwam_wlan_t *libnwam_get_wlan_list(uint_t *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern void libnwam_free_wlan_list(libnwam_wlan_t *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern libnwam_known_ap_t *libnwam_get_known_ap_list(uint_t *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern void libnwam_free_known_ap_list(libnwam_known_ap_t *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_add_known_ap(const char *, const char *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_delete_known_ap(const char *, const char *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_select_wlan(const char *, const char *, const char *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_wlan_key(const char *, const char *, const char *,
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson const char *);
ab32bdf2f746488f918233b2d8cabd5835efe9f3James Carlsonextern int libnwam_wlan_key_secmode(const char *, const char *, const char *,
ab32bdf2f746488f918233b2d8cabd5835efe9f3James Carlson const char *, const char *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_start_rescan(const char *);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_fini(void);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlsonextern int libnwam_init(int);
b00044a2eb43864b8718585d21949611a2ee59efJames Carlson#endif /* _LIBNWAM_H */