fpoirotte / pssht

SSH server written in PHP
https://pssht.readthedocs.io
MIT License
40 stars 9 forks source link

Add support for TUN/TAP forwarding ? #22

Open fpoirotte opened 9 years ago

fpoirotte commented 9 years ago

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).

fpoirotte commented 9 years ago

See also http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL?rev=HEAD for (Open)SSH specific information.