Passed
Pull Request — master (#370)
by macartur
02:27
created

GetAsyncReply   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 36
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __init__() 0 30 1
1
"""Define GetAsyncReply message.
2
3
Response to the GetAsyncRequest message.
4
"""
5
6
# System imports
7
8
# Third-party imports
9
10
# Local imports
11 1
from pyof.v0x04.common.header import Type
12 1
from pyof.v0x04.controller2switch.common import AsyncConfig
13
14 1
__all__ = ('GetAsyncReply',)
15
16
17 1
class GetAsyncReply(AsyncConfig):
18
    """GetAsyncReply message.
19
20
    Response to GetAsyncRequest message.
21
    """
22
23 1
    def __init__(self, xid=None, packet_in_mask1=None, packet_in_mask2=None,
24
                 port_status_mask1=None, port_status_mask2=None,
25
                 flow_removed_mask1=None, flow_removed_mask2=None):
26
        """Set attributes for GetAsyncReply message.
27
28
        Args:
29
            xid (int): xid to be used on the message header.
30
            packet_in_mask1
31
                (~pyof.v0x04.asynchronous.packet_in.PacketInReason):
32
                    A instance of PacketInReason
33
            packet_in_mask2
34
                (~pyof.v0x04.asynchronous.packet_in.PacketInReason):
35
                    A instance of PacketInReason
36
            port_status_mask1
37 1
                (~pyof.v0x04.asynchronous.port_status.PortReason):
38
                    A instance of PortReason
39
            port_status_mask2
40 1
                (~pyof.v0x04.asynchronous.port_status.PortReason):
41
                    A instance of PortReason
42
            flow_removed_mask1
43
                (~pyof.v0x04.asynchronous.flow_removed.FlowRemoved):
44
                    A instance of FlowRemoved.
45
            flow_removed_mask2
46
                (~pyof.v0x04.asynchronous.flow_removed.FlowRemoved):
47
                    A instance of FlowRemoved.
48
        """
49
        super().__init__(xid, packet_in_mask1, packet_in_mask2,
50
                         port_status_mask1, port_status_mask2,
51
                         flow_removed_mask1, flow_removed_mask2)
52
        self.header.message_type = Type.OFPT_GET_ASYNC_REPLY
53