Skip to content

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant