~ubuntu-branches/ubuntu/vivid/wpasupplicant/vivid

« back to all changes in this revision

Viewing changes to ctrl_iface_dbus.h

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2006-10-05 08:04:01 UTC
  • mfrom: (1.1.5 upstream) (3 etch)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20061005080401-r8lqlix4390yos7b
Tags: 0.5.5-2
* Update madwifi headers to latest SVN. (Closes: #388316)
* Remove failed attempt at action locking. [debian/functions.sh,
  debian/wpa_action.sh]
* Add hysteresis checking functions, to avoid "event loops" while
  using wpa-roam. [debian/functions.sh, debian/wpa_action.sh]
* Change of co-maintainer email address.
* Add ishex() function to functions.sh to determine wpa-psk value type in
  plaintext or hex. This effectively eliminates the need for the bogus and
  somewhat confusing wpa-passphrase contruct specific to our scripts and
  allows wpa-psk to work with either a 8 to 63 character long plaintext
  string or 64 character long hex string.
* Adjust README.modes to not refer to the redundant wpa-passphrase stuff.
* Add big fat NOTE about acceptable wpa-psk's to top of example gallery.
* Strip surrounding quotes from wpa-ssid if present, instead of just whining
  about them.
* Update email address in copyright blurb of functions.sh, ifupdown.sh and
  wpa_action.sh.  

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * WPA Supplicant / dbus-based control interface
3
 
 * Copyright (c) 2006, Dan Williams <dcbw@redhat.com>
 
3
 * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License version 2 as
17
17
 
18
18
#ifdef CONFIG_CTRL_IFACE_DBUS
19
19
 
20
 
#define WPA_SUPPLICANT_DBUS_SERVICE     "fi.epitest.hostap.WPASupplicant"
21
 
#define WPA_SUPPLICANT_DBUS_PATH        "/fi/epitest/hostap/WPASupplicant"
22
 
#define WPA_SUPPLICANT_DBUS_INTERFACE   "fi.epitest.hostap.WPASupplicant"
23
 
 
 
20
#include <dbus/dbus.h>
 
21
 
 
22
#define WPAS_DBUS_OBJECT_PATH_MAX 150
 
23
 
 
24
#define WPAS_DBUS_SERVICE       "fi.epitest.hostap.WPASupplicant"
 
25
#define WPAS_DBUS_PATH          "/fi/epitest/hostap/WPASupplicant"
 
26
#define WPAS_DBUS_INTERFACE     "fi.epitest.hostap.WPASupplicant"
 
27
 
 
28
#define WPAS_DBUS_PATH_INTERFACES       WPAS_DBUS_PATH "/Interfaces"
 
29
#define WPAS_DBUS_IFACE_INTERFACE       WPAS_DBUS_INTERFACE ".Interface"
 
30
 
 
31
#define WPAS_DBUS_NETWORKS_PART "Networks"
 
32
#define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network"
 
33
 
 
34
#define WPAS_DBUS_BSSIDS_PART   "BSSIDs"
 
35
#define WPAS_DBUS_IFACE_BSSID   WPAS_DBUS_INTERFACE ".BSSID"
 
36
 
 
37
 
 
38
/* Errors */
 
39
#define WPAS_ERROR_INVALID_NETWORK \
 
40
        WPAS_DBUS_IFACE_INTERFACE ".InvalidNetwork"
 
41
#define WPAS_ERROR_INVALID_BSSID \
 
42
        WPAS_DBUS_IFACE_INTERFACE ".InvalidBSSID"
 
43
 
 
44
#define WPAS_ERROR_INVALID_OPTS \
 
45
        WPAS_DBUS_INTERFACE ".InvalidOptions"
 
46
#define WPAS_ERROR_INVALID_IFACE \
 
47
        WPAS_DBUS_INTERFACE ".InvalidInterface"
 
48
 
 
49
#define WPAS_ERROR_ADD_ERROR \
 
50
        WPAS_DBUS_INTERFACE ".AddError"
 
51
#define WPAS_ERROR_EXISTS_ERROR \
 
52
        WPAS_DBUS_INTERFACE ".ExistsError"
 
53
#define WPAS_ERROR_REMOVE_ERROR \
 
54
        WPAS_DBUS_INTERFACE ".RemoveError"
 
55
 
 
56
#define WPAS_ERROR_SCAN_ERROR \
 
57
        WPAS_DBUS_IFACE_INTERFACE ".ScanError"
 
58
#define WPAS_ERROR_ADD_NETWORK_ERROR \
 
59
        WPAS_DBUS_IFACE_INTERFACE ".AddNetworkError"
 
60
#define WPAS_ERROR_INTERNAL_ERROR \
 
61
        WPAS_DBUS_IFACE_INTERFACE ".InternalError"
 
62
#define WPAS_ERROR_REMOVE_NETWORK_ERROR \
 
63
        WPAS_DBUS_IFACE_INTERFACE ".RemoveNetworkError"
 
64
 
 
65
#define WPAS_DBUS_BSSID_FORMAT "%02x%02x%02x%02x%02x%02x"
 
66
 
 
67
struct wpa_global;
 
68
struct wpa_supplicant;
24
69
 
25
70
struct ctrl_iface_dbus_priv *
26
71
wpa_supplicant_dbus_ctrl_iface_init(struct wpa_global *global);
27
72
void wpa_supplicant_dbus_ctrl_iface_deinit(struct ctrl_iface_dbus_priv *iface);
 
73
void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s);
 
74
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
 
75
                                             wpa_states new_state,
 
76
                                             wpa_states old_state);
 
77
 
 
78
char * wpas_dbus_decompose_object_path(const char *path, char **network,
 
79
                                       char **bssid);
 
80
 
 
81
int wpas_dbus_register_iface(struct wpa_supplicant *wpa_s);
 
82
int wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s);
 
83
 
 
84
 
 
85
/* Methods internal to the dbus control interface */
 
86
u32 wpa_supplicant_dbus_next_objid(struct ctrl_iface_dbus_priv *iface);
 
87
 
 
88
int wpa_supplicant_set_dbus_path(struct wpa_supplicant *wpa_s,
 
89
                                 const char *path);
 
90
const char *wpa_supplicant_get_dbus_path(struct wpa_supplicant *wpa_s);
 
91
struct wpa_supplicant * wpa_supplicant_get_iface_by_dbus_path(
 
92
        struct wpa_global *global, const char *path);
 
93
 
 
94
DBusMessage * wpas_dbus_new_invalid_iface_error(DBusMessage *message);
 
95
DBusMessage * wpas_dbus_new_invalid_network_error(DBusMessage *message);
28
96
 
29
97
#else /* CONFIG_CTRL_IFACE_DBUS */
30
98
 
39
107
{
40
108
}
41
109
 
 
110
static inline void
 
111
wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
 
112
{
 
113
}
 
114
 
 
115
static inline void
 
116
wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
 
117
                                        wpa_states new_state,
 
118
                                        wpa_states old_state)
 
119
{
 
120
}
 
121
 
 
122
static inline int
 
123
wpas_dbus_register_iface(struct wpa_supplicant *wpa_s)
 
124
{
 
125
        return 0;
 
126
}
 
127
 
 
128
static inline int
 
129
wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s)
 
130
{
 
131
        return 0;
 
132
}
 
133
 
42
134
#endif /* CONFIG_CTRL_IFACE_DBUS */
43
135
 
44
136
#endif /* CTRL_IFACE_DBUS_H */