remove a bunch of magic numbers
add parsers for a few more types
switch to a dispatch table (switch) for packet type handling