Total Complexity | 1 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | """Defines Vendor message.""" |
||
2 | |||
3 | # System imports |
||
4 | |||
5 | # Third-party imports |
||
6 | |||
7 | 1 | from pyof.foundation.base import GenericMessage |
|
8 | 1 | from pyof.foundation.basic_types import BinaryData, UBInt32 |
|
9 | 1 | from pyof.v0x01.common.header import Header, Type |
|
10 | |||
11 | 1 | __all__ = ('VendorHeader',) |
|
12 | |||
13 | # Classes |
||
14 | |||
15 | |||
16 | 1 | class VendorHeader(GenericMessage): |
|
17 | """OpenFlow Vendor message. |
||
18 | |||
19 | This message does not contain a body beyond the OpenFlow Header. |
||
20 | """ |
||
21 | |||
22 | 1 | header = Header(message_type=Type.OFPT_VENDOR) |
|
23 | 1 | vendor = UBInt32() |
|
24 | 1 | data = BinaryData() |
|
25 | |||
26 | 1 | def __init__(self, xid=None, vendor=None, data=None): |
|
27 | """Create a VendorHeader with the options parameters below. |
||
28 | |||
29 | Args: |
||
30 | xid (int): xid to be used on the message header. |
||
31 | vendor (int): Vendor ID: |
||
32 | MSB 0: low-order bytes are IEEE OUI. |
||
33 | MSB != 0: defined by OpenFlow consortium. |
||
34 | data (BinaryData): Vendor-defined arbitrary additional data. |
||
35 | """ |
||
36 | 1 | super().__init__(xid) |
|
37 | 1 | self.vendor = vendor |
|
38 | self.data = data |
||
39 |