/* Helper function to analyze a PIMFOR management frame header.  */
static pimfor_header_t* pimfor_decode_header(void *data, int len)
/* Helper function to analyze a PIMFOR management frame header.  */
static pimfor_header_t* pimfor_decode_header(void *data, int len)
{
	pimfor_header_t *h = data;
	while ((void *) h < data + len) {
		if (h->flags & PIMFOR_FLAG_LITTLE_ENDIAN) {
			le32_to_cpus(&h->oid);
			le32_to_cpus(&h->length);
		} else {
			be32_to_cpus(&h->oid);
			be32_to_cpus(&h->length);
		}
		if (h->oid != OID_INL_TUNNEL)
			return h;
		h++;
	}
	return NULL;
}