I don't think any other solution is likely to be any more efficient.
SLIP encapsulation takes about 20-30 lines of code if I remeber
correctly, and you're going to have to cross the kernel/user
boundary no matter what you do here.
>- the other way round: is there an interface that allows me to get
> every packet in raw form of a single network driver? I know the
> SOCK_PACKET stuff, but there I get every packet of the specified type
> from every interface, and I have to filter the packets myself, and this
> will sure hurt performance if I'm only interested in a slow interface
> whereas other interfaces are very active...
In the 2.0 kernel you can bind the socket to a particular interface so you
only receive packets for the one you are interested in. I do this in the
diald code to avoid getting all the packets for interfaces I don't care about.
-- eric
---------------------------------------------------------------------------
Eric Schenk www: http://www.cs.toronto.edu/~schenk
Department of Computer Science email: schenk@cs.toronto.edu
University of Toronto