Hi,

Thank you for great improvements!


On 2016年03月29日 05:44, Jason Kölker wrote:
> Signed-off-by: Jason Kölker <[email protected]>
> ---
>   ryu/lib/ofctl_common.py | 44 +++++++++++++++++++++++++++++++++++++++++
>   ryu/lib/ofctl_v1_0.py   | 36 ++++++++--------------------------
>   ryu/lib/ofctl_v1_2.py   | 44 ++++++++++++-----------------------------
>   ryu/lib/ofctl_v1_3.py   | 52 
> +++++++++++++++----------------------------------
>   ryu/lib/ofctl_v1_4.py   | 52 
> +++++++++++++++----------------------------------
>   5 files changed, 96 insertions(+), 132 deletions(-)
>   create mode 100644 ryu/lib/ofctl_common.py
>
> diff --git a/ryu/lib/ofctl_common.py b/ryu/lib/ofctl_common.py
> new file mode 100644
> index 0000000..7f6d0c7
> --- /dev/null
> +++ b/ryu/lib/ofctl_common.py

I think ofctl_common.py can be merged into ofctl_utils.py.
How about merging it?

> @@ -0,0 +1,44 @@
> +# Copyright (C) 2012-2016 Nippon Telegraph and Telephone Corporation.
> +#
> +# 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.
> +
> +import logging
> +
> +from ryu.lib import hub
> +from ryu.lib import ofctl_utils
> +
> +
> +LOG = logging.getLogger(__name__)
> +
> +DEFAULT_TIMEOUT = 1.0
> +
> +
> +def send_stats_request(dp, stats, waiters, msgs, logger=None):
> +    dp.set_xid(stats)
> +    waiters_per_dp = waiters.setdefault(dp.id, {})
> +    lock = hub.Event()
> +    previous_msg_len = len(msgs)
> +    waiters_per_dp[stats.xid] = (lock, msgs)
> +    ofctl_utils.send_msg(dp, stats, logger)
> +
> +    lock.wait(timeout=DEFAULT_TIMEOUT)
> +    current_msg_len = len(msgs)
> +
> +    while current_msg_len > previous_msg_len:
> +        previous_msg_len = current_msg_len
> +        lock.wait(timeout=DEFAULT_TIMEOUT)
> +        current_msg_len = len(msgs)
> +
> +    if not lock.is_set():
> +        del waiters_per_dp[stats.xid]
> diff --git a/ryu/lib/ofctl_v1_0.py b/ryu/lib/ofctl_v1_0.py
> index af22f87..65f95bb 100644
> --- a/ryu/lib/ofctl_v1_0.py
> +++ b/ryu/lib/ofctl_v1_0.py
> @@ -18,7 +18,7 @@ import socket
>   import logging
>
>   from ryu.ofproto import ofproto_v1_0
> -from ryu.lib import hub
> +from ryu.lib import ofctl_common
>   from ryu.lib import ofctl_utils
>   from ryu.lib.mac import haddr_to_bin, haddr_to_str
>
> @@ -278,30 +278,10 @@ def nw_dst_to_str(wildcards, addr):
>       return ip
>
>
> -def send_stats_request(dp, stats, waiters, msgs):
> -    dp.set_xid(stats)
> -    waiters_per_dp = waiters.setdefault(dp.id, {})
> -    lock = hub.Event()
> -    previous_msg_len = len(msgs)
> -    waiters_per_dp[stats.xid] = (lock, msgs)
> -    ofctl_utils.send_msg(dp, stats, LOG)
> -
> -    lock.wait(timeout=DEFAULT_TIMEOUT)
> -    current_msg_len = len(msgs)
> -
> -    while current_msg_len > previous_msg_len:
> -        previous_msg_len = current_msg_len
> -        lock.wait(timeout=DEFAULT_TIMEOUT)
> -        current_msg_len = len(msgs)
> -
> -    if not lock.is_set():
> -        del waiters_per_dp[stats.xid]
> -
> -
>   def get_desc_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       for msg in msgs:
>           stats = msg.body
> @@ -328,7 +308,7 @@ def get_queue_stats(dp, waiters, port=None, 
> queue_id=None):
>       stats = dp.ofproto_parser.OFPQueueStatsRequest(dp, 0, port,
>                                                      queue_id)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       s = []
>       for msg in msgs:
> @@ -355,7 +335,7 @@ def get_flow_stats(dp, waiters, flow=None):
>           dp, 0, match, table_id, out_port)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -391,7 +371,7 @@ def get_aggregate_flow_stats(dp, waiters, flow=None):
>           dp, 0, match, table_id, out_port)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -410,7 +390,7 @@ def get_table_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPTableStatsRequest(dp, 0)
>       ofp = dp.ofproto
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       match_convert = {ofp.OFPFW_IN_PORT: 'IN_PORT',
>                        ofp.OFPFW_DL_VLAN: 'DL_VLAN',
> @@ -466,7 +446,7 @@ def get_port_stats(dp, waiters, port=None):
>       stats = dp.ofproto_parser.OFPPortStatsRequest(
>           dp, 0, port)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       ports = []
>       for msg in msgs:
> @@ -493,7 +473,7 @@ def get_port_desc(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPFeaturesRequest(dp)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       descs = []
>
> diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
> index 586f7c5..fae4df4 100644
> --- a/ryu/lib/ofctl_v1_2.py
> +++ b/ryu/lib/ofctl_v1_2.py
> @@ -21,7 +21,7 @@ from ryu.ofproto import ether
>   from ryu.ofproto import inet
>   from ryu.ofproto import ofproto_v1_2
>   from ryu.ofproto import ofproto_v1_2_parser
> -from ryu.lib import hub
> +from ryu.lib import ofctl_common
>   from ryu.lib import ofctl_utils
>
>
> @@ -396,30 +396,10 @@ def match_vid_to_str(value, mask):
>       return value
>
>
> -def send_stats_request(dp, stats, waiters, msgs):
> -    dp.set_xid(stats)
> -    waiters_per_dp = waiters.setdefault(dp.id, {})
> -    lock = hub.Event()
> -    previous_msg_len = len(msgs)
> -    waiters_per_dp[stats.xid] = (lock, msgs)
> -    ofctl_utils.send_msg(dp, stats, LOG)
> -
> -    lock.wait(timeout=DEFAULT_TIMEOUT)
> -    current_msg_len = len(msgs)
> -
> -    while current_msg_len > previous_msg_len:
> -        previous_msg_len = current_msg_len
> -        lock.wait(timeout=DEFAULT_TIMEOUT)
> -        current_msg_len = len(msgs)
> -
> -    if not lock.is_set():
> -        del waiters_per_dp[stats.xid]
> -
> -
>   def get_desc_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPDescStatsRequest(dp)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       s = {}
>       for msg in msgs:
> @@ -449,7 +429,7 @@ def get_queue_stats(dp, waiters, port=None, 
> queue_id=None):
>       stats = dp.ofproto_parser.OFPQueueStatsRequest(dp, port,
>                                                      queue_id, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       s = []
>       for msg in msgs:
> @@ -468,7 +448,7 @@ def get_queue_config(dp, port, waiters):
>       port = UTIL.ofp_port_from_user(port)
>       stats = dp.ofproto_parser.OFPQueueGetConfigRequest(dp, port)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       prop_type = {dp.ofproto.OFPQT_MIN_RATE: 'MIN_RATE',
>                    dp.ofproto.OFPQT_MAX_RATE: 'MAX_RATE',
> @@ -517,7 +497,7 @@ def get_flow_stats(dp, waiters, flow=None):
>           dp, table_id, out_port, out_group, cookie, cookie_mask, match)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -558,7 +538,7 @@ def get_aggregate_flow_stats(dp, waiters, flow=None):
>           dp, table_id, out_port, out_group, cookie, cookie_mask, match)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -576,7 +556,7 @@ def get_table_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPTableStatsRequest(dp)
>       ofp = dp.ofproto
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       oxm_type_convert = {ofp.OFPXMT_OFB_IN_PORT: 'IN_PORT',
>                           ofp.OFPXMT_OFB_IN_PHY_PORT: 'IN_PHY_PORT',
> @@ -706,7 +686,7 @@ def get_port_stats(dp, waiters, port=None):
>       stats = dp.ofproto_parser.OFPPortStatsRequest(
>           dp, port, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       ports = []
>       for msg in msgs:
> @@ -738,7 +718,7 @@ def get_group_stats(dp, waiters, group_id=None):
>       stats = dp.ofproto_parser.OFPGroupStatsRequest(
>           dp, group_id, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       groups = []
>       for msg in msgs:
> @@ -787,7 +767,7 @@ def get_group_features(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPGroupFeaturesStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       features = []
>       for msg in msgs:
> @@ -828,7 +808,7 @@ def get_group_desc(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPGroupDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       descs = []
>       for msg in msgs:
> @@ -855,7 +835,7 @@ def get_port_desc(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPFeaturesRequest(dp)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       descs = []
>
> diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
> index 474e2fa..9c72c1e 100644
> --- a/ryu/lib/ofctl_v1_3.py
> +++ b/ryu/lib/ofctl_v1_3.py
> @@ -21,7 +21,7 @@ from ryu.ofproto import ether
>   from ryu.ofproto import inet
>   from ryu.ofproto import ofproto_v1_3
>   from ryu.ofproto import ofproto_v1_3_parser
> -from ryu.lib import hub
> +from ryu.lib import ofctl_common
>   from ryu.lib import ofctl_utils
>
>
> @@ -434,30 +434,10 @@ def match_vid_to_str(value, mask):
>       return value
>
>
> -def send_stats_request(dp, stats, waiters, msgs):
> -    dp.set_xid(stats)
> -    waiters_per_dp = waiters.setdefault(dp.id, {})
> -    lock = hub.Event()
> -    previous_msg_len = len(msgs)
> -    waiters_per_dp[stats.xid] = (lock, msgs)
> -    ofctl_utils.send_msg(dp, stats, LOG)
> -
> -    lock.wait(timeout=DEFAULT_TIMEOUT)
> -    current_msg_len = len(msgs)
> -
> -    while current_msg_len > previous_msg_len:
> -        previous_msg_len = current_msg_len
> -        lock.wait(timeout=DEFAULT_TIMEOUT)
> -        current_msg_len = len(msgs)
> -
> -    if not lock.is_set():
> -        del waiters_per_dp[stats.xid]
> -
> -
>   def get_desc_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>       s = {}
>
>       for msg in msgs:
> @@ -487,7 +467,7 @@ def get_queue_stats(dp, waiters, port=None, 
> queue_id=None):
>       stats = dp.ofproto_parser.OFPQueueStatsRequest(dp, 0, port,
>                                                      queue_id)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       s = []
>       for msg in msgs:
> @@ -508,7 +488,7 @@ def get_queue_config(dp, port, waiters):
>       port = UTIL.ofp_port_from_user(port)
>       stats = dp.ofproto_parser.OFPQueueGetConfigRequest(dp, port)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       prop_type = {dp.ofproto.OFPQT_MIN_RATE: 'MIN_RATE',
>                    dp.ofproto.OFPQT_MAX_RATE: 'MAX_RATE',
> @@ -559,7 +539,7 @@ def get_flow_stats(dp, waiters, flow=None):
>           match)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -604,7 +584,7 @@ def get_aggregate_flow_stats(dp, waiters, flow=None):
>           match)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -621,7 +601,7 @@ def get_aggregate_flow_stats(dp, waiters, flow=None):
>   def get_table_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPTableStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       tables = []
>       for msg in msgs:
> @@ -641,7 +621,7 @@ def get_table_features(dp, waiters):
>       stats = dp.ofproto_parser.OFPTableFeaturesStatsRequest(dp, 0, [])
>       msgs = []
>       ofproto = dp.ofproto
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       prop_type = {ofproto.OFPTFPT_INSTRUCTIONS: 'INSTRUCTIONS',
>                    ofproto.OFPTFPT_INSTRUCTIONS_MISS: 'INSTRUCTIONS_MISS',
> @@ -742,7 +722,7 @@ def get_port_stats(dp, waiters, port=None):
>       stats = dp.ofproto_parser.OFPPortStatsRequest(
>           dp, 0, port)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       ports = []
>       for msg in msgs:
> @@ -776,7 +756,7 @@ def get_meter_stats(dp, waiters, meter_id=None):
>       stats = dp.ofproto_parser.OFPMeterStatsRequest(
>           dp, 0, meter_id)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       meters = []
>       for msg in msgs:
> @@ -812,7 +792,7 @@ def get_meter_features(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPMeterFeaturesStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       features = []
>       for msg in msgs:
> @@ -853,7 +833,7 @@ def get_meter_config(dp, waiters, meter_id=None):
>       stats = dp.ofproto_parser.OFPMeterConfigStatsRequest(
>           dp, 0, meter_id)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       configs = []
>       for msg in msgs:
> @@ -889,7 +869,7 @@ def get_group_stats(dp, waiters, group_id=None):
>       stats = dp.ofproto_parser.OFPGroupStatsRequest(
>           dp, 0, group_id)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       groups = []
>       for msg in msgs:
> @@ -942,7 +922,7 @@ def get_group_features(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPGroupFeaturesStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       features = []
>       for msg in msgs:
> @@ -983,7 +963,7 @@ def get_group_desc(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPGroupDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       descs = []
>       for msg in msgs:
> @@ -1010,7 +990,7 @@ def get_port_desc(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPPortDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       descs = []
>
> diff --git a/ryu/lib/ofctl_v1_4.py b/ryu/lib/ofctl_v1_4.py
> index 19232ef..12d354f 100644
> --- a/ryu/lib/ofctl_v1_4.py
> +++ b/ryu/lib/ofctl_v1_4.py
> @@ -21,7 +21,7 @@ import six
>   from ryu.ofproto import ether
>   from ryu.ofproto import ofproto_v1_4
>   from ryu.ofproto import ofproto_v1_4_parser
> -from ryu.lib import hub
> +from ryu.lib import ofctl_common
>   from ryu.lib import ofctl_utils
>
>   LOG = logging.getLogger(__name__)
> @@ -348,30 +348,10 @@ def match_vid_to_str(value, mask):
>       return value
>
>
> -def send_stats_request(dp, stats, waiters, msgs):
> -    dp.set_xid(stats)
> -    waiters_per_dp = waiters.setdefault(dp.id, {})
> -    lock = hub.Event()
> -    previous_msg_len = len(msgs)
> -    waiters_per_dp[stats.xid] = (lock, msgs)
> -    ofctl_utils.send_msg(dp, stats, LOG)
> -
> -    lock.wait(timeout=DEFAULT_TIMEOUT)
> -    current_msg_len = len(msgs)
> -
> -    while current_msg_len > previous_msg_len:
> -        previous_msg_len = current_msg_len
> -        lock.wait(timeout=DEFAULT_TIMEOUT)
> -        current_msg_len = len(msgs)
> -
> -    if not lock.is_set():
> -        del waiters_per_dp[stats.xid]
> -
> -
>   def get_desc_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>       s = {}
>
>       for msg in msgs:
> @@ -386,7 +366,7 @@ def get_queue_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPQueueStatsRequest(dp, 0, ofp.OFPP_ANY,
>                                                      ofp.OFPQ_ALL)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       desc = []
>       for msg in msgs:
> @@ -413,7 +393,7 @@ def get_queue_desc_stats(dp, waiters, port_no=None, 
> queue_id=None):
>       stats = dp.ofproto_parser.OFPQueueDescStatsRequest(
>           dp, 0, port_no, queue_id)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       configs = []
>       for config in msgs:
> @@ -453,7 +433,7 @@ def get_flow_stats(dp, waiters, flow=None):
>           match)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -485,7 +465,7 @@ def get_aggregate_flow_stats(dp, waiters, flow=None):
>           match)
>
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       flows = []
>       for msg in msgs:
> @@ -500,7 +480,7 @@ def get_aggregate_flow_stats(dp, waiters, flow=None):
>   def get_table_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPTableStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       tables = []
>       for msg in msgs:
> @@ -517,7 +497,7 @@ def get_table_features(dp, waiters):
>       stats = dp.ofproto_parser.OFPTableFeaturesStatsRequest(dp, 0, [])
>       msgs = []
>       ofproto = dp.ofproto
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       p_type_instructions = [ofproto.OFPTFPT_INSTRUCTIONS,
>                              ofproto.OFPTFPT_INSTRUCTIONS_MISS]
> @@ -589,7 +569,7 @@ def get_port_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPPortStatsRequest(
>           dp, 0, dp.ofproto.OFPP_ANY)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       ports = []
>       for msg in msgs:
> @@ -611,7 +591,7 @@ def get_meter_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPMeterStatsRequest(
>           dp, 0, dp.ofproto.OFPM_ALL)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       meters = []
>       for msg in msgs:
> @@ -639,7 +619,7 @@ def get_meter_features(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPMeterFeaturesStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       features = []
>       for msg in msgs:
> @@ -671,7 +651,7 @@ def get_meter_config(dp, waiters):
>       stats = dp.ofproto_parser.OFPMeterConfigStatsRequest(
>           dp, 0, dp.ofproto.OFPM_ALL)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       configs = []
>       for msg in msgs:
> @@ -698,7 +678,7 @@ def get_group_stats(dp, waiters):
>       stats = dp.ofproto_parser.OFPGroupStatsRequest(
>           dp, 0, dp.ofproto.OFPG_ALL)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       groups = []
>       for msg in msgs:
> @@ -746,7 +726,7 @@ def get_group_features(dp, waiters):
>
>       stats = dp.ofproto_parser.OFPGroupFeaturesStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       features = []
>       for msg in msgs:
> @@ -781,7 +761,7 @@ def get_group_features(dp, waiters):
>   def get_group_desc(dp, waiters):
>       stats = dp.ofproto_parser.OFPGroupDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       descs = []
>       for msg in msgs:
> @@ -806,7 +786,7 @@ def get_group_desc(dp, waiters):
>   def get_port_desc(dp, waiters):
>       stats = dp.ofproto_parser.OFPPortDescStatsRequest(dp, 0)
>       msgs = []
> -    send_stats_request(dp, stats, waiters, msgs)
> +    ofctl_common.send_stats_request(dp, stats, waiters, msgs, LOG)
>
>       descs = []
>
>

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to