Add an xdr function for the cbfs_file header

And use it in fit.c and remove one more use of htonl.

Change-Id: Ibf18dcc0a7f08d75c2374115de0db7a4bf64ec1e
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: http://review.coreboot.org/5120
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
diff --git a/util/cbfstool/xdr.c b/util/cbfstool/xdr.c
index d779675..ddc282e 100644
--- a/util/cbfstool/xdr.c
+++ b/util/cbfstool/xdr.c
@@ -25,6 +25,15 @@
 #include <stdint.h>
 #include "common.h"
 
+int bgets(struct buffer *input, void *output, size_t len)
+{
+	len = input->size < len ? input->size : len;
+	memmove(output, input->data, len);
+	input->data += len;
+	input->size -= len;
+	return len;
+}
+
 /* The assumption in all this code is that we're given a pointer to enough data.
  * Hence, we do not check for underflow.
  */