* Remove the BNetworkDevice::AddPersistentNetwork() again and instead introduce

BNetworkRoster::{Count|GetNext|Add|Remove}PersistentNetwork() as it fits
  better (thanks Philippe for the heads up).
* Implement the backend for these functions in the net_server and also move
  conversion of the wireless_network based format into the settings based format
  there.
* Implement removal of a network from the settings and make adding a new network
  with the same name replace the old one instead of just adding multiple ones.
  Might need to change this in the future depending on how we want to handle
  multiple networks with the same name (i.e. distinguish based on BSSID or
  similar).
* Fix apparent oversight that caused configured networks _not_ to be used in the
  auto join attempt.
* Remove auto joining open networks. I've been bitten by that more than once now
  because we happen to have an open network in the neighbourhood that I now
  accidentally used to transfer quite a bit of (unencrypted) stuff before
  noticing... In the future, one will instead have to explicitly join an open
  network once and store that config. Note that the driver will actually still
  auto-associate with open networks due to how things are set up currently.
  Note also that the auto join will fire join requests whenever there's a
  disassociation event, so you might see spurious join dialogs when the
  wpa_supplicant actually just re-establishes the connection.
* Make join requests async again. Instead of waiting for a synchronous reply of
  the wpa_supplicant we instead return success when the request has been sent.
  While the API call might still be made synchronous again in the future, the
  net_server should really not block on an external application. In the case of
  the wpa_supplicant we would otherwise deadlock when using the new
  *PersistentNetwork() API after a successful join, and in other cases we might
  just unacceptably delay other calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42816 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2011-10-09 19:56:19 +00:00
parent d0509b7eb9
commit 7d7b963225
8 changed files with 401 additions and 113 deletions
+1 -3
View File
@@ -28,6 +28,7 @@ struct wireless_network {
// flags
#define B_NETWORK_IS_ENCRYPTED 0x01
#define B_NETWORK_IS_PERSISTENT 0x02
// authentication modes
enum {
@@ -97,9 +98,6 @@ public:
status_t GetNetwork(const BNetworkAddress& address,
wireless_network& network);
status_t AddPersistentNetwork(
const wireless_network& network);
status_t JoinNetwork(const char* name,
const char* password = NULL);
status_t JoinNetwork(const wireless_network& network,
+8
View File
@@ -12,6 +12,7 @@
class BMessenger;
class BNetworkInterface;
struct wireless_network;
class BNetworkRoster {
@@ -29,6 +30,13 @@ public:
status_t RemoveInterface(
const BNetworkInterface& interface);
int32 CountPersistentNetworks() const;
status_t GetNextPersistentNetwork(uint32* cookie,
wireless_network& network) const;
status_t AddPersistentNetwork(
const wireless_network& network);
status_t RemovePersistentNetwork(const char* name);
status_t StartWatching(const BMessenger& target,
uint32 eventMask);
void StopWatching(const BMessenger& target);
+3
View File
@@ -13,7 +13,10 @@
#define kMsgConfigureInterface 'COif'
#define kMsgConfigureResolver 'COrs'
#define kMsgCountPersistentNetworks 'CPnw'
#define kMsgGetPersistentNetwork 'GPnw'
#define kMsgAddPersistentNetwork 'APnw'
#define kMsgRemovePersistentNetwork 'RPnw'
#define kMsgJoinNetwork 'JNnw'
#define kMsgLeaveNetwork 'LVnw'