File: set_async.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 (48 lines) | stat: -rw-r--r-- 1,693 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
39
40
41
42
43
44
45
46
47
48
"""Define SetAsync message.

Sets whether a controller should receive a given asynchronous message that is
generated by the switch.
"""

# System imports

# Third-party imports

# Local imports
from pyof.v0x04.common.header import Type
from pyof.v0x04.controller2switch.common import AsyncConfig

__all__ = ('SetAsync',)


class SetAsync(AsyncConfig):
    """SetAsync message.

    Sets whether a controller should receive a given asynchronous message that
    is generated by the switch.
    """

    def __init__(self, xid=None, packet_in_mask1=None, packet_in_mask2=None,
                 port_status_mask1=None, port_status_mask2=None,
                 flow_removed_mask1=None, flow_removed_mask2=None):
        """Set attributes for SetAsync message.

        Args:
            xid (int): xid to be used on the message header.
            packet_in_mask1 (|PacketInReason_v0x04|):
                    A instance of PacketInReason
            packet_in_mask2 (|PacketInReason_v0x04|):
                    A instance of PacketInReason
            port_status_mask1 (|PortReason_v0x04|):
                    A instance of PortReason
            port_status_mask2 (|PortReason_v0x04|):
                    A instance of PortReason
            flow_removed_mask1 (|FlowRemoved_v0x04|):
                    A instance of FlowRemoved.
            flow_removed_mask2 (|FlowRemoved_v0x04|):
                    A instance of FlowRemoved.
        """
        super().__init__(xid, packet_in_mask1, packet_in_mask2,
                         port_status_mask1, port_status_mask2,
                         flow_removed_mask1, flow_removed_mask2)
        self.header.message_type = Type.OFPT_SET_ASYNC