Signed-off-by: Isaku Yamahata <[email protected]>
---
Changes v2 -> v3:
- de-GRE
---
bin/ryu-client | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
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.10.4
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel