This function copies data items from data buffer databuf
beginning at offset to the location val. In addition, it returns
the offset for the next data field to assist you in extracting
option content that has multiple fields.
Make sure that each field is aligned on its natural boundaries.