openflow-controller 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/ofctl +41 -0
  3. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d03f70b6b79ae5f78ceea79beb46a1c0231c66b5
4
- data.tar.gz: 175302796e704286f52912508d8e8c3bedbd947f
3
+ metadata.gz: 48915608d165aecb6be3147ad85192b9144c8d82
4
+ data.tar.gz: 26b670e970ff60856eaa16bf7409d563598186d2
5
5
  SHA512:
6
- metadata.gz: 2c327dc1711de1ffaa374458189dc7999c9c8db40035be47adf2c3d37add1470df5a514bcfb86f938c256c9f9fad4fd7a9e6925d042e851ccd3e31b3f5bf9bdf
7
- data.tar.gz: 34465269b491f1ad763d1811624968c9edb9548a77bbcedffdbd9cd77c17705949ef583ef3d1548960ee1aa17376788338cf9536ad0db76b68ee4e62ac93aeb2
6
+ metadata.gz: 935a073e304aec0eedd826dc94d11791578e24a751a5c040bf1f695e0171f67d7568f7090bdea93b43b662126f03b6adaa5f60b8875f37503ab94ce76f7e21ee
7
+ data.tar.gz: d08b894ed38f199238bf9b87516f9707dff52499ef5eb6c1aea3b5552f5895f79f902d9f5b6696cacf2471a213fe28f6b61863aa053b240101ab167fc0ddf251
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ require_relative '../lib/controller'
4
+
5
+ module CommandLine
6
+ extend GLI::App
7
+
8
+ program_desc 'OpenFlow Controller command-line tool'
9
+
10
+ desc 'Runs an OpenFlow Controller'
11
+ arg_name 'controller', optional: false
12
+ command :run do |c|
13
+ c.flag :ip,
14
+ desc: 'IP Address',
15
+ must_match: /\d+\.\d+\.\d+\.\d+/,
16
+ required: false,
17
+ default_value: OFController::DEFAULT_IP_ADDRESS
18
+ c.flag :port,
19
+ desc: 'Port Number',
20
+ type: Integer,
21
+ required: false,
22
+ default_value: OFController::DEFAULT_TCP_PORT
23
+ c.switch :debug,
24
+ desc: 'Run in Debug Mode',
25
+ default_value: false
26
+
27
+ c.action do |_global_options, options, args|
28
+ load args.first
29
+ controller = if options[:debug]
30
+ OFController.create(Logger::DEBUG)
31
+ else
32
+ OFController.create
33
+ end
34
+ controller.run options[:ip], options[:port], args[1..-1]
35
+ end
36
+ end
37
+
38
+ default_command :help
39
+
40
+ exit run(ARGV)
41
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openflow-controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy Pagé
@@ -13,10 +13,12 @@ dependencies: []
13
13
  description: An OpenFlow Controller.
14
14
  email:
15
15
  - contact@jeremypage.me
16
- executables: []
16
+ executables:
17
+ - ofctl
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - bin/ofctl
20
22
  - lib/controller.rb
21
23
  - lib/openflow-controller.rb
22
24
  - lib/switch.rb