示例#1
0
    def _buckets():
        if not ofgroup.is_bucket_needed(dpath, cmd):
            return []

        actions = [ofaction.output(entry.port_id)]
        if entry.vlan_vid == ofproto.OFPVID_NONE:
            actions.insert(0, ofaction.pop_vlan())
        return [dict(actions=actions)]
示例#2
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)]
示例#3
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)]
示例#4
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)]