def _writes(): if not offlow.is_action_needed(dpath, cmd): return [] if entry.g_type == pb.GroupMod.MPLS_INTERFACE: return [ ofaction.group(fibcapi.mpls_interface_group_id(entry.g_id)) ] if entry.g_type == pb.GroupMod.MPLS_SWAP: return [ofaction.group(fibcapi.mpls_label_group_id(5, entry.g_id))] if entry.g_type == pb.GroupMod.MPLS_FF: return [ofaction.group(fibcapi.mpls_ff_group_id(entry.g_id))] if entry.g_type == pb.GroupMod.MPLS_ECMP: return [ofaction.group(fibcapi.mpls_ecmp_group_id(entry.g_id))] return []
def _actions(): if not offlow.is_action_needed(dpath, cmd): return [] actions = [] for action in entry.actions: if action.name == pb.VLANFlow.Action.PUSH_VLAN: vlan_vid = action.value | fibcapi.OFPVID_PRESENT actions.append(ofaction.push_vlan(fibcapi.ETHTYPE_VLAN_Q)) actions.append(ofaction.set_field("vlan_vid", vlan_vid)) elif action.name == pb.VLANFlow.Action.SET_VRF: actions.append(ofaction.set_vrf(action.value, use_metadata)) actions.append(ofaction.goto_table(entry.goto_table)) return actions
def _writes(): if not offlow.is_action_needed(dpath, cmd): return [] writes = [ofaction.dec_nw_ttl()] if entry.g_type == pb.GroupMod.L3_UNICAST: writes.append( ofaction.group(fibcapi.l3_unicast_group_id(entry.g_id))) elif entry.g_type == pb.GroupMod.L3_ECMP: writes.append(ofaction.group(fibcapi.l3_ecmp_group_id(entry.g_id))) elif entry.g_type == pb.GroupMod.MPLS_L3_VPN: writes.append( ofaction.group(fibcapi.mpls_label_group_id(2, entry.g_id))) else: pass return writes
def _actions(): if not offlow.is_action_needed(dpath, cmd): return [] actions = [ ofaction.goto_table(entry.goto_table), ofaction.dec_mpls_ttl(), ] if entry.goto_table == pb.FlowMod.MPLS_TYPE: actions.append( ofaction.set_mpls_type(fibcapi.MPLSTYPE_PHP, use_metadata)) for action in entry.actions: if action.name == pb.MPLSFlow.Action.POP_LABEL: actions.append(ofaction.pop_mpls(action.value)) elif action.name == pb.MPLSFlow.Action.SET_VRF: actions.append(ofaction.set_vrf(action.value, use_metadata)) return actions
def _actions(): if not offlow.is_action_needed(dpath, cmd): return [] return [ofaction.output(dpath.ofproto.OFPP_CONTROLLER)]
def _actions(): if not offlow.is_action_needed(dpath, cmd): return [] return [ofaction.goto_table(pb.FlowMod.POLICY_ACL)]
def _actions(): if not offlow.is_action_needed(dpath, cmd): return [] return [ofaction.goto_table(entry.goto_table)]