def METHOD_NAME(self, buf):
    """Unpack packet header fields from buf, and set self.data."""
    for k, v in compat_izip(self.__hdr_fields__,
                            struct.METHOD_NAME(self.__hdr_fmt__, buf[:self.__hdr_len__])):
        setattr(self, k, v)
    self.data = buf[self.__hdr_len__:]