Passed
Pull Request — master (#577)
by Gleyberson
02:14
created

pyof.v0x04.controller2switch.set_config   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 31
rs 10
c 0
b 0
f 0
ccs 8
cts 8
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A SetConfig.__init__() 0 13 1
1
"""Define SetConfig message."""
2
3
# System imports
4
5
# Third-party imports
6
7
# Local imports
8 1
from pyof.v0x04.common.action import ControllerMaxLen
9 1
from pyof.v0x04.common.header import Type
10 1
from pyof.v0x04.controller2switch.common import ConfigFlag, SwitchConfig
11
12 1
__all__ = ('SetConfig',)
13
14
15 1
class SetConfig(SwitchConfig):
16
    """Set config message."""
17
18 1
    def __init__(self, xid=None, flags=ConfigFlag.OFPC_FRAG_NORMAL,
19
                 miss_send_len=ControllerMaxLen.OFPCML_NO_BUFFER):
20
        """Create a SetConfig with the optional parameters below.
21
22
        Args:
23
            xid (int): xid to be used on the message header.
24
            flags (:class:`~pyof.v0x01.controller2switch.common.ConfigFlag`):
25
                OFPC_* flags.
26
            miss_send_len (int): UBInt16 max bytes of new flow that the
27
                datapath should send to the controller.
28
        """
29 1
        super().__init__(xid, flags, miss_send_len)
30
        self.header.message_type = Type.OFPT_SET_CONFIG
31