File: vendor_header.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,037 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
"""Defines Vendor message."""

# System imports

# Third-party imports

from pyof.foundation.base import GenericMessage
from pyof.foundation.basic_types import BinaryData, UBInt32
from pyof.v0x01.common.header import Header, Type

__all__ = ('VendorHeader',)

# Classes


class VendorHeader(GenericMessage):
    """OpenFlow Vendor message.

    This message does not contain a body beyond the OpenFlow Header.
    """

    header = Header(message_type=Type.OFPT_VENDOR)
    vendor = UBInt32()
    data = BinaryData()

    def __init__(self, xid=None, vendor=None, data=None):
        """Create a VendorHeader with the options parameters below.

        Args:
            xid (int): xid to be used on the message header.
            vendor (int): Vendor ID:
                MSB 0: low-order bytes are IEEE OUI.
                MSB != 0: defined by OpenFlow consortium.
            data (BinaryData): Vendor-defined arbitrary additional data.
        """
        super().__init__(xid)
        self.vendor = vendor
        self.data = data