def __init__(self, data=0):
    self._data = data
    try:
        if self._data:
            self.rr_name = re.split('\x00', data)[0]
            offset = (len(self.rr_name) + 1)
            self.rr_type = unpack('>H', self._data[offset:(offset + 2)])[0]
            self.rr_class = unpack('>H', self._data[(offset + 2):(offset + 4)])[0]
            self.ttl = unpack('>L', self._data[(offset + 4):(offset + 8)])[0]
            self.rdlength = unpack('>H', self._data[(offset + 8):(offset + 10)])[0]
            self.rdata = self._data[(offset + 10):((offset + 10) + self.rdlength)]
            offset = (self.rdlength - 2)
            self.unit_id = data[offset:(offset + 6)]
        else:
            self.rr_name = ''
            self.rr_type = 0
            self.rr_class = 0
            self.ttl = 0
            self.rdlength = 0
            self.rdata = ''
            self.unit_id = ''
    except Exception:
        raise NetBIOSError('Wrong packet format ')
def __init__(self, data=0):
    self._data = data
    try:
        if self._data:
            self.rr_name = re.split('\x00', data)[0]
            offset = (len(self.rr_name) + 1)
            self.rr_type = unpack('>H', self._data[offset:(offset + 2)])[0]
            self.rr_class = unpack('>H', self._data[(offset + 2):(offset + 4)])[0]
            self.ttl = unpack('>L', self._data[(offset + 4):(offset + 8)])[0]
            self.rdlength = unpack('>H', self._data[(offset + 8):(offset + 10)])[0]
            self.rdata = self._data[(offset + 10):((offset + 10) + self.rdlength)]
            offset = (self.rdlength - 2)
            self.unit_id = data[offset:(offset + 6)]
        else:
            self.rr_name = 
            self.rr_type = 0
            self.rr_class = 0
            self.ttl = 0
            self.rdlength = 0
            self.rdata = 
            self.unit_id = 
    except Exception:
        raise NetBIOSError('Wrong packet format ')