Sat Oct 28 09:38:00 EDT 2006
a smarter parser? it's terribly convenient to be able to write out raw
packets. it might introduce endianness problems etc, but currently
there's no way to quick hack saving a CA for example. so it needs to
what's needed to support this is an escape code for the parser.
previously this was just symbolic PF code which would enable a file to
be 'load'ed instead of 'read'. that's not enough. it's more flexible,
yes, but really not safe and it doesn't work for packets in lists. if
you want something like that, it's still easily coded in PF.
so, what's going to be the escape character? something that's not used
yet. plenty of room since PF takes only a subset of ASCII atm. NUL is
a good candidate, since the stream will contain binary data anyway,
NUL won't be so special. another possibility is EOF.
interference? need to check later.
something which i should have done a long while ago is to make stream
parsing a vm method, and not a stream method. this mainly allows for
better error handling.
things to fix:
* interrupted system call error message
* check read/write for chunks length etc..
* check if fread can return short
* check all blocking points