History log of /haiku/headers/posix/net/if.h
Revision Date Author Comments
# 44fa45df 13-Jun-2022 Augustin Cavalier <waddlesplash@gmail.com>

net/if: Drop ifmediareq and just use the regular ifreq for SIOCGIFMEDIA.

This was introduced into the main API in 2010 (d72ede75fb252c24c8a5fcc39395f9ae1c202322),
but was actually only fully used for the past month (c2a9a890f3ac7795602d11c0edaa20ac2db48202)
when SIOCGIFMEDIA was supported for all *BSD drivers and not just WiFi.
Most userland consumers of this structure did not use it correctly,
as was the case in #17770, and only worked because in the fallback case
the network stack just treated it as if it were an ifreq.

Nothing actually used the ifm_count/ifm_ulist (though tentative APIs
were exposed for it) as noted by previous commits; and the fact that
Haiku's IFM_* declarations are so spartan makes most of the returned
values unintelligible to userland without using FreeBSD compat headers.

If, in the future, we decide to implement ifmedia listing and selection
properly, that should likely be done with separate ioctls instead of
having multi-function ones like this.

This is technically an ABI break, but in practice it should not matter:
ifmediareq::ifm_current aligns with ifreq::ifr_media, so the things
that used this structure like our in-tree code did will continue to work.
Until this past May, the only other field that was usually set was
ifm_active, but in the absence of setting ifm_status all non-Haiku
consumers should ignore it completely.

The only consumer of this ioctl that I know of out of the tree,
wpa_supplicant, still works after these changes.


# 173f54f1 19-Jul-2012 Matt Madia <mattmadia@gmail.com>

Updated copyright in headers. No functional change.


# 42bd1405 06-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Fix _SIZEOF_ADDR_IFREQ() macro definition: there is no ifreq type.


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


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

* We now use a FreeBSD compatible ifmediareq structure for SIOCIFMEDIA, and
SIOCSIFMEDIA.
* Made sure that the two media ioctls are actually forwarded to the driver.
* Added NetworkDevice.cpp to the build.


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


# 0fae8733 03-Nov-2010 Scott McCreary <scottmc2@gmail.com>

Updated posix headers to remove commas from copyright line, to match the preferred coding guidelines.
Cleaned up some header style violations, making sure there are two blank lines after the header guards.
This fixes the posix header part of #2191.


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


# 88ff3bdb 21-Sep-2010 Scott McCreary <scottmc2@gmail.com>

Fixed some variable names to fit coding style guidelines.


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


# e4ca3629 18-Sep-2010 Scott McCreary <scottmc2@gmail.com>

Readded parameter names, taking them from the ones used at opengroup, except for sockatmark for which I used descriptor instead of "s".


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


# 8e19103a 18-Sep-2010 Scott McCreary <scottmc2@gmail.com>

Applied patch from obache, this partially fixes #5784.


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


# 1f9c8c45 05-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Changed the _SIZEOF_ADDR_IFREQ() macro such that it can be used how we are
using it - hopefully, that is actually correct (it's adopted from FreeBSD).
* Fixed bug that cut off the sockaddr_dl reported by the system, so that DHCP
wouldn't work anymore (and ifconfig wouldn't show the actual MAC address
anymore).
* Changed the listing code to actually pad to ifreq size, and leave the length
of the sockaddr untouched.


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


# 2b1c0755 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed the proprietary SIOC_* ioctls to B_SOCKET_* - no reason to pollute
global name space, and have ugly identifiers for nothing :-)
* Added a flags field to struct ifaliasreq. Added flags to mark an alias that
is currently being configured, or has been automatically configured.
Those flags aren't used yet, but they will replace IFF_CONFIGURING and
friends.
* Implemented deleting addresses only from interfaces via ifconfig.
* Added more command aliases for delete to ifconfig ("del", and "delete", for
more consistency with route).
* Fixed control_routes() to only release a reference to an address if it
actually got one before.
* If an interface address is deleted, its routes are now removed as well.
* InterfaceAddress now holds a reference to its interface as planned.
* Implemented removing interfaces. Works quite nicely.
* When downing an interface, all of its routes are now removed. When upping
it again, at least the default routes are added.
* datalink.cpp's get_interface_name_or_index() leaked a reference to the
interface found.
* SIOCAIFADDR would also leak a reference when new addresses were added.


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


