Re: network drivers and user interface

Eric Schenk (schenk@cs.toronto.edu)
Fri, 14 Jun 1996 13:34:16 -0400


Thomas Sailer <sailer@ife.ee.ethz.ch> writes:
>- network device drivers in userland: is there a better way to feed
> packets into/out of the kernel to a userland network driver than
> converting the packets to SLIP and feeding them into a pty?
> I have some DSP boards which could be used as ham radio modems easily
> with a driver in userland...

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