cwmp 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDhhZTIyNjA2OWM5MmI3NTQ2ZDQxMmZiMWRiYTZmNzVmOWRjZDlhYg==
4
+ NTE2ODFiN2E1NjdlODEzNGE2OTMxYWRjOWQwMzNhNTZjZGQwNzgxMA==
5
5
  data.tar.gz: !binary |-
6
- MWQ0NTNjYzAzMWE0ZDlhZWJiZWM2ZDQ1MmVlNjBmMjhiNWQzODc2Ng==
6
+ ODM5ZjNhZTQwNzU1MmU3Y2RiMmI4NmM1OGNlMzk3Njk1NDMwNGQ0Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTYxNTRiYTBkZjYwMmI4NThhYTM0YTZjODc2MWNlODA5YTJjZjk3ZDBiZTA5
10
- ZTgzNTRmNDJjNmU0MWIzYWE0M2EyZTAyYzBiY2YwMTI4MWJiNDQ1MzIxODFk
11
- NDM1M2VhZGRjYjVmOTE5MTdmYjk3MjFjN2RkNzVhMTQxZjBiN2U=
9
+ ZTMyOWNhNTQzYWE3YzJkY2FlMzcwNTNhZjRhNDA3YzlkMGVhZTBmMWRkZDg1
10
+ Yjg1YWM0NmJiOWI3YzI1OTcyMmQ0MWI0ODA3NDIyNDJiNTYxYzQyZDU3MjA2
11
+ YWQ2MmJkNzlkNTUxMGE5ZGJhZWVkNGM4M2QxNGYxZmMxYWZlYzY=
12
12
  data.tar.gz: !binary |-
13
- NDVlMWI1NTk2NDM4MDUwM2U0ZDJiNWM3YzQxZjc4ZTA4YzliNjJkYTM5ZWNj
14
- MmQ0NDU4YWQxOGJjODUzZDI5MDkxZDVkMTYxOGRiOWIxNTczNGQ5NTM4MWE0
15
- YTkxYzBkZWM4ODgzYWI4ZmQ0OTE1MTc5ZDhhODlmNWNhMGRkYmI=
13
+ NmMzMjk2OTQwYzI3ODUyY2M4OGU0YzFjMjM4MWFkYTgzMzkwNTA2Y2NjNDk1
14
+ OWYzNTNmMmE1ZDBjYjIxNWY3NTY4YmNiOWQxOGU4YThlNDg2NmE4YjQyM2Mz
15
+ OTdmYjhmM2M1YTZkZjNlYjU1ODdiNDg0MDczMDJmNGFmNWMzZGU=
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
1
  .idea
2
+ *.gem
3
+ Gemfile.lock
data/README.md CHANGED
@@ -1,5 +1,37 @@
1
- A ruby library to parse and generate CWMP messages. Includes a CPE simulator and a simple ACS server.
1
+ # Ruby CWMP
2
2
 
3
+ A ruby library to parse and generate CWMP messages. Includes an ACS server and a CPE simulator.
4
+
5
+ ## Using the library to build CWMP messages
6
+
7
+ ```ruby
8
+ require 'cwmp'
9
+
10
+ puts Cwmp::Message::inform_response
11
+ puts Cwmp::Message::get_parameter_values ["Device.ManagementServer.", "Device.Time."]
12
+ puts Cwmp::Message::set_parameter_values [["InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Enable", "Enabled"], ["InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DHCPStaticAddress.1.Enable", "true"]]
13
+
14
+ ```
15
+
16
+ ## Running ACS server
17
+
18
+ just run `acs` command on your shell
19
+
20
+ ```
21
+ $ acs
22
+ ```
23
+
24
+ and acs will be up, using thin
25
+
26
+ ## Running CPE simulatore
27
+
28
+ type `cpe` on your shell
29
+
30
+ ```
31
+ $ cpe
32
+ ```
33
+
34
+ and cpe simulator will be up, sending periodic messages every 30s and accepting incoming connection requests
3
35
 
4
36
 
5
37
 
data/bin/acs CHANGED
@@ -5,23 +5,22 @@ require 'cwmp'
5
5
 
6
6
  options = {}
7
7
  o = OptionParser.new
8
- o.on('-d', '--daemon', "Start Moses daemon server") { |b| options['daemon'] = b }
8
+ o.on('-d', '--daemon', "Start acs daemon") { |b| options['daemon'] = b }
9
9
  o.on('-p', '--port NUM', Integer, 'Server port') { |port| options['port'] = port }