# 9d771afb 29-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Added Haiku specific socket ioctls to configure the interface aliases:
SIOC_IF_ALIAS_ADD, SIOC_IF_ALIAS_REMOVE, SIOC_IF_ALIAS_GET, SIOC_ALIAS_SET,
and SIOC_IF_ALIAS_COUNT.
* Implemented all of those new ioctls, though they are yet untested.
* Added ifreq::ifr_data, and removed the hack in the FreeBSD compat if.h
header.
* Minor cleanup.


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


# 61729d93 28-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Reworked the complete stack to allow more than one address per network
interface - this caused quite a number of changes.
* Network interfaces, and its addresses are now reference counted (not yet
complete, though, InterfaceAddresses need to hold references to their
interface as well).
* There are two known regressions of this commit that I will fix later:
- you cannot remove interfaces anymore
- IPv4 multicast was broken anyway, but now it's disabled, too.
* Moved a device_interfaces.cpp|h out of interfaces.cpp.
* The datalink layer chain is now instantiated per domain per interface,
not just per interface anymore.
* When a buffer reaches the network layer, it has no known interface yet, ie.
the ipv4|6|whatever modules need to set this manually.
* Added more debug output, and some new debugger commands, the control option
is now printed in clear text.
* Added hash_address() function to the address modules. Added "const" to
set_to_defaults() where needed.
* Fixed net_buffer's restore header functions offset use as reported by Atis.
* Improved buffer dump output, use the domain module to print the address if
available.
* Moved net_buffer::type into the union, as it's not needed by the upper layers
anymore.
* Moved IPv6 specific code from {add|remove}_default_route() to where it
belongs, but disabled it for the time being.
* Completely discarded useless ipv4_datagram module.
* Added ping6 to the build.


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


# a28ad480 04-Feb-2010 Axel Dörfler <axeld@pinc-software.de>

* Added _SIZEOF_ADDR_IFREQ() macro as existing on FreeBSD.


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


# 09b89797 01-May-2007 Hugo Santos <hugosantos@nowhere.fake>

added ADDMULTI/REMMULTI support to ipro1000. Also cleaned up the compat. layer a bit to reuse some of the system's definitions.


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


# 1a3ab92b 03-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote ether_driver.h, removed some BONE stuff we don't support at this point;
it might also be a good idea to change the constants to better match the usual
style.
* Added a BSD-style if_media.h.
* Added interface flags IFF_LINK, IFF_AUTO_CONFIGURED, and IFF_CONFIGURING. The
former will be set automatically by the stack, the rest will be set by the
net_server depending on the current state.


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


# 5adca30a 07-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Merge of branches/team/network/new_stack - not yet complete as SVN does only support
replacing files when merging when you don't have deleted them manually (for some reason,
it only works as part of the merge operation, and we didn't copy the whole tree to
have "a fresh start" - next time we know better, at least if SVN still suffers from
that same limitation).


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


# 74a17875 12-Jan-2004 Philippe Houdoin <philippe.houdoin@gmail.com>

Remove ether_driver.h API from the should-be-POSIX-only if.h.
Still some sem_id depedency, thought. Will be split into private and posix files soon.


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


# 9af57a10 01-Dec-2003 Philippe Houdoin <philippe.houdoin@gmail.com>

Now private sys/socketvar.h header is no more included.
Non-clean hack: include os-specific OS.h to get sem_id and thread_id types defined.
Should clean up this whole file one day, thought.


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


# 345d3d7d 31-Aug-2003 Waldemar Kornewald <wkornew@nowhere.fake>

Fixed a spelling error.


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


# b5dc136f 02-Aug-2003 shatty <shatty@nowhere.fake>

remove OS.h since it is already included through socketvar.h


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


# e8038705 09-Feb-2003 Philippe Houdoin <philippe.houdoin@gmail.com>

Forgot to commit these... Should fix network stuff build issues.
Add again the load_driver_symbols() export into our KernelExport.h, as it's expected
by many kernel add-ons (drivers, modules)... the network ones, for a start.


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


# 42415555 29-Oct-2002 beveloper <beveloper@nowhere.fake>

after many changes, the network stack can now be build


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


# 15750026 25-Oct-2002 beveloper <beveloper@nowhere.fake>

added C++ header guards


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


