/* diversity-ap.h - DiversityAp * * Copyright 2007 OpenMoko, Inc. * Authored by Chia-I Wu * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Inspired by NMAccessPoint from libnm-glib. */ #ifndef _DIVERSITY_AP_H_ #define _DIVERSITY_AP_H_ #define G_DISABLE_CAST_CHECKS #include #include #include G_BEGIN_DECLS #define DIVERSITY_TYPE_AP (diversity_ap_get_type()) #define DIVERSITY_AP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), DIVERSITY_TYPE_AP, DiversityAp)) #define DIVERSITY_AP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), DIVERSITY_TYPE_AP, DiversityApClass)) #define DIVERSITY_IS_AP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DIVERSITY_TYPE_AP)) #define DIVERSITY_IS_AP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), DIVERSITY_TYPE_AP)) #define DIVERSITY_AP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DIVERSITY_TYPE_AP, DiversityApClass)) typedef struct _DiversityAp DiversityAp; typedef struct _DiversityApClass DiversityApClass; struct _DiversityAp { DiversityObject parent_object; }; struct _DiversityApClass { DiversityObjectClass parent_class; void (*dummy)(DiversityAp *ap, gboolean conn); }; enum _diveristy_ap_flag { DIVERSITY_AP_FLAG_PAIR_WEP40 = 0x00000001, #define DIVERSITY_AP_FLAG_PRIVACY DIVERSITY_AP_FLAG_PAIR_WEP40 DIVERSITY_AP_FLAG_PAIR_WEP104 = 0x00000002, DIVERSITY_AP_FLAG_PAIR_TKIP = 0x00000004, DIVERSITY_AP_FLAG_PAIR_CCMP = 0x00000008, DIVERSITY_AP_FLAG_GROUP_WEP40 = 0x00000010, DIVERSITY_AP_FLAG_GROUP_WEP104 = 0x00000020, DIVERSITY_AP_FLAG_GROUP_TKIP = 0x00000040, DIVERSITY_AP_FLAG_GROUP_CCMP = 0x00000080, DIVERSITY_AP_FLAG_KEY_MGMT_PSK = 0x00000100, DIVERSITY_AP_FLAG_KEY_MGMT_802_1X = 0x00000200, }; /* include wireless.h? */ enum _diveristy_ap_mode { DIVERSITY_AP_MODE_AUTO, DIVERSITY_AP_MODE_ADHOC, DIVERSITY_AP_MODE_INFRA, DIVERSITY_AP_MODE_MASTER, DIVERSITY_AP_MODE_REPEAT, DIVERSITY_AP_MODE_SECOND, DIVERSITY_AP_MODE_MONITOR, }; GType diversity_ap_get_type(void) G_GNUC_CONST; DiversityAp *diversity_ap_new(void); void diversity_ap_set_in_service(DiversityAp *ap, gboolean in_service); gboolean diversity_ap_get_in_service(DiversityAp *ap); void diversity_ap_set_flags(DiversityAp *ap, guint32 flags); guint32 diversity_ap_get_flags(DiversityAp *ap); void diversity_ap_set_wpa_flags(DiversityAp *ap, guint32 wpa_flags); guint32 diversity_ap_get_wpa_flags(DiversityAp *ap); void diversity_ap_set_rsn_flags(DiversityAp *ap, guint32 rsn_flags); guint32 diversity_ap_get_rsn_flags(DiversityAp *ap); void diversity_ap_set_ssid(DiversityAp *ap, const gchar *ssid); const gchar *diversity_ap_get_ssid(DiversityAp *ap); void diversity_ap_set_frequency(DiversityAp *ap, guint32 freq); guint32 diversity_ap_get_frequency(DiversityAp *ap); void diversity_ap_set_hw_address(DiversityAp *ap, const gchar *hw_address); const gchar *diversity_ap_get_hw_address(DiversityAp *ap); void diversity_ap_set_mode(DiversityAp *ap, gint mode); gint diversity_ap_get_mode(DiversityAp *ap); void diversity_ap_set_rate(DiversityAp *ap, guint32 rate); guint32 diversity_ap_get_rate(DiversityAp *ap); void diversity_ap_set_strength(DiversityAp *ap, gint8 strength); gint8 diversity_ap_get_strength(DiversityAp *ap); void diversity_ap_merge(DiversityAp *ap, DiversityAp *src); #define DIVERSITY_AP_STRENGTH_GRID 8 void diversity_ap_update_strength_grid(DiversityAp *ap, gdouble x, gdouble y, gint8 strength); const gint8 *diversity_ap_get_strength_grid(DiversityAp *ap); G_END_DECLS #endif /* _DIVERSITY_AP_H_ */