Coverage for neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/ofswitch : 62%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.
# Field name mappings (from Ryu to ovs-ofctl) 'eth_src': 'dl_src', 'eth_dst': 'dl_dst', 'ipv4_src': 'nw_src', 'ipv4_dst': 'nw_dst', 'table_id': 'table', }
"""Mixin to provide common convenient routines for an openflow switch."""
def _conv_args(kwargs): for our_name, ovs_ofctl_name in _keywords.items(): if our_name in kwargs: kwargs[ovs_ofctl_name] = kwargs.pop(our_name) return kwargs
return self.dump_flows_for_table(table_id)
return self.dump_all_flows()
self.install_goto(table_id=table_id, dest_table_id=table_id + 1)
self.add_flow(table=table_id, priority=priority, actions="output:%s" % port, **self._conv_args(kwargs))
self.add_flow(table=table_id, priority=priority, actions="normal", **self._conv_args(kwargs))
self.add_flow(table=table_id, priority=priority, actions="resubmit(,%s)" % dest_table_id, **self._conv_args(kwargs))
self.add_flow(table=table_id, priority=priority, actions="drop", **self._conv_args(kwargs))
# NOTE(yamamoto): super() points to ovs_lib.OVSBridge. # See ovs_bridge.py how this class is actually used. if kwargs: super(OpenFlowSwitchMixin, self).delete_flows( **self._conv_args(kwargs)) else: super(OpenFlowSwitchMixin, self).remove_all_flows()
kwargs['cookie'] = self.agent_uuid_stamp super(OpenFlowSwitchMixin, self).add_flow(**self._conv_args(kwargs))
kwargs['cookie'] = self.agent_uuid_stamp super(OpenFlowSwitchMixin, self).mod_flow(**self._conv_args(kwargs))
self.agent_uuid_stamp) continue continue
# deleting a stale flow should be rare. # it might deserve some attention |