Add function enum.

At a minimum we'll need to support read and write functions. Possibly
we'll also need to implement open_connection to set up the connection.
Move length check to handle_tcp, so we don't do it twice.
Improved parsing.

The IBH header wasn't actually part of the packets we see, that was a
mistake. Instead there's another 'pdu' header (libnodave doesn't name
it), which has a different length depending on its version.

At this point we *should* be getting at the interesting bits
(read/write, response data, DB number, ...)