Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
[v0x04] Experimenter Message
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rabatone Oliveira committed Sep 6, 2016
1 parent b047f9a commit 4220f6f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 35 deletions.
49 changes: 49 additions & 0 deletions pyof/v0x04/symmetric/experimenter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"""Defines Experimenter message."""

# System imports

# Third-party imports

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

__all__ = ('ExperimenterHeader',)

# Classes


class ExperimenterHeader(GenericMessage):
"""OpenFlow Experimenter message.
The experimenter field is a 32-bit value that uniquely identifies the
experimenter. If the most significant byte is zero, the next three bytes
are the experimenter’s IEEE OUI. If the most significant byte is not zero,
it is a value allocated by the Open Networking Foundation. If experimenter
does not have (or wish to use) their OUI, they should contact the Open
Networking Foundation to obtain a unique experimenter ID.
The rest of the body is uninterpreted by standard OpenFlow processing and
is arbitrarily defined by the corresponding experimenter.
If a switch does not understand a experimenter extension, it must send an
OFPT_ERROR message with a OFPBRC_BAD_EXPERIMENTER error code and
OFPET_BAD_REQUEST error type.
"""

header = Header(message_type=Type.OFPT_EXPERIMENTER)
experimenter = UBInt32()
exp_type = UBInt32()

def __init__(self, xid=None, experimenter=None, exp_type=None):
"""The constructor takes the parameters below.
Args:
xid (int): xid to be used on the message header.
experimenter (int): Vendor ID:
MSB 0: low-order bytes are IEEE OUI.
MSB != 0: defined by ONF.
exp_type (int): Experimenter defined.
"""
super().__init__(xid)
self.vendor = vendor
35 changes: 0 additions & 35 deletions pyof/v0x04/symmetric/vendor_header.py

This file was deleted.

0 comments on commit 4220f6f

Please sign in to comment.