# 6bbdd797 12-Jul-2002 David Reid <dreid@nowhere.fake>

Remove the ppp headers until we actually have something that works.
Bring the rest of the files up to date.


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


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


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


# 173f54f1473bd6a6511c5fc6dc899c91fb8dd667 19-Jul-2012 Matt Madia <mattmadia@gmail.com>

Updated copyright in headers. No functional change.


# 42bd140546d62cdfce1f07cf620c1fd753a459ce 06-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Fix _SIZEOF_ADDR_IFREQ() macro definition: there is no ifreq type.


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


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

* We now use a FreeBSD compatible ifmediareq structure for SIOCIFMEDIA, and
SIOCSIFMEDIA.
* Made sure that the two media ioctls are actually forwarded to the driver.
* Added NetworkDevice.cpp to the build.


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


# 0fae873352b02792db93f721c1a2ff6b240c8ecc 03-Nov-2010 Scott McCreary <scottmc2@gmail.com>

Updated posix headers to remove commas from copyright line, to match the preferred coding guidelines.
Cleaned up some header style violations, making sure there are two blank lines after the header guards.
This fixes the posix header part of #2191.


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


# 88ff3bdb3365ef7dfa4f1d7a39e6fbe60b235f1a 21-Sep-2010 Scott McCreary <scottmc2@gmail.com>

Fixed some variable names to fit coding style guidelines.


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


# e4ca362903443a3b0785483479f86ccbff5c4e63 18-Sep-2010 Scott McCreary <scottmc2@gmail.com>

Readded parameter names, taking them from the ones used at opengroup, except for sockatmark for which I used descriptor instead of "s".


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


# 8e19103a0fc8dbb7733fc0c2d96f0dfb770552a1 18-Sep-2010 Scott McCreary <scottmc2@gmail.com>

Applied patch from obache, this partially fixes #5784.


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


# 1f9c8c4576524824cf035824a9cac69ac8371aee 05-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Changed the _SIZEOF_ADDR_IFREQ() macro such that it can be used how we are
using it - hopefully, that is actually correct (it's adopted from FreeBSD).
* Fixed bug that cut off the sockaddr_dl reported by the system, so that DHCP
wouldn't work anymore (and ifconfig wouldn't show the actual MAC address
anymore).
* Changed the listing code to actually pad to ifreq size, and leave the length
of the sockaddr untouched.


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


# 2b1c0755dd452db665050fdbbe06549e7e8c9c38 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed the proprietary SIOC_* ioctls to B_SOCKET_* - no reason to pollute
global name space, and have ugly identifiers for nothing :-)
* Added a flags field to struct ifaliasreq. Added flags to mark an alias that
is currently being configured, or has been automatically configured.
Those flags aren't used yet, but they will replace IFF_CONFIGURING and
friends.
* Implemented deleting addresses only from interfaces via ifconfig.
* Added more command aliases for delete to ifconfig ("del", and "delete", for
more consistency with route).
* Fixed control_routes() to only release a reference to an address if it
actually got one before.
* If an interface address is deleted, its routes are now removed as well.
* InterfaceAddress now holds a reference to its interface as planned.
* Implemented removing interfaces. Works quite nicely.
* When downing an interface, all of its routes are now removed. When upping
it again, at least the default routes are added.
* datalink.cpp's get_interface_name_or_index() leaked a reference to the
interface found.
* SIOCAIFADDR would also leak a reference when new addresses were added.


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


# 9d771afb3903b3d3d205cfa108eaebb14d89f7fb 29-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Added Haiku specific socket ioctls to configure the interface aliases:
SIOC_IF_ALIAS_ADD, SIOC_IF_ALIAS_REMOVE, SIOC_IF_ALIAS_GET, SIOC_ALIAS_SET,
and SIOC_IF_ALIAS_COUNT.
* Implemented all of those new ioctls, though they are yet untested.
* Added ifreq::ifr_data, and removed the hack in the FreeBSD compat if.h
header.
* Minor cleanup.


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


