util/Zeroconf.py
changeset 1758 845ca626db09
parent 1756 08e4394ff4fb
child 1762 fcc406143e5b
equal deleted inserted replaced
1757:0de89da92ee0 1758:845ca626db09
   148 _TYPE_MINFO = 14
   148 _TYPE_MINFO = 14
   149 _TYPE_MX = 15
   149 _TYPE_MX = 15
   150 _TYPE_TXT = 16
   150 _TYPE_TXT = 16
   151 _TYPE_AAAA = 28
   151 _TYPE_AAAA = 28
   152 _TYPE_SRV = 33
   152 _TYPE_SRV = 33
   153 _TYPE_ANY =  255
   153 _TYPE_ANY = 255
   154 
   154 
   155 # Mapping constants to names
   155 # Mapping constants to names
   156 
   156 
   157 _CLASSES = {
   157 _CLASSES = {
   158     _CLASS_IN:   "in",
   158     _CLASS_IN:   "in",
   528         return self.readString(length)
   528         return self.readString(length)
   529 
   529 
   530     def readString(self, len):
   530     def readString(self, len):
   531         """Reads a string of a given length from the packet"""
   531         """Reads a string of a given length from the packet"""
   532         format = '!' + str(len) + 's'
   532         format = '!' + str(len) + 's'
   533         length =  struct.calcsize(format)
   533         length = struct.calcsize(format)
   534         info = struct.unpack(format, self.data[self.offset:self.offset+length])
   534         info = struct.unpack(format, self.data[self.offset:self.offset+length])
   535         self.offset += length
   535         self.offset += length
   536         return info[0]
   536         return info[0]
   537 
   537 
   538     def readUnsignedShort(self):
   538     def readUnsignedShort(self):