File: queue_get_config_reply.py

package info (click to toggle)
python-openflow 2021.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,224 kB
  • sloc: python: 6,906; sh: 4; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,181 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Switch replies to controller."""

# System imports

# Third-party imports

from pyof.foundation.base import GenericMessage
from pyof.foundation.basic_types import Pad, UBInt16
# Local source tree imports
from pyof.v0x01.common.header import Header, Type
from pyof.v0x01.common.phy_port import Port
from pyof.v0x01.common.queue import ListOfQueues

__all__ = ('QueueGetConfigReply',)


class QueueGetConfigReply(GenericMessage):
    """Class implements the response to the config request."""

    header = Header(message_type=Type.OFPT_QUEUE_GET_CONFIG_REPLY)
    port = UBInt16(enum_ref=Port)
    #: Pad to 64-bits.
    pad = Pad(6)
    queues = ListOfQueues()

    def __init__(self, xid=None, port=None, queues=None):
        """Create a QueueGetConfigReply with the optional parameters below.

        Args:
            xid (int): xid of OpenFlow header.
            port (~pyof.v0x01.common.phy_port.Port):
                Target port for the query.
            queue (~pyof.v0x01.common.queue.ListOfQueues):
                List of configured queues.
        """
        super().__init__(xid)
        self.port = port
        self.queues = [] if queues is None else queues