# 61729d9323a555b9025ef6ebeb85dc1627f8acf7 28-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Reworked the complete stack to allow more than one address per network
interface - this caused quite a number of changes.
* Network interfaces, and its addresses are now reference counted (not yet
complete, though, InterfaceAddresses need to hold references to their
interface as well).
* There are two known regressions of this commit that I will fix later:
- you cannot remove interfaces anymore
- IPv4 multicast was broken anyway, but now it's disabled, too.
* Moved a device_interfaces.cpp|h out of interfaces.cpp.
* The datalink layer chain is now instantiated per domain per interface,
not just per interface anymore.
* When a buffer reaches the network layer, it has no known interface yet, ie.
the ipv4|6|whatever modules need to set this manually.
* Added more debug output, and some new debugger commands, the control option
is now printed in clear text.
* Added hash_address() function to the address modules. Added "const" to
set_to_defaults() where needed.
* Fixed net_buffer's restore header functions offset use as reported by Atis.
* Improved buffer dump output, use the domain module to print the address if
available.
* Moved net_buffer::type into the union, as it's not needed by the upper layers
anymore.
* Moved IPv6 specific code from {add|remove}_default_route() to where it
belongs, but disabled it for the time being.
* Completely discarded useless ipv4_datagram module.
* Added ping6 to the build.


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


# a28ad4807585e39458d44d6537c8ea4222d41736 04-Feb-2010 Axel Dörfler <axeld@pinc-software.de>

* Added _SIZEOF_ADDR_IFREQ() macro as existing on FreeBSD.


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


# 09b89797afe0af65822df50011079e16ca8b99b4 01-May-2007 Hugo Santos <hugosantos@nowhere.fake>

added ADDMULTI/REMMULTI support to ipro1000. Also cleaned up the compat. layer a bit to reuse some of the system's definitions.


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


# 1a3ab92b81e510fd07a8233b3dfcb59f8b1ad518 03-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote ether_driver.h, removed some BONE stuff we don't support at this point;
it might also be a good idea to change the constants to better match the usual
style.
* Added a BSD-style if_media.h.
* Added interface flags IFF_LINK, IFF_AUTO_CONFIGURED, and IFF_CONFIGURING. The
former will be set automatically by the stack, the rest will be set by the
net_server depending on the current state.


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


# 5adca30a18617cc25bc50a9a12e2fe6539412ccb 07-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Merge of branches/team/network/new_stack - not yet complete as SVN does only support
replacing files when merging when you don't have deleted them manually (for some reason,
it only works as part of the merge operation, and we didn't copy the whole tree to
have "a fresh start" - next time we know better, at least if SVN still suffers from
that same limitation).


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


# 74a1787535a6fe30bdf7f51a7bc754f2f7a55dd0 12-Jan-2004 Philippe Houdoin <philippe.houdoin@gmail.com>

Remove ether_driver.h API from the should-be-POSIX-only if.h.
Still some sem_id depedency, thought. Will be split into private and posix files soon.


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


# 9af57a10a9b94c9c7d927bd1e3f884d2a40d1e6c 01-Dec-2003 Philippe Houdoin <philippe.houdoin@gmail.com>

Now private sys/socketvar.h header is no more included.
Non-clean hack: include os-specific OS.h to get sem_id and thread_id types defined.
Should clean up this whole file one day, thought.


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


# 345d3d7d0b39a41f57bf6d1f42c63c4539d44238 31-Aug-2003 Waldemar Kornewald <wkornew@nowhere.fake>

Fixed a spelling error.


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


# b5dc136f9a09c3846f870635c4cecad61d0270e4 02-Aug-2003 shatty <shatty@nowhere.fake>

remove OS.h since it is already included through socketvar.h


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


# e803870545c64005bf53339217a04d4fa0ca051a 09-Feb-2003 Philippe Houdoin <philippe.houdoin@gmail.com>

Forgot to commit these... Should fix network stuff build issues.
Add again the load_driver_symbols() export into our KernelExport.h, as it's expected
by many kernel add-ons (drivers, modules)... the network ones, for a start.


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


# 42415555d395fa902b738d6f16313f2097622750 29-Oct-2002 beveloper <beveloper@nowhere.fake>

after many changes, the network stack can now be build


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


# 15750026e07078018f901c7b2d01c6379d544c44 25-Oct-2002 beveloper <beveloper@nowhere.fake>

added C++ header guards


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


# 6bbdd797fa1c03a92ba47ca0818f972dbf14f6d2 12-Jul-2002 David Reid <dreid@nowhere.fake>

Remove the ppp headers until we actually have something that works.
Bring the rest of the files up to date.


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


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


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