sctp-socket 0.1.0 → 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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ruby.yml +37 -0
- data/CHANGES.md +16 -0
- data/README.md +16 -6
- data/Rakefile +11 -0
- data/ext/sctp/extconf.rb +20 -3
- data/ext/sctp/socket.c +941 -254
- data/sctp-socket.gemspec +3 -2
- data.tar.gz.sig +0 -0
- metadata +5 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d20d26ad8e90c5673d4d126da8daa8f69d907a54ba0ddc9caf529ef5929c6e
|
4
|
+
data.tar.gz: 886d28171c2e7242a7875b7a998e7073a9bec469da7da5b9205859a4e2d3e257
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee23fbff8da2e3efa66f87f583ba1f631d39957a6f74bff530d1b71ae1a15ab773ecb6653f34d8d5e17e034a15f6a736c90a16f3c8f3ed636734ab674dee54ca
|
7
|
+
data.tar.gz: 68ff54d9088bfe723f0726c3bcc41c102aab7c3f631f1156f64651bd078ffa1a852b247505a4babf36cb37c61aa11726587db407ad34171c974b6afca96283a8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,37 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
paths-ignore:
|
7
|
+
- '**/*.md'
|
8
|
+
pull_request:
|
9
|
+
branches: [ main ]
|
10
|
+
paths-ignore:
|
11
|
+
- '**/*.md'
|
12
|
+
workflow_dispatch:
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
test:
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
strategy:
|
18
|
+
matrix:
|
19
|
+
ruby-version: ['3.2', '3.3']
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v4
|
22
|
+
- name: Install SCTP headers
|
23
|
+
run: |
|
24
|
+
sudo apt-get install libsctp-dev lksctp-tools
|
25
|
+
sudo ip link add dummy1 type dummy
|
26
|
+
sudo ip link add dummy2 type dummy
|
27
|
+
sudo ip addr add 1.1.1.1/24 dev dummy1
|
28
|
+
sudo ip addr add 1.1.1.2/24 dev dummy2
|
29
|
+
sudo ip link set dummy1 up
|
30
|
+
sudo ip link set dummy2 up
|
31
|
+
- name: Setup Ruby
|
32
|
+
uses: ruby/setup-ruby@v1
|
33
|
+
with:
|
34
|
+
ruby-version: ${{ matrix.ruby-version }}
|
35
|
+
bundler-cache: true
|
36
|
+
- name: Run Specs
|
37
|
+
run: bundle exec rake
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## 0.1.2 - 10-Jan-2025
|
2
|
+
* Added support for BSD.
|
3
|
+
|
4
|
+
## 0.1.1 - 1-Jan-2025
|
5
|
+
* Added the set_shared_key method.
|
6
|
+
* Added the get_active_shared_key and set_active_shared_key methods.
|
7
|
+
* Added the get_initmsg method.
|
8
|
+
* Added autoclose getter and setter methods.
|
9
|
+
* Added the enable_auth_support method.
|
10
|
+
* Added methods for getting, setting or deleting a shared key.
|
11
|
+
* Added the map_ipv4 method.
|
12
|
+
* Updated the get_peer_address_params method to include more info.
|
13
|
+
* Many comment additions and updates.
|
14
|
+
* Added a rake task to create dummy IP addresses for testing.
|
15
|
+
* Added a funding_uri to the gemspec.
|
16
|
+
|
1
17
|
## 0.1.0 - 31-May-2024
|
2
18
|
* Added support for sender dry events.
|
3
19
|
* Added the get_peer_address_params method.
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://github.com/djberg96/sctp-socket/actions/workflows/ruby.yml)
|
2
|
+
|
1
3
|
## Description
|
2
4
|
|
3
5
|
A Ruby interface for SCTP sockets.
|
@@ -55,16 +57,22 @@ end
|
|
55
57
|
|
56
58
|
## Future Plans
|
57
59
|
|
58
|
-
* Add more constants.
|
59
60
|
* Add more specs.
|
60
|
-
*
|
61
|
+
* Subclass the Socket class (but see known issues below).
|
62
|
+
* Create a wrapper for the usrlibsctp implementation using FFI.
|
61
63
|
|
62
64
|
## Known Issues
|
63
65
|
|
64
|
-
Currently this has only been developed and tested on Linux. Other
|
65
|
-
will probably only be supported via community contributions.
|
66
|
+
Currently this has only been developed and tested on Linux and BSD. Other
|
67
|
+
platforms will probably only be supported via community contributions.
|
68
|
+
|
69
|
+
The sendv and recvv methods may not be available. Use the sendmsg and recvmsg
|
70
|
+
methods instead.
|
66
71
|
|
67
|
-
|
72
|
+
I am currently unable to subclass the Socket class from Ruby's standard library.
|
73
|
+
For whatever reason the call to rb_call_super works, but the fileno is always
|
74
|
+
set to nil. I think it's getting confused by the IPPROTO_SCTP value for the
|
75
|
+
protocol, but I haven't nailed it down yet.
|
68
76
|
|
69
77
|
Please report any issues on the github project page.
|
70
78
|
|
@@ -75,6 +83,8 @@ Please report any issues on the github project page.
|
|
75
83
|
* https://www.linuxjournal.com/article/9748
|
76
84
|
* https://www.linuxjournal.com/article/9749
|
77
85
|
* https://www.linuxjournal.com/article/9784
|
86
|
+
* SCTP in Theory and Practice - Svetomir Dimitrov
|
87
|
+
* Stream Control Transmission Protocol (A Reference Guide) - Randall Stewart and Qiaobing Xie
|
78
88
|
|
79
89
|
## License
|
80
90
|
|
@@ -82,7 +92,7 @@ Apache-2.0
|
|
82
92
|
|
83
93
|
## Copyright
|
84
94
|
|
85
|
-
(C) 2020-
|
95
|
+
(C) 2020-2025, Daniel J. Berger
|
86
96
|
Al Rights Reserved
|
87
97
|
|
88
98
|
## Author
|
data/Rakefile
CHANGED
@@ -37,6 +37,17 @@ Rake::ExtensionTask.new('socket') do |t|
|
|
37
37
|
t.lib_dir = 'lib/sctp'
|
38
38
|
end
|
39
39
|
|
40
|
+
desc "Create dummy IP addresses to use for testing"
|
41
|
+
task :create_dummy_links do
|
42
|
+
system('sudo ip link add dummy1 type dummy')
|
43
|
+
system('sudo ip link add dummy2 type dummy')
|
44
|
+
system('sudo ip addr add 1.1.1.1/24 dev dummy1')
|
45
|
+
system('sudo ip addr add 1.1.1.2/24 dev dummy2')
|
46
|
+
system('sudo ip link set dummy1 up')
|
47
|
+
system('sudo ip link set dummy2 up')
|
48
|
+
system('ip link show')
|
49
|
+
end
|
50
|
+
|
40
51
|
RSpec::Core::RakeTask.new
|
41
52
|
|
42
53
|
task :spec => :compile
|
data/ext/sctp/extconf.rb
CHANGED
@@ -24,8 +24,25 @@ unless have_header('netinet/sctp.h')
|
|
24
24
|
exit
|
25
25
|
end
|
26
26
|
|
27
|
+
header = 'netinet/sctp.h'
|
28
|
+
|
27
29
|
have_library('sctp')
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
|
31
|
+
have_header('sys/param.h')
|
32
|
+
|
33
|
+
have_func('sctp_sendv', header)
|
34
|
+
have_func('sctp_recvv', header)
|
35
|
+
|
36
|
+
have_struct_member('struct sctp_event_subscribe', 'sctp_send_failure_event', header)
|
37
|
+
have_struct_member('struct sctp_event_subscribe', 'sctp_stream_reset_event', header)
|
38
|
+
have_struct_member('struct sctp_event_subscribe', 'sctp_assoc_reset_event', header)
|
39
|
+
have_struct_member('struct sctp_event_subscribe', 'sctp_stream_change_event', header)
|
40
|
+
have_struct_member('struct sctp_event_subscribe', 'sctp_send_failure_event_event', header)
|
41
|
+
|
42
|
+
have_struct_member('struct sctp_send_failed_event', 'ssfe_length', header)
|
43
|
+
|
44
|
+
have_struct_member('union sctp_notification', 'sn_auth_event', header)
|
45
|
+
|
46
|
+
have_const('SCTP_EMPTY', header)
|
47
|
+
|
31
48
|
create_makefile('sctp/socket')
|