Use tabs consistently.
Add TLV length checks, fix another length check.
More #defines for CDP lengths and offsets.