netsnmp 0.1.5 → 0.2.0
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 +4 -4
- data/README.md +17 -21
- data/lib/netsnmp.rb +12 -0
- data/lib/netsnmp/client.rb +2 -3
- data/lib/netsnmp/oid.rb +3 -2
- data/lib/netsnmp/pdu.rb +4 -4
- data/lib/netsnmp/scoped_pdu.rb +2 -0
- data/lib/netsnmp/security_parameters.rb +3 -3
- data/lib/netsnmp/session.rb +5 -16
- data/lib/netsnmp/v3_session.rb +5 -3
- data/lib/netsnmp/varbind.rb +28 -9
- data/lib/netsnmp/version.rb +1 -1
- data/sig/client.rbs +24 -0
- data/sig/message.rbs +7 -0
- data/sig/netsnmp.rbs +23 -0
- data/sig/oid.rbs +18 -0
- data/sig/openssl.rbs +20 -0
- data/sig/pdu.rbs +48 -0
- data/sig/scoped_pdu.rbs +15 -0
- data/sig/security_parameters.rbs +56 -0
- data/sig/session.rbs +36 -0
- data/sig/timeticks.rbs +7 -0
- data/sig/v3_session.rbs +21 -0
- data/sig/varbind.rbs +30 -0
- data/spec/client_spec.rb +2 -2
- data/spec/handlers/celluloid_spec.rb +3 -2
- data/spec/session_spec.rb +2 -2
- data/spec/spec_helper.rb +7 -4
- data/spec/support/request_examples.rb +2 -2
- data/spec/v3_session_spec.rb +4 -4
- data/spec/varbind_spec.rb +100 -3
- metadata +26 -90
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -14
- data/.rspec +0 -2
- data/.rubocop.yml +0 -11
- data/.rubocop_todo.yml +0 -69
- data/.travis.yml +0 -32
- data/Gemfile +0 -22
- data/Rakefile +0 -30
- data/netsnmp.gemspec +0 -31
- data/spec/support/Dockerfile +0 -14
- data/spec/support/specs.sh +0 -51
- data/spec/support/stop_docker.sh +0 -5
metadata
CHANGED
@@ -1,75 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netsnmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Cardoso
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '10.1'
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 10.1.0
|
23
|
-
type: :development
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '10.1'
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 10.1.0
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rspec
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '3.5'
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 3.5.0
|
43
|
-
type: :development
|
44
|
-
prerelease: false
|
45
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '3.5'
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 3.5.0
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: celluloid-io
|
55
|
-
requirement: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '0.17'
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 0.17.2
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0.17'
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 0.17.2
|
11
|
+
date: 2020-12-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
73
13
|
description: |2
|
74
14
|
Wraps the net-snmp core usage into idiomatic ruby.
|
75
15
|
It is designed to support as many environments and concurrency frameworks as possible.
|
@@ -78,17 +18,9 @@ executables: []
|
|
78
18
|
extensions: []
|
79
19
|
extra_rdoc_files: []
|
80
20
|
files:
|
81
|
-
- ".coveralls.yml"
|
82
|
-
- ".gitignore"
|
83
|
-
- ".rspec"
|
84
|
-
- ".rubocop.yml"
|
85
|
-
- ".rubocop_todo.yml"
|
86
|
-
- ".travis.yml"
|
87
21
|
- AUTHORS
|
88
|
-
- Gemfile
|
89
22
|
- LICENSE.txt
|
90
23
|
- README.md
|
91
|
-
- Rakefile
|
92
24
|
- lib/netsnmp.rb
|
93
25
|
- lib/netsnmp/client.rb
|
94
26
|
- lib/netsnmp/encryption/aes.rb
|
@@ -105,7 +37,18 @@ files:
|
|
105
37
|
- lib/netsnmp/v3_session.rb
|
106
38
|
- lib/netsnmp/varbind.rb
|
107
39
|
- lib/netsnmp/version.rb
|
108
|
-
-
|
40
|
+
- sig/client.rbs
|
41
|
+
- sig/message.rbs
|
42
|
+
- sig/netsnmp.rbs
|
43
|
+
- sig/oid.rbs
|
44
|
+
- sig/openssl.rbs
|
45
|
+
- sig/pdu.rbs
|
46
|
+
- sig/scoped_pdu.rbs
|
47
|
+
- sig/security_parameters.rbs
|
48
|
+
- sig/session.rbs
|
49
|
+
- sig/timeticks.rbs
|
50
|
+
- sig/v3_session.rbs
|
51
|
+
- sig/varbind.rbs
|
109
52
|
- spec/client_spec.rb
|
110
53
|
- spec/handlers/celluloid_spec.rb
|
111
54
|
- spec/oid_spec.rb
|
@@ -113,11 +56,8 @@ files:
|
|
113
56
|
- spec/security_parameters_spec.rb
|
114
57
|
- spec/session_spec.rb
|
115
58
|
- spec/spec_helper.rb
|
116
|
-
- spec/support/Dockerfile
|
117
59
|
- spec/support/celluloid.rb
|
118
60
|
- spec/support/request_examples.rb
|
119
|
-
- spec/support/specs.sh
|
120
|
-
- spec/support/stop_docker.sh
|
121
61
|
- spec/timeticks_spec.rb
|
122
62
|
- spec/v3_session_spec.rb
|
123
63
|
- spec/varbind_spec.rb
|
@@ -126,7 +66,7 @@ licenses:
|
|
126
66
|
- Apache-2.0
|
127
67
|
metadata:
|
128
68
|
allowed_push_host: https://rubygems.org/
|
129
|
-
post_install_message:
|
69
|
+
post_install_message:
|
130
70
|
rdoc_options: []
|
131
71
|
require_paths:
|
132
72
|
- lib
|
@@ -142,24 +82,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
82
|
version: '0'
|
143
83
|
requirements:
|
144
84
|
- net-snmp
|
145
|
-
|
146
|
-
|
147
|
-
signing_key:
|
85
|
+
rubygems_version: 3.1.4
|
86
|
+
signing_key:
|
148
87
|
specification_version: 4
|
149
88
|
summary: SNMP Client library
|
150
89
|
test_files:
|
90
|
+
- spec/timeticks_spec.rb
|
91
|
+
- spec/spec_helper.rb
|
92
|
+
- spec/session_spec.rb
|
151
93
|
- spec/client_spec.rb
|
152
|
-
- spec/handlers/celluloid_spec.rb
|
153
94
|
- spec/oid_spec.rb
|
95
|
+
- spec/varbind_spec.rb
|
96
|
+
- spec/support/request_examples.rb
|
97
|
+
- spec/support/celluloid.rb
|
154
98
|
- spec/pdu_spec.rb
|
155
99
|
- spec/security_parameters_spec.rb
|
156
|
-
- spec/session_spec.rb
|
157
|
-
- spec/spec_helper.rb
|
158
|
-
- spec/support/Dockerfile
|
159
|
-
- spec/support/celluloid.rb
|
160
|
-
- spec/support/request_examples.rb
|
161
|
-
- spec/support/specs.sh
|
162
|
-
- spec/support/stop_docker.sh
|
163
|
-
- spec/timeticks_spec.rb
|
164
100
|
- spec/v3_session_spec.rb
|
165
|
-
- spec/
|
101
|
+
- spec/handlers/celluloid_spec.rb
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.rubocop_todo.yml
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2018-02-07 22:49:11 +0000 using RuboCop version 0.52.1.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
Metrics/BlockLength:
|
10
|
-
Max: 200
|
11
|
-
|
12
|
-
# Offense count: 17
|
13
|
-
Metrics/AbcSize:
|
14
|
-
Max: 27
|
15
|
-
|
16
|
-
# Offense count: 2
|
17
|
-
# Configuration parameters: CountComments.
|
18
|
-
Metrics/ClassLength:
|
19
|
-
Max: 150
|
20
|
-
|
21
|
-
# Offense count: 8
|
22
|
-
Metrics/CyclomaticComplexity:
|
23
|
-
Max: 20
|
24
|
-
|
25
|
-
# Offense count: 22
|
26
|
-
# Configuration parameters: CountComments.
|
27
|
-
Metrics/MethodLength:
|
28
|
-
Max: 30
|
29
|
-
|
30
|
-
# Offense count: 2
|
31
|
-
# Configuration parameters: CountKeywordArgs.
|
32
|
-
Metrics/ParameterLists:
|
33
|
-
Max: 7
|
34
|
-
|
35
|
-
# Offense count: 1
|
36
|
-
Metrics/PerceivedComplexity:
|
37
|
-
Max: 9
|
38
|
-
|
39
|
-
# Offense count: 10
|
40
|
-
Style/Documentation:
|
41
|
-
Exclude:
|
42
|
-
- 'spec/**/*'
|
43
|
-
- 'test/**/*'
|
44
|
-
- 'lib/netsnmp.rb'
|
45
|
-
- 'lib/netsnmp/encryption/aes.rb'
|
46
|
-
- 'lib/netsnmp/encryption/des.rb'
|
47
|
-
- 'lib/netsnmp/encryption/none.rb'
|
48
|
-
- 'lib/netsnmp/scoped_pdu.rb'
|
49
|
-
- 'lib/netsnmp/session.rb'
|
50
|
-
- 'lib/netsnmp/timeticks.rb'
|
51
|
-
|
52
|
-
# Offense count: 8
|
53
|
-
# Cop supports --auto-correct.
|
54
|
-
# Configuration parameters: Strict.
|
55
|
-
Style/NumericLiterals:
|
56
|
-
MinDigits: 11
|
57
|
-
|
58
|
-
# Offense count: 264
|
59
|
-
# Cop supports --auto-correct.
|
60
|
-
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
61
|
-
# SupportedStyles: single_quotes, double_quotes
|
62
|
-
Style/StringLiterals:
|
63
|
-
EnforcedStyle: double_quotes
|
64
|
-
|
65
|
-
# Offense count: 112
|
66
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
67
|
-
# URISchemes: http, https
|
68
|
-
Metrics/LineLength:
|
69
|
-
Max: 189
|
data/.travis.yml
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
sudo: required
|
2
|
-
services:
|
3
|
-
- docker
|
4
|
-
|
5
|
-
before_install:
|
6
|
-
- sudo apt-add-repository multiverse
|
7
|
-
- sudo apt-get update
|
8
|
-
- sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-ce
|
9
|
-
|
10
|
-
install:
|
11
|
-
- gem update --system
|
12
|
-
- bundle install --path .bundle
|
13
|
-
|
14
|
-
script:
|
15
|
-
- spec/support/specs.sh run
|
16
|
-
|
17
|
-
language: ruby
|
18
|
-
rvm:
|
19
|
-
- 2.1
|
20
|
-
- 2.2
|
21
|
-
- 2.3
|
22
|
-
- 2.4
|
23
|
-
- 2.5
|
24
|
-
- ruby-head
|
25
|
-
- jruby-head
|
26
|
-
- rbx-2
|
27
|
-
matrix:
|
28
|
-
allow_failures:
|
29
|
-
- rvm: ruby-head
|
30
|
-
- rvm: jruby-head
|
31
|
-
# to figure out later
|
32
|
-
- rvm: rbx-2
|
data/Gemfile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org/"
|
4
|
-
ruby RUBY_VERSION
|
5
|
-
|
6
|
-
gemspec
|
7
|
-
|
8
|
-
gem "coveralls", require: false
|
9
|
-
|
10
|
-
group :development do
|
11
|
-
gem "pry"
|
12
|
-
end
|
13
|
-
|
14
|
-
gem "nio4r", "~> 1.2" if RUBY_VERSION < "2.2"
|
15
|
-
|
16
|
-
platforms :mri do
|
17
|
-
gem "pry-byebug", require: false
|
18
|
-
gem "stackprof", require: false
|
19
|
-
gem "xorcist", require: false
|
20
|
-
end
|
21
|
-
|
22
|
-
gem "rubocop", "0.52.1", require: false
|
data/Rakefile
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
require "rspec/core/rake_task"
|
5
|
-
require "coveralls/rake/task"
|
6
|
-
require "rubocop/rake_task"
|
7
|
-
|
8
|
-
desc "runs the tests and sends to coveralls server"
|
9
|
-
Coveralls::RakeTask.new
|
10
|
-
|
11
|
-
desc "runs the tests"
|
12
|
-
RSpec::Core::RakeTask.new
|
13
|
-
|
14
|
-
desc "Run rubocop"
|
15
|
-
task :rubocop do
|
16
|
-
RuboCop::RakeTask.new
|
17
|
-
end
|
18
|
-
|
19
|
-
task default: [:spec]
|
20
|
-
|
21
|
-
namespace :spec do
|
22
|
-
desc "runs the tests in coverage mode"
|
23
|
-
task :coverage do
|
24
|
-
ENV["COVERAGE"] = "true"
|
25
|
-
Rake::Task["spec"].execute
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "runs tests, check coverage, pushes to coverage server"
|
29
|
-
task ci: ["spec:coverage", "coveralls:push", "rubocop"]
|
30
|
-
end
|
data/netsnmp.gemspec
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require File.expand_path("../lib/netsnmp/version", __FILE__)
|
4
|
-
|
5
|
-
Gem::Specification.new do |gem|
|
6
|
-
gem.name = "netsnmp"
|
7
|
-
gem.summary = "SNMP Client library"
|
8
|
-
gem.description = <<-DESC
|
9
|
-
Wraps the net-snmp core usage into idiomatic ruby.
|
10
|
-
It is designed to support as many environments and concurrency frameworks as possible.
|
11
|
-
DESC
|
12
|
-
gem.requirements = ["net-snmp"]
|
13
|
-
gem.version = NETSNMP::VERSION
|
14
|
-
gem.license = "Apache-2.0"
|
15
|
-
gem.authors = ["Tiago Cardoso"]
|
16
|
-
gem.email = "cardoso_tiago@hotmail.com"
|
17
|
-
gem.homepage = ""
|
18
|
-
gem.platform = Gem::Platform::RUBY
|
19
|
-
gem.metadata["allowed_push_host"] = "https://rubygems.org/"
|
20
|
-
|
21
|
-
# Manifest
|
22
|
-
gem.files = `git ls-files`.split("\n") - Dir["tmp/**/*"]
|
23
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
24
|
-
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
25
|
-
gem.require_paths = ["lib"]
|
26
|
-
|
27
|
-
gem.add_development_dependency "rake", ["~> 10.1", ">= 10.1.0"]
|
28
|
-
gem.add_development_dependency "rspec", ["~> 3.5", ">= 3.5.0"]
|
29
|
-
|
30
|
-
gem.add_development_dependency "celluloid-io", ["~> 0.17", ">= 0.17.2"]
|
31
|
-
end
|
data/spec/support/Dockerfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
FROM python:2.7-alpine
|
2
|
-
Maintainer Tiago Cardoso <cardoso_tiago@hotmail.com>
|
3
|
-
|
4
|
-
RUN easy_install snmpsim==0.3.0
|
5
|
-
RUN easy_install pycrypto==2.6.1
|
6
|
-
EXPOSE 1161
|
7
|
-
# Create non-privileged user
|
8
|
-
RUN useradd -m snmp_server
|
9
|
-
|
10
|
-
|
11
|
-
USER snmp_server
|
12
|
-
ENTRYPOINT ["/usr/local/bin/snmpsimd.py"]
|
13
|
-
|
14
|
-
CMD ["--help"]
|
data/spec/support/specs.sh
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
function start {
|
4
|
-
docker pull honeyryderchuck/snmp-server-emulator:latest
|
5
|
-
docker run -d -p :1161/udp --name test-snmp -v $(pwd)/spec/support/snmpsim:/home/snmp_server/.snmpsim honeyryderchuck/snmp-server-emulator \
|
6
|
-
--v3-engine-id=000000000000000000000002 \
|
7
|
-
--agent-udpv4-endpoint=0.0.0.0:1161 --agent-udpv6-endpoint='[::0]:1161' \
|
8
|
-
--v3-user=simulator --v3-auth-key=auctoritas --v3-priv-key=privatus \
|
9
|
-
--v3-user=authmd5 --v3-auth-key=maplesyrup --v3-auth-proto=MD5 --v3-priv-proto=NONE \
|
10
|
-
--v3-user=authsha --v3-auth-key=maplesyrup --v3-auth-proto=SHA --v3-priv-proto=NONE \
|
11
|
-
--v3-user=authprivshaaes --v3-auth-key=maplesyrup --v3-auth-proto=SHA \
|
12
|
-
--v3-priv-key=maplesyrup --v3-priv-proto=AES \
|
13
|
-
--v3-user=authprivmd5aes --v3-auth-key=maplesyrup --v3-auth-proto=MD5 \
|
14
|
-
--v3-priv-key=maplesyrup --v3-priv-proto=AES \
|
15
|
-
--v3-user=authprivshades --v3-auth-key=maplesyrup --v3-auth-proto=SHA \
|
16
|
-
--v3-priv-key=maplesyrup --v3-priv-proto=DES \
|
17
|
-
--v3-user=authprivmd5des --v3-auth-key=maplesyrup --v3-auth-proto=MD5 \
|
18
|
-
--v3-priv-key=maplesyrup --v3-priv-proto=DES \
|
19
|
-
--v3-user=unsafe --v3-auth-proto=NONE --v3-priv-proto=NONE
|
20
|
-
|
21
|
-
}
|
22
|
-
|
23
|
-
function run {
|
24
|
-
sleep 20 # give some time for the simulator to boot
|
25
|
-
|
26
|
-
port="$(docker port test-snmp 1161/udp)"
|
27
|
-
export SNMP_PORT=$(echo $port | cut -d':' -f2)
|
28
|
-
|
29
|
-
bundle exec rake spec:ci
|
30
|
-
}
|
31
|
-
|
32
|
-
function finish {
|
33
|
-
docker stop test-snmp
|
34
|
-
docker rm test-snmp
|
35
|
-
}
|
36
|
-
|
37
|
-
trap finish EXIT
|
38
|
-
|
39
|
-
case "$1" in
|
40
|
-
start)
|
41
|
-
start
|
42
|
-
docker logs -f test-snmp
|
43
|
-
;;
|
44
|
-
run)
|
45
|
-
start
|
46
|
-
run
|
47
|
-
;;
|
48
|
-
*)
|
49
|
-
echo $"Usage: $0 {start|run}"
|
50
|
-
exit 1
|
51
|
-
esac
|