tinc_scanner 1.0.0 → 1.0.1
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/bin/tinc_scanner +1 -1
- data/lib/tinc_scanner/errors.rb +6 -8
- data/lib/tinc_scanner/tinc_metaconnection.rb +2 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e4cff159b11e2205e4316a7648e0aacd0906d7897e856dd9bb3b41ccac56c4f
|
4
|
+
data.tar.gz: 85a45a000f7460a9d87229b6b3b8aab283f9c786dddd468a460bc7e0ef6245d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c81127ed0b23349431d4a4f2bead385ac1704605b5707bb310a1d35ade6fbdab421e18ba11358ae2bfa6b8c0138a3c831971521151dc6fdbf6fe0bbc8a7d3f49
|
7
|
+
data.tar.gz: 0d0085f82af0fa0174574fef8f851482e096cc10820446849389f96d5524da32c333c0c78031f6e0f5a89c02a634c97e7822522dfa328673d73d28a9aabd634c
|
data/bin/tinc_scanner
CHANGED
data/lib/tinc_scanner/errors.rb
CHANGED
@@ -4,14 +4,12 @@
|
|
4
4
|
# Provides a Tinc scanner that attempts to determine the protocol version used
|
5
5
|
# and the remote node name via Tinc's legacy authentication protocol.
|
6
6
|
module TincScanner
|
7
|
+
# General Tinc Error
|
8
|
+
class TincError < StandardError; end
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
# Error connecting to the Tinc daemon
|
12
|
-
class TincConnectionError < TincError; end
|
13
|
-
|
14
|
-
# Incorrect or unexpected message received in response
|
15
|
-
class InvalidTincMessageError < TincError; end
|
10
|
+
# Error connecting to the Tinc daemon
|
11
|
+
class TincConnectionError < TincError; end
|
16
12
|
|
13
|
+
# Incorrect or unexpected message received in response
|
14
|
+
class InvalidTincMessageError < TincError; end
|
17
15
|
end
|
@@ -4,17 +4,15 @@
|
|
4
4
|
# Provides a Tinc scanner that attempts to determine the protocol version used
|
5
5
|
# and the remote node name via Tinc's legacy authentication protocol.
|
6
6
|
module TincScanner
|
7
|
-
|
8
7
|
# Represents a Tinc Metaconnection that has been set up with the
|
9
8
|
# Legacy Authentication Protocol
|
10
9
|
class TincMetaconnection
|
11
|
-
|
12
10
|
require 'socket'
|
13
11
|
require_relative 'errors'
|
14
12
|
|
15
13
|
# Initializes a Tinc metaconnection
|
16
14
|
#
|
17
|
-
# @param host [String]
|
15
|
+
# @param host [String]
|
18
16
|
# @param port [Integer]
|
19
17
|
def initialize(host, port = 123)
|
20
18
|
raise ArgumentError, 'Host must be a string' unless host.is_a? String
|
@@ -37,7 +35,7 @@ module TincScanner
|
|
37
35
|
def receive_id
|
38
36
|
answer = @socket.gets
|
39
37
|
answer.chomp!
|
40
|
-
request_code, *request = answer.split
|
38
|
+
request_code, *request = answer.split
|
41
39
|
|
42
40
|
raise InvalidTincMessageError, "Request code is not 0: #{request_code}" unless request_code == '0'
|
43
41
|
|
@@ -50,7 +48,5 @@ module TincScanner
|
|
50
48
|
|
51
49
|
return result
|
52
50
|
end
|
53
|
-
|
54
51
|
end
|
55
|
-
|
56
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinc_scanner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Küthe
|
@@ -27,7 +27,7 @@ files:
|
|
27
27
|
- lib/tinc_scanner/tinc_metaconnection.rb
|
28
28
|
homepage: https://codeberg.org/mark22k/tinc_scanner
|
29
29
|
licenses:
|
30
|
-
-
|
30
|
+
- GPL-3.0-or-later
|
31
31
|
metadata:
|
32
32
|
source_code_uri: https://codeberg.org/mark22k/tinc_scanner
|
33
33
|
bug_tracker_uri: https://codeberg.org/mark22k/tinc_scanner/issues
|