Skip to content
New issue

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

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

Already on GitHub? # to your account

Update simple_switch_13.py #148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

c1x1x00xxPentium
Copy link

Dear Community,
I made a few changes to make it easier to understand the value of the variable 'mac_to_port' and also provide an example of how to custom OFPFlowMod.

self.logger.info(json.dumps(self.mac_to_port, sort_keys=True, indent=4))

def add_flow(self, datapath, priority, tableID=0, idle=0, hard=0, match, actions, buffer_id=None):
      ofproto = datapath.ofproto
      parser = datapath.ofproto_parser
      
      if buffer_id:
          mod = parser.OFPFlowMod(datapath=datapath, buffer_id=buffer_id,
                                  priority=priority, match=match,
                                  idle_timeout=idle, hard_timeout=hard,
                                  instructions=inst, table_id=tableID)
      else:
          mod = parser.OFPFlowMod(datapath=datapath, priority=priority,
                                  idle_timeout=idle, hard_timeout=hard,
                                  match=match, instructions=inst
                                  table_id=tableID)
      datapath.send_msg(mod)

Thank you

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant