aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/networking/tun_device.c
Commit message (Collapse)AuthorAgeFilesLines
* tun-device: Use next free TUN device on FreeBSDTobias Brunner2017-05-191-3/+18
| | | | | | | | | | | While this API is documented as legacy (and there is a sysctl option to disable it) the documentation also mentions that it will probably stay enabled by default due to compatibility issues with existing applications. With the previous approach only 255 devices could be opened then the daemon had to be restarted. Fixes #2313.
* tun-device: TUN devices are not supported on iOSTobias Brunner2017-05-191-1/+10
|
* Use standard unsigned integer typesAndreas Steffen2016-03-241-8/+8
|
* tun-device: Read from tun to buffer on stack to avoid over-allocation of packetsMartin Willi2014-11-211-8/+6
| | | | | | | Instead of allocating MTU-sized buffers for each packet, read to a stack buffer and copy to an allocation of the actual packet size. While it requires an additional copy on non-Apple platforms, this should make allocation more efficient for small packets.
* tun-device: Remove the superfluous use of select() before read()Martin Willi2014-11-211-16/+5
|
* tun-device: Rearrange headers to build properly when tun devices not supportedMartin Willi2014-06-031-19/+13
|
* tun-device: Use SIOCAIFADDR to set IP address on FreeBSD 10Tobias Brunner2014-04-251-2/+90
| | | | | | | | FreeBSD 10 deprecated the SIOCSIFADDR etc. commands, so we use this newer command to set the address and netmask. A destination address is now also required. Fixes #566.
* tun-device: Include system headers before our ownTobias Brunner2013-12-201-2/+5
| | | | | | | | | | | | | On CentOS 6.5 the sys/capability.h header file defines _LINUX_TYPES_H without actually including that header, preventing its later inclusion here. As library.h (via which the capabilities headers are included) is not actually required in tun_device.[ch], moving the inclusion of tun_device.h would not strictly be necessary. But it's probably a good idea to include our own headers after system headers anyway, for if one of the recursively included files at a later point includes library.h we'd have the same problem again.
* tun-device: Include <linux/types.h> before <linux/if_tun.h>Martin Willi2013-11-221-0/+1
| | | | Fixes a build error on CentOS 6.4.
* tun_device: Add warning if TUN devices are not supported by platformTobias Brunner2013-09-121-2/+16
|
* tun-device: Packets sent over utun devices on Mac OS X have the protocol ↵Tobias Brunner2013-06-211-0/+11
| | | | family prepended
* tun-device: Avoid opening /dev/tunX multiple times (e.g. on FreeBSD)Tobias Brunner2013-06-211-2/+6
|
* tun_device: add a getter for the address previously passed to set_address()Martin Willi2013-05-061-0/+24
|
* tun_device: add a getter for the underlying file descriptorMartin Willi2013-05-061-0/+7
|
* tun-device: use host_create_netmask() to calculate interface netmaskMartin Willi2013-05-061-49/+12
|
* Set sockaddr family on ifreq instead of casted familiy specific sockaddrMartin Willi2013-02-061-2/+2
| | | | Fixes a strict-aliasing rule compiler warning with older gcc.
* Moved debug.[ch] to utils folderTobias Brunner2012-10-241-1/+1
|
* Moved packet_t and tun_device_t to networking folderTobias Brunner2012-10-241-0/+461