summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-05-10 14:29:34 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-13 22:17:56 +0900
commite721c181e0a14b45e3974175656f4846c1c207b6 (patch)
tree434545a4d53fc0ec28d6336fe16506d9f5b2199a
parentbea97ae66b49ec912cb69fe201c84c5fc7e0d463 (diff)
lib/ofctl_v1_[23]: Unify the arguments order
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/app/ofctl_rest.py2
-rw-r--r--ryu/lib/ofctl_v1_2.py8
-rw-r--r--ryu/lib/ofctl_v1_3.py8
3 files changed, 13 insertions, 5 deletions
diff --git a/ryu/app/ofctl_rest.py b/ryu/app/ofctl_rest.py
index 8ed4e832..8f27142e 100644
--- a/ryu/app/ofctl_rest.py
+++ b/ryu/app/ofctl_rest.py
@@ -400,7 +400,7 @@ class StatsController(ControllerBase):
_ofctl = supported_ofctl.get(_ofp_version, None)
if _ofctl is not None:
- queues = _ofctl.get_queue_config(dp, port, self.waiters)
+ queues = _ofctl.get_queue_config(dp, self.waiters, port)
else:
LOG.debug('Unsupported OF protocol')
return Response(status=501)
diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index afdfaa91..3015b305 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
@@ -442,8 +442,12 @@ def get_queue_stats(dp, waiters, port=None, queue_id=None):
return desc
-def get_queue_config(dp, port, waiters):
- port = UTIL.ofp_port_from_user(port)
+def get_queue_config(dp, waiters, port=None):
+ ofp = dp.ofproto
+ if port is None:
+ port = ofp.OFPP_ANY
+ else:
+ port = UTIL.ofp_port_from_user(int(str(port), 0))
stats = dp.ofproto_parser.OFPQueueGetConfigRequest(dp, port)
msgs = []
ofctl_utils.send_stats_request(dp, stats, waiters, msgs, LOG)
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 9ae8df8d..3d768ce2 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
@@ -383,8 +383,12 @@ def get_queue_stats(dp, waiters, port=None, queue_id=None, to_user=True):
return wrap_dpid_dict(dp, s, to_user)
-def get_queue_config(dp, port, waiters, to_user=True):
- port = UTIL.ofp_port_from_user(port)
+def get_queue_config(dp, waiters, port=None, to_user=True):
+ ofp = dp.ofproto
+ if port is None:
+ port = ofp.OFPP_ANY
+ else:
+ port = UTIL.ofp_port_from_user(int(str(port), 0))
stats = dp.ofproto_parser.OFPQueueGetConfigRequest(dp, port)
msgs = []
ofctl_utils.send_stats_request(dp, stats, waiters, msgs, LOG)