コード例 #1
0
ファイル: flowmod_gen.py プロジェクト: ntts-clo/mld-ryu
    def make_flow_vlan_setting(self, command,
                               datapathid, in_port, ivid, flow_mod_datas):
        table_id = 4
        priority = PRIORITY_NORMAL
        match = parser.OFPMatch(in_port=in_port, vlan_vid=ivid)

        inst = None
        out_port = 0
        out_group = 0
        if command != ofproto.OFPFC_DELETE_STRICT:
            actions = [parser.OFPActionOutput(ofproto.OFPP_NORMAL)]
            inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                                 actions)]
        else:
            inst = []
            out_port = ofproto.OFPP_ANY
            out_group = ofproto.OFPG_ANY

        flow_mod_datas.append(flow_mod_data(datapathid=datapathid,
                                            table_id=table_id,
                                            priority=priority,
                                            match=match,
                                            instructions=inst,
                                            command=command,
                                            out_port=out_port,
                                            out_group=out_group))
コード例 #2
0
ファイル: flowmod_gen.py プロジェクト: ntts-clo/mld-ryu
    def make_flow_channel_ivid_mapping(self, command,
                                       datapathid, in_port, multicast_address,
                                       mc_ivid, ivid, flow_mod_datas):
        table_id = 2
        priority = PRIORITY_NORMAL
        match = parser.OFPMatch(in_port=in_port, vlan_vid=mc_ivid,
                                eth_type=ether.ETH_TYPE_IPV6,
                                ipv6_dst=multicast_address)

        inst = None
        out_port = 0
        out_group = 0
        if command != ofproto.OFPFC_DELETE_STRICT:
            actions = [OFPActionSetField(vlan_vid=ivid),
                       parser.OFPActionOutput(ofproto.OFPP_NORMAL)]
            inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                                 actions)]
        else:
            inst = []
            out_port = ofproto.OFPP_ANY
            out_group = ofproto.OFPG_ANY

        flow_mod_datas.append(flow_mod_data(datapathid=datapathid,
                                            table_id=table_id,
                                            priority=priority,
                                            match=match,
                                            instructions=inst,
                                            command=command,
                                            out_port=out_port,
                                            out_group=out_group))
コード例 #3
0
ファイル: flowmod_gen.py プロジェクト: ntts-clo/mld-ryu
    def make_flow_pbb_decapsule(self, command, datapathid,
                                in_port, ivid, pbb_isid, flow_mod_datas):
        table_id = 3
        priority = PRIORITY_NORMAL
        match = parser.OFPMatch(in_port=in_port,
                                eth_type=ether.ETH_TYPE_8021AH,
                                pbb_isid=pbb_isid,
                                eth_dst=self.switch_info[const.SW_TAG_BMAC])

        inst = None
        out_port = 0
        out_group = 0
        if command != ofproto.OFPFC_DELETE_STRICT:
            actions = [OFPActionPopVlan(),
                       OFPActionPopPbb(),
                       OFPActionPushVlan(ethertype=ether.ETH_TYPE_8021Q),
                       OFPActionSetField(vlan_vid=ivid),
                       parser.OFPActionOutput(ofproto.OFPP_NORMAL)]
            inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                                 actions)]
        else:
            inst = []
            out_port = ofproto.OFPP_ANY
            out_group = ofproto.OFPG_ANY

        flow_mod_datas.append(flow_mod_data(datapathid=datapathid,
                                            table_id=table_id,
                                            priority=priority,
                                            match=match,
                                            instructions=inst,
                                            command=command,
                                            out_port=out_port,
                                            out_group=out_group))
コード例 #4
0
ファイル: flowmod_gen.py プロジェクト: ntts-clo/mld-ryu
 def make_flow_mld_v2_report_packet_in(self,
                                       datapathid, in_port, flow_mod_datas):
     table_id = 0
     priority = PRIORITY_NORMAL
     match = parser.OFPMatch(in_port=in_port, eth_type=ether.ETH_TYPE_IPV6,
                             ip_proto=inet.IPPROTO_ICMPV6,
                             icmpv6_type=icmpv6.MLDV2_LISTENER_REPORT)
     actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER,
                                       ofproto.OFPCML_NO_BUFFER)]
     inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS,
                                          actions)]
     flow_mod_datas.append(flow_mod_data(datapathid=datapathid,
                                         table_id=table_id,
                                         priority=priority,
                                         match=match,
                                         instructions=inst))