This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Diego Rabatone Oliveira
committed
Sep 6, 2016
1 parent
b047f9a
commit 4220f6f
Showing
2 changed files
with
49 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.