def actionInstallMicroflow(packet, replica): Globals.INSTALLLOG.write("***Microflow " + ip_to_str(packet.next.srcip) + " to replica " + str(replica) + '\n') for i in range(0, Globals.NUMREPLICAS): if Globals.REPLICAS[i]['no'] == replica: (flow, defaultActions, rewriteActions) = IPs.get_microflow_dstrule( packet, Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'], replica) Multipath.install_replica_flow(flow, Globals.SOFT_TIMEOUT, openflow.OFP_FLOW_PERMANENT, defaultActions, None, openflow.OFP_DEFAULT_PRIORITY + 10, 0, None, replica, rewriteActions)
def actionInstallRule(rule): Globals.INSTALLLOG.write("***Installing Rule: " + str(rule) + '\n') for i in range(0, Globals.NUMREPLICAS): if Globals.REPLICAS[i]['no'] == rule['replica']: (flow, defaultActions, rewriteActions) = IPs.get_forwarding_dstrule( ipstr_to_int(rule['ip']), rule['wild'], Globals.VIP, Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'], Globals.REPLICAS[i]['port']) Multipath.install_replica_flow(flow, openflow.OFP_FLOW_PERMANENT, openflow.OFP_FLOW_PERMANENT, defaultActions, None, openflow.OFP_DEFAULT_PRIORITY, 0, None, rule['replica'], rewriteActions)
def actionInstallRule(rule): Globals.INSTALLLOG.write("***Installing Rule: " + str(rule) + '\n') for i in range(0, Globals.NUMREPLICAS): if Globals.REPLICAS[i]['no'] == rule['replica']: (flow, defaultActions, rewriteActions) = IPs.get_forwarding_dstrule(ipstr_to_int(rule['ip']), rule['wild'], Globals.VIP, Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'], Globals.REPLICAS[i]['port']) Multipath.install_replica_flow(flow, openflow.OFP_FLOW_PERMANENT, openflow.OFP_FLOW_PERMANENT, defaultActions, None, openflow.OFP_DEFAULT_PRIORITY, 0, None, rule['replica'], rewriteActions)
def actionInstallMicroflow(packet, replica): Globals.INSTALLLOG.write("***Microflow " + ip_to_str(packet.next.srcip) + " to replica " + str(replica) + '\n') for i in range(0, Globals.NUMREPLICAS): if Globals.REPLICAS[i]['no'] == replica: (flow, defaultActions, rewriteActions) = IPs.get_microflow_dstrule(packet, Globals.REPLICAS[i]['mac'], Globals.REPLICAS[i]['ip'], replica) Multipath.install_replica_flow(flow, Globals.SOFT_TIMEOUT, openflow.OFP_FLOW_PERMANENT, defaultActions, None, openflow.OFP_DEFAULT_PRIORITY + 10, 0, None, replica, rewriteActions)