10
10
  o.on('-r', '--reconnect', "Connects to remote daemon via CLI") { |b| options['reconnect'] = b }
11
11
  o.on('-H', '--host HOST', 'Specify host for remote CLI connection') { |host| options['host'] = host }
12
12
  o.on('-h', '--help', 'Server port') { puts o; exit }
13
- o.on('-v', '--version', 'Version') { puts "Moses v#{Moses::VERSION}"; exit }
13
+ o.on('-v', '--version', 'Version') { puts "acs v#{Cwmp::VERSION}"; exit }
14
14
  o.parse!
15
15
 
16
16
 
17
17
  # if options['daemon']
18
18
  # port = options['port'] || 9292
19
- # puts "Starting Moses ACS Daemon on port #{port}"
20
- # Moses::Acs.new(port).start
19
+ # puts "Starting ACS Daemon on port #{port}"
20
+ # Cwmp::Acs.new(port).start
21
21
  # elsif options['reconnect']
22
22
  # url = options['host'] || "http://localhost:9292/api"
23
23
  # puts "Connecting to remote daemon on #{url}"
24
- # Moses::CLI.new.start
25
24
  # else
26
25
  # puts o; exit
27
26
  # end
data/cwmp.gemspec CHANGED
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency('http_router', '~> 0.11', '>= 0.11.1')
19
19
  s.add_dependency('eventmachine', '~> 1.0', '>= 1.0.3')
20
20
  s.add_dependency('faye-websocket', '~> 0.6', '>= 0.6.2')
21
+ s.add_dependency('httpclient', '~> 2.4', '>= 2.4.0')
21
22
  end
data/lib/cwmp.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  $:.unshift File.join(File.dirname(__FILE__), "cwmp")
2
2
  require 'acs'
3
3
  require 'message'
4
- require 'cpe'
4
+ require 'cpe'
5
+ require 'version'
data/lib/cwmp/acs.rb CHANGED
@@ -31,7 +31,7 @@ module Cwmp
31
31
  puts "got Inform from #{req.ip}:#{req.port} [sn #{serial_number}] with eventcodes #{event_codes.join(", ")}"
32
32
 
33
33
  inform_response = Cwmp::Message::inform_response
34
- response = Rack::Response.new inform_response, 200, {'Connection' => 'Keep-Alive', 'Server' => 'Moses'}
34
+ response = Rack::Response.new inform_response, 200, {'Connection' => 'Keep-Alive', 'Server' => 'ruby-cwmp'}
35
35
  response.set_cookie("sessiontrack", {:value => "294823094lskdfsfsdf", :path => "/", :expires => Time.now+24*60*60})
36
36
  response.finish
37
37
  elsif message_type == "TransferComplete"
@@ -44,7 +44,7 @@ module Cwmp
44
44
  end
45
45
 
46
46
  # Got Empty Post or a Response. Now check for any event to send, otherwise 204
47
- [204, {"Connection" => "Close", 'Server' => 'Moses'}, ""]
47
+ [204, {"Connection" => "Close", 'Server' => 'ruby-cwmp'}, ""]
48
48
  end
49
49
  end
50
50
 
data/lib/cwmp/cpe.rb CHANGED
@@ -107,8 +107,6 @@ module Cwmp
107
107
  puts "got #{resp.status}, closing"
108
108
  end
109
109
 
110
-
111
110
  end
112
111
 
113
-
114
112
  end
data/lib/cwmp/message.rb CHANGED
@@ -262,9 +262,4 @@ module Cwmp
262
262
  </soap:Envelope>'
263
263
  end
264
264
  end
265
- end
266
-
267
-
268
- # puts Moses::Message::inform_response
269
- # puts Moses::Message::get_parameter_values ["Device.", "as"]
270
- # puts Moses::Message::set_parameter_values [["Device.Time", "now"], ["Device.Harder", "asdasdasd"]]
265
+ end
data/lib/cwmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cwmp
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cwmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Cervasio
@@ -130,6 +130,26 @@ dependencies:
130
130
  - - ! '>='
131
131
  - !ruby/object:Gem::Version
132
132
  version: 0.6.2
133
+ - !ruby/object:Gem::Dependency
134
+ name: httpclient
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ~>
138
+ - !ruby/object:Gem::Version
139
+ version: '2.4'
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: 2.4.0
143
+ type: :runtime
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ version: '2.4'
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: 2.4.0
133
153
  description: A ruby library to parse and generate CWMP messages. Includes a CPE simulator
134
154
  and a simple ACS server.
135
155
  email: luca.cervasio@gmail.com