Exemple #1
0
 def __bytes__(self):
     return pack('>H', self.preference) + pack_name(self.mx)
Exemple #2
0
 def __bytes__(self):
     return pack_name(self.ns)
Exemple #3
0
 def __bytes__(self):
     resource = self.resource or self.typ
     return (pack_name(self.name) + pack('>H', resource.value) +
         pack('>H', DNS_CLASS[self.cls]))
Exemple #4
0
 def __bytes__(self):
     return (pack_name(self.mname) + pack_name(self.rname) +
             pack('>I', self.serial) + pack('>i', self.refresh) +
             pack('>i', self.retry) + pack('>i', self.expire) +
             pack('>i', self.minimum))
Exemple #5
0
 def test_pack(self):
     self.assertEqual(pack_name('developers.apple.com'),
             b'\ndevelopers\x05apple\x03com\x00')
Exemple #6
0
 def test_empty(self):
     self.assertEqual(pack_name(''), b'\x00')
     self.assertEqual(parse_name(b'\x00', 0)[0], '')
Exemple #7
0
 def __bytes__(self):
     return pack_name(self.ns)
Exemple #8
0
 def __bytes__(self):
     return pack('>H', self.preference) + pack_name(self.mx)
Exemple #9
0
 def __bytes__(self):
     return (pack_name(self.mname) + pack_name(self.rname) +
             pack('>I', self.serial) +  pack('>i', self.refresh) +
             pack('>i', self.retry) + pack('>i', self.expire) +
             pack('>i', self.minimum))
Exemple #10
0
 def test_empty(self):
     self.assertEqual(pack_name(''), b'\x00')
     self.assertEqual(parse_name(b'\x00', 0)[0], '')
Exemple #11
0
 def test_pack(self):
     self.assertEqual(pack_name('developers.apple.com'),
                      b'\ndevelopers\x05apple\x03com\x00')