astlpc: Introduce protocol v3 with integrity checks

v3 of the binding adds a CRC-32 value as a medium-specific trailer to
each packet passing over the binding interface.

The patch includes a naive bit-shift implementation of CRC-32, we can
improve it later as necessary.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I93a95bccef30010d56e10e29b6d84554268ab7af
diff --git a/core.c b/core.c
index 19202e8..2ec9046 100644
--- a/core.c
+++ b/core.c
@@ -156,6 +156,15 @@
 	return 0;
 }
 
+void *mctp_pktbuf_pop(struct mctp_pktbuf *pkt, size_t len)
+{
+	if (len > mctp_pktbuf_size(pkt))
+		return NULL;
+
+	pkt->end -= len;
+	return pkt->data + pkt->end;
+}
+
 /* Message reassembly */
 static struct mctp_msg_ctx *mctp_msg_ctx_lookup(struct mctp *mctp,
 		uint8_t src, uint8_t dest, uint8_t tag)