def unmarshall_buffer(buf)
buf = buf.dup
if buf[0] == ?l
endianness = LIL_END
else
endianness = BIG_END
end
pu = PacketUnmarshaller.new(buf, endianness)
mdata = pu.unmarshall(MESSAGE_SIGNATURE)
dummy, @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 and @signature
@params = pu.unmarshall(@signature, @body_length)
end
[self, pu.idx]
end