pyof.v0x04.controller2switch.queue_get_config_request   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A QueueGetConfigRequest.__init__() 0 9 1
1
"""Query the switch for configured queues on a port."""
2
3
# System imports
4
5
# Third-party imports
6
7
# Local source tree imports
8 1
from pyof.foundation.base import GenericMessage
9 1
from pyof.foundation.basic_types import Pad, UBInt32
10 1
from pyof.v0x04.common.header import Header, Type
11 1
from pyof.v0x04.common.port import PortNo
12
13 1
__all__ = ('QueueGetConfigRequest',)
14
15
16 1
class QueueGetConfigRequest(GenericMessage):
17
    """Query structure for configured queues on a port."""
18
19
    #: Openflow :class:`~pyof.v0x04.common.header.Header`.
20 1
    header = Header(message_type=Type.OFPT_GET_CONFIG_REQUEST)
21
    #: Port to be queried. Should refer to a valid physical port
22
    #: (i.e. < OFPP_MAX), or OFPP_ANY to request all configured queues.
23 1
    port = UBInt32(enum_ref=PortNo)
24 1
    pad = Pad(4)
25
26 1
    def __init__(self, xid=None, port=None):
27
        """Create a QueueGetConfigRequest with the optional parameters below.
28
29
        Args:
30
            xid (int): xid of OpenFlow header
31
            port (:class:`~.common.port.PortNo`): Target port for the query.
32
        """
33 1
        super().__init__(xid)
34
        self.port = port
35