コード例 #1
0
 def _main(self):
     flow_init = FlowInitialize.createMatcher(_ismatch = lambda x: self.vhostbind is None or x.vhost in self.vhostbind)
     conn_down = OpenflowConnectionStateEvent.createMatcher(state = OpenflowConnectionStateEvent.CONNECTION_DOWN,
                                                            _ismatch = lambda x: self.vhostbind is None or x.createby.vhost in self.vhostbind)
     while True:
         yield (flow_init, conn_down)
         if self.apiroutine.matcher is flow_init:
             c = self.apiroutine.event.connection
             self.apiroutine.subroutine(self._init_conn(self.apiroutine.event.connection))
         else:
             c = self.apiroutine.event.connection
             self.apiroutine.subroutine(self._remove_conn(c))
コード例 #2
0
ファイル: arpresponder.py プロジェクト: hubo1016/vlcp
 def _main(self):
     flow_init = FlowInitialize.createMatcher(_ismatch = lambda x: self.vhostbind is None or x.vhost in self.vhostbind)
     conn_down = OpenflowConnectionStateEvent.createMatcher(state = OpenflowConnectionStateEvent.CONNECTION_DOWN,
                                                            _ismatch = lambda x: self.vhostbind is None or x.createby.vhost in self.vhostbind)
     while True:
         yield (flow_init, conn_down)
         if self.apiroutine.matcher is flow_init:
             c = self.apiroutine.event.connection
             self.apiroutine.subroutine(self._init_conn(self.apiroutine.event.connection))
         else:
             c = self.apiroutine.event.connection
             self.apiroutine.subroutine(self._remove_conn(c))