oui-offline 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +20 -2
- data/lib/oui.rb +9 -5
- data/oui-offline.gemspec +1 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef710b1686ae31c0fd80f1f364280b877b262a14
|
4
|
+
data.tar.gz: 97802c5b54fcfe26df0654382a5943b860292eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c72a04ee773060a2d3923456a4fe50b3c467066a313262025b3b05ba7da40317754b1d7d51dbd51076fd283d942f28d6407c6eaefa1114f8ba48deac81d9142
|
7
|
+
data.tar.gz: edfd1c36ed5b737bd8a88136bcd00333752fef82e30b588ce71ec50c930d0a10b9119dbade4febb574c42a644f6d7f930ddb35e281ad2927791039458704c15e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -14,10 +14,24 @@
|
|
14
14
|
}
|
15
15
|
|
16
16
|
## Installation
|
17
|
+
### Gem (insecure installation)
|
18
|
+
|
19
|
+
```shell
|
20
|
+
[sudo] gem install oui-offline
|
21
|
+
```
|
22
|
+
### Gem (secure installation)
|
23
|
+
|
24
|
+
```shell
|
25
|
+
[sudo] gem cert --add <(curl -L https://gist.github.com/steakknife/5333881/raw/gem-public_cert.pem) # add my cert (do once)
|
26
|
+
[sudo] gem install -P HighSecurity oui-offline
|
27
|
+
```
|
28
|
+
|
29
|
+
See also: [waxseal](https://github.com/steakknife/waxseal)
|
30
|
+
|
17
31
|
### Bundler Installation
|
18
32
|
|
19
33
|
```ruby
|
20
|
-
gem 'oui', git: 'https://github.com/steakknife/oui.git'
|
34
|
+
gem 'oui-offline', git: 'https://github.com/steakknife/oui.git'
|
21
35
|
```
|
22
36
|
|
23
37
|
### Manual Installation
|
@@ -29,9 +43,13 @@ gem 'oui', git: 'https://github.com/steakknife/oui.git'
|
|
29
43
|
gem install *.gem
|
30
44
|
|
31
45
|
|
46
|
+
## Lookup an OUI from CLI
|
47
|
+
|
48
|
+
`oui lookup ABCDEF`
|
49
|
+
|
32
50
|
## Data
|
33
51
|
|
34
|
-
Database sourced from the public IEEE list, but it can be rebuilt anytime by running `
|
52
|
+
Database sourced from the public IEEE list, but it can be rebuilt anytime by running `oui update` or `OUI.update_db`
|
35
53
|
|
36
54
|
## License
|
37
55
|
|
data/lib/oui.rb
CHANGED
@@ -85,7 +85,7 @@ module OUI
|
|
85
85
|
if IN_MEMORY_ONLY
|
86
86
|
Sequel.sqlite # in-memory sqlite database
|
87
87
|
else
|
88
|
-
|
88
|
+
debug "Connecting to db file #{LOCAL_DB}"
|
89
89
|
connect_file_db LOCAL_DB
|
90
90
|
end
|
91
91
|
end
|
@@ -188,7 +188,7 @@ module OUI
|
|
188
188
|
end
|
189
189
|
|
190
190
|
def fetch
|
191
|
-
|
191
|
+
debug "Fetching #{OUI_URL}"
|
192
192
|
open(OUI_URL).read
|
193
193
|
end
|
194
194
|
|
@@ -208,9 +208,9 @@ module OUI
|
|
208
208
|
lines = fetch.split("\n").map { |x| x.sub(/\r$/, '') }
|
209
209
|
parse_lines_into_groups(lines).each_with_index do |group, idx|
|
210
210
|
create_from_line_group(group)
|
211
|
-
|
211
|
+
debug "#{ERASE_LINE}Created records #{idx}" if idx % 1000 == 0
|
212
212
|
end.count
|
213
|
-
|
213
|
+
debug "#{ERASE_LINE}#{BLANK_LINE}"
|
214
214
|
end
|
215
215
|
|
216
216
|
# Expected duplicates are 00-01-C8 (2x) and 08-00-30 (3x)
|
@@ -223,11 +223,15 @@ module OUI
|
|
223
223
|
@added ||= {}
|
224
224
|
end
|
225
225
|
|
226
|
+
def debug(*args)
|
227
|
+
$stderr.puts(*args) if $DEBUG
|
228
|
+
end
|
229
|
+
|
226
230
|
def create_unless_present(opts)
|
227
231
|
id = opts[:id]
|
228
232
|
if added[id]
|
229
233
|
unless expected_duplicate? id
|
230
|
-
|
234
|
+
debug "OUI unexpected duplicate #{opts}"
|
231
235
|
end
|
232
236
|
else
|
233
237
|
table.insert(opts)
|
data/oui-offline.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification::new do |s|
|
2
2
|
s.name = 'oui-offline'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.1'
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.summary = 'Organizationally Unique Idenitfiers (OUI)'
|
6
6
|
s.description = 'Organizationally Unique Idenitfiers (OUI) offline database'
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|