pyof.v0x04.symmetric.echo_reply   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A EchoReply.__init__() 0 9 1
1
"""Defines Echo Reply message during the handshake."""
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
9 1
from pyof.v0x04.common.header import Header, Type
10
11 1
__all__ = ('EchoReply',)
12
13
# Classes
14
15
16 1
class EchoReply(GenericMessage):
17
    """OpenFlow Reply message.
18
19
    This message does not contain a body beyond the OpenFlow Header.
20
    """
21
22 1
    header = Header(message_type=Type.OFPT_ECHO_REPLY, length=8)
23 1
    data = BinaryData()
24
25 1
    def __init__(self, xid=None, data=b''):
26
        """Create a EchoReply with the optional parameters below.
27
28
        Args:
29
            xid (int): xid to be used on the message header.
30
            data (bytes): arbitrary-length data field.
31
        """
32 1
        super().__init__(xid)
33
        self.data = data
34