Add L2capPacketForwarder
L2capPacketForwarder forwards packets between an L2CAP BluetoothSocket
and a tun fd.
It uses blocking i/o to do so, since the BluetoothSocket API does not
expose a file descriptor to poll() on.
It remains to be seen whether shutdown() on a tun interface fd is
actually implemented. Currently, the test uses a pair of SOCK_SEQPACKET
sockets which require to be shutdown to interrupt the blocking read.
Test: L2capPacketForwarderTest
Change-Id: I03d2a2dd76ec2b71fdb9e3ea7008daa6d1d124fe
3 files changed