The answer is you need the contexts pointed to by the pointer. i.e. Datagram.from_buffer(data_pointer.contents)