1README.BSD 2 3This version of Luke Stras' PPPoE redirector includes support for OpenBSD. 4Support for other BSD variants is possible but requires some porting. 5To compile for BSD, you will need to add "-DUSE_BPF" in the DEFINES= 6string in the Makefile. You will also need to link against kvm library 7(uncomment LIBS=-lkvm in the Makefile). 8 9I am currently running this on a SPARCstation IPX running OpenBSD 2.5. 10I get 50Kbytes/sec maximum throughput but only if I saturate the 11machine with multiple connections to get around packet loss. [Under 12load BPF reports a number of lost packets.] At this point, the CPU 13on the machine is being fully used. For Intel users, the IPX is roughly 14on par with a fast 486 so anyone with a modern machine should be fine. 15 16NOTE: I have not run this on an Intel box yet, so there may be some 17byte-ordering issues [SPARCs use the same endian as network ordering]. 18If you get the error message: 19 20 BPF program is broken 21 22after starting, try recompiling with -DSIMPLE_BPF. If this works, 23let me know - it means I've buggered up the byte-ordering in the 24more complex (and better performing) BPF program. 25 26--- 27 28Look at the "start" script for an example of how to start this up. 29I found the pty-redir program in another package but that package 30did not credit it's author. It is GPL'ed so I have no qualms about 31redistributing it. I've hacked it slightly but otherwise make no 32claims on it. If the author will speak up I'll more than happily 33attribute it. 34 35Other than that, the instructions that came with the original package 36more or less apply. Note that the pppd in OpenBSD 2.5 does not support 37the "pty" option, hence the pty-redir program. 38 39--- 40 41The BSD specific stuff is made up mostly of 2 chunks: 42 431. Berkeley Packet Filter code which handles the reading and writing 44 of raw ethernet packets from and to the network. 45 462. An ugly bit of kvm code to extract the ethernet address of the 47 interface we are interested in. This works on OpenBSD 2.5, may 48 work on other OpenBSD kernels and is unlikely to work anywhere else. 49 If it does work anywhere else or if anyone has any better ideas, 50 please let me know. 51 52Part 1 should work on any BSD variant or any platform supporting BPF. 53Part 2 will require the most porting work. 54 55Changes and comments about the BSD-specific parts are welcome at 56matt@cs.yorku.ca. 57 58Please note: this is not meant to be an elegant solution, just a stopgap 59until something better (i.e. something that doesn't dive in and out 60user-space and copy packets everywhere) can be worked out. 61 62Thanks to Luke for writing the Linux version which made the task of 63getting my gateway back online significantly easier. 64 65Matt Robinson 66Computer Development Manager 67Dept. of Computer Science 68York Univerity 69Toronto, Ontario, Canada 70matt@cs.yorku.ca 71