Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.pyo
*.egg-info
*.idea
8 changes: 5 additions & 3 deletions riplpox/riplpox.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
PRIO_HYBRID_FLOW_UP = 500
PRIO_HYBRID_VLAN_UP = 10

NO_BUFFER = 4294967295

# Borrowed from pox/forwarding/l2_multi
class Switch (EventMixin):
Expand Down Expand Up @@ -72,13 +73,13 @@ def send_packet_data(self, outport, data = None):
msg.actions.append(of.ofp_action_output(port = outport))
self.connection.send(msg)

def send_packet_bufid(self, outport, buffer_id = -1):
def send_packet_bufid(self, outport, buffer_id = NO_BUFFER):
msg = of.ofp_packet_out(in_port=of.OFPP_NONE)
msg.actions.append(of.ofp_action_output(port = outport))
msg.buffer_id = buffer_id
self.connection.send(msg)

def install(self, port, match, buf = -1, idle_timeout = 0, hard_timeout = 0,
def install(self, port, match, buf = NO_BUFFER, idle_timeout = 0, hard_timeout = 0,
priority = of.OFP_DEFAULT_PRIORITY):
msg = of.ofp_flow_mod()
msg.match = match
Expand All @@ -89,7 +90,7 @@ def install(self, port, match, buf = -1, idle_timeout = 0, hard_timeout = 0,
msg.buffer_id = buf
self.connection.send(msg)

def install_multiple(self, actions, match, buf = -1, idle_timeout = 0,
def install_multiple(self, actions, match, buf = NO_BUFFER, idle_timeout = 0,
hard_timeout = 0, priority = of.OFP_DEFAULT_PRIORITY):
msg = of.ofp_flow_mod()
msg.match = match
Expand Down Expand Up @@ -213,6 +214,7 @@ def _flood(self, event):
ports.append(sw_port)
# Send packet out each non-input host port
# TODO: send one packet only.
# self.switches[sw].send_packet_data(outport=0xfffb)
for port in ports:
#log.info("sending to port %s on switch %s" % (port, sw))
#buffer_id = event.ofp.buffer_id
Expand Down