libqmi: Make qmimsg_tlv_get expect exact length.

Since the most common case is that we know the exact size of a TLV we are
retrieving, and the message is invalid if the length is shorter, make
qmimsg_tlv_get take the exact size and return -EINVAL if the TLV found in
the message has a different length.

Add qmimsg_tlv_get_varlen that still takes a pointer to the length and
replaces it with the actual length of the TLV, or returns -ENOSPC if the
provided buffer was too *short*.

TEST=my (as yet unpublished) test program still works

Change-Id: I98bbfefd41d4fd2f61c8c448a55db4e7ba87d11b
3 files changed
tree: 3666e6779beaaa1a9d536f783afdc19697085f4a
  2. Makefile
  4. include/
  5. src/