Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openflow: Add Vendor event #146

Open
wants to merge 1 commit into
base: eel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pox/openflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,18 @@ def reassemble_fragments (self):
return (self.ofp.flags & of.OFPC_FRAG_MASK) == of.OFPC_FRAG_REASM


class Vendor (Event):
"""
Raised upon receipt of an OFPT_VENDOR message
"""
def __init__ (self, connection, ofp):
self.connection = connection
self.ofp = ofp
self.dpid = connection.dpid
self.xid = ofp.xid
self.vendor = ofp.vendor


class OpenFlowConnectionArbiter (EventMixin):
"""
Determines which OpenFlowNexus gets the switch.
Expand Down Expand Up @@ -351,6 +363,7 @@ class OpenFlowNexus (EventMixin):
QueueStatsReceived,
FlowRemoved,
ConfigurationReceived,
Vendor,
])

# Bytes to send to controller when a packet misses all flows
Expand Down
4 changes: 4 additions & 0 deletions pox/openflow/of_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ def handle_BARRIER_REPLY (con, msg):
@staticmethod
def handle_VENDOR (con, msg):
log.info("Vendor msg: " + str(msg))
e = con.ofnexus.raiseEventNoErrors(Vendor, con, msg)
if e is None or e.halt != True:
con.raiseEventNoErrors(Vendor, con, msg)

@staticmethod
def handle_HELLO (con, msg): #S
Expand Down Expand Up @@ -711,6 +714,7 @@ class Connection (EventMixin):
FlowRemoved,
FeaturesReceived,
ConfigurationReceived,
Vendor,
])

# Globally unique identifier for the Connection instance
Expand Down