Signed-off-by: Isaku Yamahata <[email protected]>
---
 ryu/app/wsgi_path.py |   18 ++++++++++++++++++
 ryu/lib/dpid.py      |    4 +++-
 ryu/lib/mac.py       |    2 ++
 3 files changed, 23 insertions(+), 1 deletions(-)
 create mode 100644 ryu/app/wsgi_path.py

diff --git a/ryu/app/wsgi_path.py b/ryu/app/wsgi_path.py
new file mode 100644
index 0000000..1e88c1b
--- /dev/null
+++ b/ryu/app/wsgi_path.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
+# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
+#
+# 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.
+
+HEX_PATTERN = r'0x[0-9a-z]+'
+DIGIT_PATTERN = r'[1-9][0-9]*'
diff --git a/ryu/lib/dpid.py b/ryu/lib/dpid.py
index 8c8bf75..1224ae0 100644
--- a/ryu/lib/dpid.py
+++ b/ryu/lib/dpid.py
@@ -18,7 +18,9 @@
 # string representation is in hex without '0x'
 
 _DPID_LEN = 16
-_DPID_FMT = '%0' + str(_DPID_LEN) + 'x'
+_DPID_LEN_STR = str(_DPID_LEN)
+_DPID_FMT = '%0' + _DPID_LEN_STR + 'x'
+DPID_PATTERN = r'[0-9a-f]{%d}' % _DPID_LEN
 
 
 def dpid_to_str(dpid):
diff --git a/ryu/lib/mac.py b/ryu/lib/mac.py
index 2082643..3cb2df3 100644
--- a/ryu/lib/mac.py
+++ b/ryu/lib/mac.py
@@ -16,6 +16,8 @@
 
 import itertools
 
+# string representation
+HADDR_PATTERN = r'([0-9a-f]{2}:){5}[0-9a-f]{2}'
 
 # Internal representation of mac address is string[6]
 _HADDR_LEN = 6
-- 
1.7.1.1


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to