Signed-off-by: Isaku Yamahata <[email protected]>
---
Changes v2 -> v3:
- de-GRE
---
 bin/ryu-client |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/bin/ryu-client b/bin/ryu-client
index 20eeff6..e121f61 100755
--- a/bin/ryu-client
+++ b/bin/ryu-client
@@ -19,6 +19,7 @@
 import sys
 from optparse import OptionParser
 
+from ryu.app.client import TunnelClient
 from ryu.app.client import OFPClient
 
 
@@ -33,7 +34,10 @@ def client_test():
         parser.print_help()
         sys.exit(1)
 
-    client = OFPClient(options.host + ':' + str(options.port))
+    address = options.host + ':' + str(options.port)
+    ofp_client = OFPClient(address)
+    tun_client = TunnelClient(address)
+
     commands = {
         'list_nets': lambda a: sys.stdout.write(client.get_networks()),
         'create_net': lambda a: client.create_network(a[1]),
@@ -47,6 +51,21 @@ def client_test():
             ofp_client.list_macs(a[1], a[2], a[3])),
         'create_mac': lambda a: ofp_client.create_mac(a[1], a[2], a[3], a[4]),
         'update_mac': lambda a: ofp_client.update_mac(a[1], a[2], a[3], a[4]),
+
+        'get_tun_key': lambda a: sys.stdout.write(
+            tun_client.get_tunnel_key(a[1])),
+        'delete_tun_key': lambda a: tun_client.delete_tunnel_key(a[1]),
+        'create_tun_key': lambda a: tun_client.create_tunnel_key(a[1], a[2]),
+        'update_tun_key': lambda a: tun_client.update_tunnel_key(a[1], a[2]),
+        'list_tun_ports': lambda a: sys.stdout.write(
+            tun_client.list_ports(a[1])),
+        'delete_tun_port': lambda a: tun_client.delete_port(a[1], a[2]),
+        'get_remote_dpid': lambda a: sys.stdout.write(
+            tun_client.get_remote_dpid(a[1], a[2])),
+        'create_remote_dpid': lambda a: tun_client.create_remote_dpid(
+            a[1], a[2], a[3]),
+        'update_remote_dpid': lambda a: tun_client.update_remote_dpid(
+            a[1], a[2], a[3]),
     }
 
     # allow '-', instead of '_'
-- 
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