History log of /haiku/src/kits/network/libnetapi/NetworkDevice.cpp
Revision Date Author Comments
# 043b00fb 13-Sep-2018 Augustin Cavalier <waddlesplash@gmail.com>

BNetworkDevice: Fix memory leaks and address comments.

Thanks Axel and Jerome for the reviews!

Change-Id: I4f116c540cf59ba74b79d9d2f95ed40edc9c4174
Reviewed-on: https://review.haiku-os.org/557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 4e5aaaa7 12-Sep-2018 Augustin Cavalier <waddlesplash@gmail.com>

BNetworkDevice: Implement Scan().

This depends on the previous commit to return the correct error code
from ioctl().

If there are no VAPs running (which is the case after a forced disconnect
from an access point), scans will fail. In that case, we call
IEEE80211_IOC_HAIKU_COMPAT_WLAN_UP, which will restart a VAP, and then
initiate the scan.

Change-Id: I732aefe67e386dbb0ed3d232ed9deda678132601
Reviewed-on: https://review.haiku-os.org/551
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 0dc3ab4f 01-Aug-2018 Augustin Cavalier <waddlesplash@gmail.com>

libnetapi: Do not use the freebsd11_network headers globally.

Since they were being Use'd at global scope, the FreeBSD versions
of a number of POSIX headers were being used instead of the POSIX ones,
which breaks the build on non-x86 as these headers presently do not work
elsewhere.

Instead, just include the base directory, and then include the compat
headers manually in the one place that actually requires them.
Also fix all the other files that expected errno.h and others to
be included implicitly, which they now are not.

This should fix the PowerPC and (part of the) ARM builds.


# 31023893 15-Mar-2016 Julian Harnath <julian.harnath@rwth-aachen.de>

Network Kit: add BNetworkDevice::Control

* Allows to do an arbitrary ioctl on the network device

* For ifreq and ieee80211req requests


# d5dd8637 11-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

BNetworkDevice.GetHardwareAddress() was broken.

* Copy&paste error, apparently.


# 754bbf48 26-Nov-2013 Jérôme Duval <jerome.duval@gmail.com>

libnetapi: second pass of style cleanup

* remarks from Axel


# 7d7b9632 09-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

* 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


# a1b98367 07-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

Add a way to add persistent (configured) wireless_networks that will eventually
be stored by the backend in the net_server. I put it in BNetworkDevice because
that is where network enumeration is done as well, but I'm not sure that it fits
there particularly well.
Since BNetworkDevice::GetNetwork() directly interfaces with the driver and gets
the networks from scan results, such persistent networks don't yet show up in
those enumerations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42807 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0a8ad865 09-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Implemented operator<() for AF_LINK addresses as well; now NetworkStatus
actually marks the currently associated network.
* Removed unused code from NetworkDevice.cpp - doesn't look like we're going
to use it anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39793 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c4165266 09-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Parse the additional information elements the station sends in order to
retrieve the WLAN cipher/key configuration. Might not work perfectly yet; so
far I've only seen WPA2, and WPA networks.
* Have wlan_test show this extra info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39792 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 440d0e61 08-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Pretty much completed BNetworkDevice. The only parts missing are GetMediaAt(),
and parsing the extra station data to retrieve the authentication details.
Comments welcome.
* NetworkStatus should now mark the currently associated network (if any).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39774 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d8e6ee8 30-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Untested work-in-progress. Actually cannot work because of missing
functionality in BNetworkAddress.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bd61a6f 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Added Index() method, was not even declared yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39593 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 223cae9f 10-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Implemented IsEthernet(), and IsWireless() temporarily, but this will do
for some drivers at least.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39393 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d56eab0 25-Oct-2010 Axel Dörfler <axeld@pinc-software.de>

* Work in progress network API changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39147 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d5dd8637bb701f1bda37b7b9e4b63e6615481629 11-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

BNetworkDevice.GetHardwareAddress() was broken.

* Copy&paste error, apparently.


# 754bbf4866278ecd2da2c517560bc90c67a3a6f5 26-Nov-2013 Jérôme Duval <jerome.duval@gmail.com>

libnetapi: second pass of style cleanup

* remarks from Axel


# 7d7b9632250246bc3a60ae5c343f79c0236a9f02 09-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

* 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


# a1b98367ae834c4bb2027a0a7b8e9384af0f89d3 07-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

Add a way to add persistent (configured) wireless_networks that will eventually
be stored by the backend in the net_server. I put it in BNetworkDevice because
that is where network enumeration is done as well, but I'm not sure that it fits
there particularly well.
Since BNetworkDevice::GetNetwork() directly interfaces with the driver and gets
the networks from scan results, such persistent networks don't yet show up in
those enumerations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42807 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0a8ad865de1af8292591f980c130a376ff6eb219 09-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Implemented operator<() for AF_LINK addresses as well; now NetworkStatus
actually marks the currently associated network.
* Removed unused code from NetworkDevice.cpp - doesn't look like we're going
to use it anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39793 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c416526666f8e147086d96906a5f9b79ee2dcb96 09-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Parse the additional information elements the station sends in order to
retrieve the WLAN cipher/key configuration. Might not work perfectly yet; so
far I've only seen WPA2, and WPA networks.
* Have wlan_test show this extra info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39792 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 440d0e61e812dd49268aa75e9fee369e4df4db0d 08-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Pretty much completed BNetworkDevice. The only parts missing are GetMediaAt(),
and parsing the extra station data to retrieve the authentication details.
Comments welcome.
* NetworkStatus should now mark the currently associated network (if any).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39774 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d8e6ee862d36468a620df521b8b0ea37f9e32c1 30-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Untested work-in-progress. Actually cannot work because of missing
functionality in BNetworkAddress.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bd61a6f333f0af2627d9c7e60cac6323ddb0474 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Added Index() method, was not even declared yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39593 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 223cae9fe6bae99b3fb03efa0f42a9987f30eaca 10-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Implemented IsEthernet(), and IsWireless() temporarily, but this will do
for some drivers at least.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39393 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d56eab029dbd3266af0d791bba61dbd85e9020d 25-Oct-2010 Axel Dörfler <axeld@pinc-software.de>

* Work in progress network API changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39147 a95241bf-73f2-0310-859d-f6bbb57e9c96