-*- text -*-
This is lsfcc, a compiler producing Linux Socket Filter instructions
(which are not-so-incidentally identical to Berkeley Packet Filter
instructions, although BPF, being restricted to super-users only, is
somewhat less useful than LSF to the average user) out of a vaguely
C-like toy language.
It's currently in usable, if crude, shape. I've only included packet
formats for tcp, udp, ipv4 and ethernet headers since that's all that
I've tested with. The construction of the header files is fairly
obvious, so feel free to contribute additional ones.
The compiler itself builds as lsfcc1 - since it doesn't have any
kind of IO directives, this makes it of limited use. Therefore, there
is a script called lsfcc included, which runs cpp over the input
source files. The setup is appropriate for gcc's cpp - it removes the
standard C include paths, and adds a path to the installed lsfcc
One thing (amongst many) that it doesn't yet do is autodetect
endianness at build-time and set the appropriate defines. Oh
well. Version 0.1 isn't meant to be easy.