1
2 """ATA over Ethernet ATA command"""
3 from __future__ import print_function
4 from __future__ import absolute_import
5
6 from . import dpkt
7
8
10 """ATA over Ethernet ATA command.
11
12 See more about the AOE on \
13 https://en.wikipedia.org/wiki/ATA_over_Ethernet
14
15 Attributes:
16 __hdr__: Header fields of AOECFG.
17 data: Message data.
18 """
19
20 __hdr__ = (
21 ('bufcnt', 'H', 0),
22 ('fwver', 'H', 0),
23 ('scnt', 'B', 0),
24 ('aoeccmd', 'B', 0),
25 ('cslen', 'H', 0),
26 )
27
28
30 s = b'\x01\x02\x03\x04\x05\x06\x11\x12\x13\x14\x15\x16\x88\xa2\x10\x00\x00\x01\x02\x01\x80\x00\x00\x00\x12\x34\x00\x00\x00\x00\x04\x00' + b'\0xed' * 1024
31 aoecfg = AOECFG(s[14 + 10:])
32 assert (aoecfg.bufcnt == 0x1234)
33
34
35 if __name__ == '__main__':
36 test_aoecfg()
37 print('Tests Successful...')
38