Total Complexity | 1 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
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 |