The goal of this ticket is to see if it would be possible to add support for TUN/TAP forwarding without too much of a hassle.
An example (written in C) of TUN/TAP allocation can be seen in https://www.kernel.org/doc/Documentation/networking/tuntap.txt.
Opening a file descriptor for TUN/TAP is trivial, but we also need a way to call ioctl(fd, TUNSETIFF, ...) from PHP code. I see two ways to achieve that:
Write a wrapper in another language (eg. Python, using the ctypes module)
Write a PHP extension that adds the necessary functions
The former is probably easier. The latter would require manual handling of C structures and alignment issues. It could also be seen as a port of Python's ctypes module to PHP (which, while interesting in itself, is outside the scope of this project).
The goal of this ticket is to see if it would be possible to add support for TUN/TAP forwarding without too much of a hassle. An example (written in C) of TUN/TAP allocation can be seen in https://www.kernel.org/doc/Documentation/networking/tuntap.txt.
Opening a file descriptor for TUN/TAP is trivial, but we also need a way to call
ioctl(fd, TUNSETIFF, ...)
from PHP code. I see two ways to achieve that:The former is probably easier. The latter would require manual handling of C structures and alignment issues. It could also be seen as a port of Python's ctypes module to PHP (which, while interesting in itself, is outside the scope of this project).