Esempio n. 1
0
    def _buckets():
        if not ofgroup.is_bucket_needed(dpath, cmd):
            return []

        next_gid = fibcapi.l2_interface_group_id(entry.port_id, entry.vlan_vid)
        vlan_vid = fibcapi.adjust_vlan_vid(
            entry.vlan_vid) | fibcapi.OFPVID_PRESENT
        actions = [
            ofaction.set_field("eth_src", entry.eth_src),
            ofaction.set_field("eth_dst", entry.eth_dst),
            ofaction.set_field("vlan_vid", vlan_vid),
            ofaction.group(next_gid),
        ]
        return [dict(actions=actions)]
Esempio n. 2
0
    def _buckets():
        if not ofgroup.is_bucket_needed(dpath, cmd):
            return []

        next_gid = get_next_gid(entry)
        actions = [
            ofaction.push_mpls(fibcapi.ETHTYPE_MPLS),
            ofaction.set_field("mpls_label", entry.new_label),
        ]

        if mpls_bos:
            actions.append(ofaction.set_field("mpls_bos", 1))

        actions.append(ofaction.set_mpls_ttl(64))
        actions.append(ofaction.group(next_gid))

        return [dict(actions=actions)]
Esempio n. 3
0
    def _buckets():
        if not ofgroup.is_bucket_needed(dpath, cmd):
            return []

        next_gid = fibcapi.mpls_interface_group_id(entry.ne_id)
        actions = [
            ofaction.set_field("mpls_label", entry.new_label),
            ofaction.group(next_gid),
        ]
        return [dict(actions=actions)]
Esempio n. 4
0
    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