Neale Ranns | c0a9314 | 2018-09-05 15:42:26 -0700 | [diff] [blame^] | 1 | """ |
2 | MAC Types | ||||
3 | |||||
4 | """ | ||||
5 | |||||
6 | from util import mactobinary | ||||
7 | |||||
8 | |||||
9 | class VppMacAddress(): | ||||
10 | def __init__(self, addr): | ||||
11 | self.address = addr | ||||
12 | |||||
13 | def encode(self): | ||||
14 | return { | ||||
15 | 'bytes': self.bytes | ||||
16 | } | ||||
17 | |||||
18 | @property | ||||
19 | def bytes(self): | ||||
20 | return mactobinary(self.address) | ||||
21 | |||||
22 | @property | ||||
23 | def address(self): | ||||
24 | return self.addr.address |