Passed
Push — master ( b085fb...082312 )
by Humberto
03:44
created

pyof.v0x01.symmetric.vendor_header   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 13
dl 0
loc 39
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A VendorHeader.__init__() 0 13 1
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