def unmarshall_buffer(buf)
      buf = buf.dup
      endianness = if buf[0] == "l"
                     LIL_END
                   else
                     BIG_END
                   end
      pu = PacketUnmarshaller.new(buf, endianness)
      mdata = pu.unmarshall(MESSAGE_SIGNATURE)
      _, @message_type, @flags, @protocol, @body_length, @serial,
        headers = mdata

      headers.each do |struct|
        case struct[0]
        when PATH
          @path = struct[1]
        when INTERFACE
          @interface = struct[1]
        when MEMBER
          @member = struct[1]
        when ERROR_NAME
          @error_name = struct[1]
        when REPLY_SERIAL
          @reply_serial = struct[1]
        when DESTINATION
          @destination = struct[1]
        when SENDER
          @sender = struct[1]
        when SIGNATURE
          @signature = struct[1]
        end
      end
      pu.align(8)
      if @body_length > 0 && @signature
        @params = pu.unmarshall(@signature, @body_length)
      end
      [self, pu.idx]
    end
def unmarshall_buffer(buf)
      buf = buf.dup
      endianness = if buf[0] == "l"
                     LIL_END
                   else
                     BIG_END
                   end
      pu = PacketUnmarshaller.new(buf, endianness)
      mdata = pu.unmarshall(MESSAGE_SIGNATURE)
      _, @message_type, @flags, @protocol, @body_length, @serial,
        headers = mdata

      headers.each do |struct|
        case struct[0]
        when PATH
          @path = struct[1]
        when INTERFACE
          @interface = struct[1]
        when MEMBER
          @member = struct[1]
        when ERROR_NAME
          @error_name = struct[1]
        when REPLY_SERIAL
          @reply_serial = struct[1]
        when DESTINATION
          @destination = struct[1]
        when SENDER
          @sender = struct[1]
        when SIGNATURE
          @signature = struct[1]
        end
      end
      pu.align(8)
      if @body_length > 0 && @signature
        @params = pu.unmarshall(@signature, @body_length)
      end
      [self, pu.idx]
    end
Unmarshall a packet contained in the buffer _buf_ and set the
 parameters of the message object according the data found in the
 buffer.
 @return [Array(Message,Integer)]
   the detected message (self) and
   the index pointer of the buffer where the message data ended.