Package dpkt :: Module aoeata
[hide private]
[frames] | no frames]

Source Code for Module dpkt.aoeata

 1  '''ATA over Ethernet ATA command''' 
 2   
 3  import dpkt, aoe 
 4   
 5  ATA_DEVICE_IDENTIFY = 0xec 
 6   
7 -class AOEATA(dpkt.Packet):
8 __hdr__ = ( 9 ('aflags', 'B', 0), 10 ('errfeat', 'B', 0), 11 ('scnt', 'B', 0), 12 ('cmdstat', 'B', ATA_DEVICE_IDENTIFY), 13 ('lba0', 'B', 0), 14 ('lba1', 'B', 0), 15 ('lba2', 'B', 0), 16 ('lba3', 'B', 0), 17 ('lba4', 'B', 0), 18 ('lba5', 'B', 0), 19 ('res', 'H', 0), 20 )
21 22 # XXX: in unpack, switch on ATA command like icmp does on type 23 24 25 if __name__ == '__main__': 26 import unittest 27
28 - class AOEATATestCase(unittest.TestCase):
29 - def test_AOEATA(self):
30 s = '\x03\x0a\x6b\x19\x00\x00\x00\x00\x45\x00\x00\x28\x94\x1f\x00\x00\xe3\x06\x99\xb4\x23\x2b\x24\x00\xde\x8e\x84\x42\xab\xd1\x00\x50\x00\x35\xe1\x29\x20\xd9\x00\x00\x00\x22\x9b\xf0\xe2\x04\x65\x6b' 31 aoeata = AOEATA(s) 32 self.failUnless(str(aoeata) == s)
33 34 unittest.main() 35