# License for the specific language governing permissions and limitations # under the License. from os_ken.lib.packet import packet as os_ken_packet from oslo_log import log from dragonflow.controller import app_base LOG = log.getLogger(__name__) @app_base.define_specification( states=('main', ), entrypoints=(app_base.Entrypoint( name='default', target='main', consumes=(), ), ), exitpoints=(app_base.Exitpoint( name='default', provides=(), ), ), ) class LogPacketApp(app_base.Base): def initialize(self): self.api.register_table_handler(self.states.main, self._packet_in_handler) self.mod_flow(table_id=self.states.main, actions=[ self.parser.OFPActionOutput( self.ofproto.OFPP_CONTROLLER,
from dragonflow.controller.common import constants as const from dragonflow.controller.common import utils from dragonflow.controller import df_base_app from dragonflow.db.models import l2 LOG = log.getLogger(__name__) IPV4_SRC_MATCH_ITEM = 'ipv4_src' IPV6_SRC_MATCH_ITEM = 'ipv6_src' @app_base.define_specification( states=('main', ), public_mapping=app_base.VariableMapping(source_port_key='reg6', ), entrypoints=(app_base.Entrypoint( name='default', target='main', consumes=('source_port_key', ), ), ), exitpoints=( app_base.Exitpoint( name='default', provides=('source_port_key', ), ), app_base.Exitpoint( name='services', provides=('source_port_key', ), ), ), ) class PortSecApp(app_base.Base): def _add_flow_drop(self, priority, match):
import mock import testscenarios from dragonflow.controller import app_base from dragonflow.controller import datapath from dragonflow.controller import datapath_layout from dragonflow.tests import base as tests_base load_tests = testscenarios.load_tests_apply_scenarios @app_base.define_specification(states=('main', ), entrypoints=( app_base.Entrypoint( name='conn1', target='main', consumes={}, ), app_base.Entrypoint( name='conn2', target='main', consumes={}, ), ), exitpoints=( app_base.Exitpoint( name='conn1', provides={}, ), app_base.Exitpoint( name='conn2',