Ejemplo n.º 1
0
def _simple_add(args):
        fields = {"dpid": datapath, "table_id": args.table_start,
                  "priority": args.priority, "instructions":
                  [{"type": "GOTO_TABLE", "table_id": args.table_end}]}
        if args.cookie:
            fields["cookie"] = args.cookie
        if args.reg1:
            reg1 = int(args.reg1, 0)
            fields["instructions"].append({"type": "APPLY_ACTIONS", "actions":
                                          [{"type": "SET_FIELD", "field":
                                            "reg1", "value": reg1}]})
        add_flowentry(fields)
Ejemplo n.º 2
0
 def _activate_flow_rules(self):
     """ Adds the flows to ovs, REST needs a dpid argument """
     for req in self._requests:
         req["dpid"] = self._datapath
         add_flowentry(req, self._ovs_ip)