Пример #1
0
 def configure_global_states(self, datapath):
     for port in self.ports_mac_dict[datapath.id]:
         if port != ofproto.OFPP_LOCAL:
             (global_state,
              global_state_mask) = osparser.masked_global_state_from_str(
                  "1", port - 1)
             msg = osparser.OFPExpSetGlobalState(
                 datapath=datapath,
                 global_state=global_state,
                 global_state_mask=global_state_mask)
             datapath.send_msg(msg)
Пример #2
0
    def test10(self, datapath):
        self.send_table_mod(datapath)
        actions = [ofparser.OFPActionOutput(6, 0)]
        match = ofparser.OFPMatch(in_port=5,
                                  ip_proto=1,
                                  eth_type=0x800,
                                  global_state=2863311530)
        self.add_flow(datapath, 150, match, actions)

        msg = osparser.OFPExpSetGlobalState(datapath=datapath,
                                            global_state=2863311530,
                                            global_state_mask=0xffffffff)
        datapath.send_msg(msg)

        actions = [ofparser.OFPActionOutput(5, 0)]
        match = ofparser.OFPMatch(in_port=6, ip_proto=1, eth_type=0x800)
        self.add_flow(datapath, 150, match, actions)
Пример #3
0
    def test11(self, datapath):
        self.send_table_mod(datapath)
        (global_state,
         global_state_mask) = osparser.masked_global_state_from_str(
             "1*1*1*1*1*1*1*1*0*0*1*1*1*1*1*1*")
        actions = [ofparser.OFPActionOutput(6, 0)]
        match = ofparser.OFPMatch(
            in_port=5,
            eth_type=0x800,
            ip_proto=1,
            global_state=osparser.masked_global_state_from_str(
                "1*1*1*1*1*1*1*1*0*0*1*1*1*1*1*1*"))
        self.add_flow(datapath, 150, match, actions)

        msg = osparser.OFPExpSetGlobalState(
            datapath=datapath,
            global_state=global_state,
            global_state_mask=global_state_mask)
        datapath.send_msg(msg)

        actions = [ofparser.OFPActionOutput(5, 0)]
        match = ofparser.OFPMatch(in_port=6, ip_proto=1, eth_type=0x800)
        self.add_flow(datapath, 200, match, actions)