protocol-quic 0.0.2 → 0.0.3

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/ext/source/Protocol/QUIC/Address.cpp +122 -0
  4. data/ext/source/Protocol/QUIC/Address.hpp +30 -0
  5. data/ext/source/Protocol/QUIC/Client.cpp +157 -0
  6. data/ext/source/Protocol/QUIC/Client.hpp +27 -0
  7. data/ext/source/Protocol/QUIC/Configuration.cpp +74 -0
  8. data/ext/source/Protocol/QUIC/Configuration.hpp +27 -0
  9. data/ext/source/Protocol/QUIC/Connection.cpp +50 -0
  10. data/ext/source/Protocol/QUIC/Connection.hpp +29 -0
  11. data/ext/source/Protocol/QUIC/Dispatcher.cpp +190 -0
  12. data/ext/source/Protocol/QUIC/Dispatcher.hpp +27 -0
  13. data/ext/source/Protocol/QUIC/PacketHeader.cpp +59 -0
  14. data/ext/source/Protocol/QUIC/PacketHeader.hpp +29 -0
  15. data/ext/source/Protocol/QUIC/Reference.hpp +31 -0
  16. data/ext/source/Protocol/QUIC/Server.cpp +165 -0
  17. data/ext/source/Protocol/QUIC/Server.hpp +27 -0
  18. data/ext/source/Protocol/QUIC/Socket.cpp +103 -0
  19. data/ext/source/Protocol/QUIC/Socket.hpp +29 -0
  20. data/ext/source/Protocol/QUIC/Stream.cpp +96 -0
  21. data/ext/source/Protocol/QUIC/Stream.hpp +29 -0
  22. data/ext/source/Protocol/QUIC/TLS/ClientContext.cpp +61 -0
  23. data/ext/source/Protocol/QUIC/TLS/ClientContext.hpp +27 -0
  24. data/ext/source/Protocol/QUIC/TLS/Context.cpp +116 -0
  25. data/ext/source/Protocol/QUIC/TLS/Context.hpp +27 -0
  26. data/ext/source/Protocol/QUIC/TLS/ServerContext.cpp +61 -0
  27. data/ext/source/Protocol/QUIC/TLS/ServerContext.hpp +27 -0
  28. data/ext/source/Protocol/QUIC.cpp +36 -0
  29. data/ext/source/Protocol/QUIC.hpp +15 -0
  30. data/lib/protocol/quic/version.rb +1 -1
  31. data.tar.gz.sig +0 -0
  32. metadata +28 -1
  33. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3b7b2ca3d192e58b1004b5195ced702d8fa037ed0c1e0e6c16d102117f10ec1
4
- data.tar.gz: 90843655fcb8333c7e5d8b3726f6cf8e692a2aae742d767ce5c081b60865acc4
3
+ metadata.gz: 8b501288cde394d030bb3d0ae6e035ee4feae69424eaec58e5dd3e94f1c85bb9
4
+ data.tar.gz: 1be70108b32ee82f49f5c14e04f7db4e2205bfb2ba9344501663cf69a37f5824
5
5
  SHA512:
6
- metadata.gz: 1dc64d53db85dae62764fffb2235ac691d574a476b7fa90052e32ab64b85adc55b594bc49787fc50291234d0cea92eabf7cc714dbe746edd620a73eebae50bda
7
- data.tar.gz: dae982642da90c173acab712ec31b477a41e66587f40306866e3d4da3f8b1d0443ce029b6dc794422dff769fdf2e1f6b42db7002a3a91b0d391084744e6e271b
6
+ metadata.gz: 5db41a0051307b315912faf24e7a171ff8b4dee2a54181d95e35304e8d5441a63712284a847c4a89e22fb0daecc66543860e79128f2a3230bb3acf24b25cbe80
7
+ data.tar.gz: 989f6ecb3e69779a9d2d88c1b3b2aab2eab212380e8094637cdba58d7b2e92c4e1cc16413ed07c6d09ee646b5b4fad4bda6a2403cf104c31600b9bbab464e6ac
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,122 @@
1
+ //
2
+ // Address.cpp
3
+ // This file is part of the "Protocol::QUIC" project and released under the MIT License.
4
+ //
5
+ // Created by Samuel Williams on 27/4/2023.
6
+ // Copyright, 2023, by Samuel Williams. All rights reserved.
7
+ //
8
+
9
+ #include "Address.hpp"
10
+ #include "ruby/backward/cxxanyargs.hpp"
11
+ #include "ruby/internal/intern/object.h"
12
+
13
+ VALUE Protocol_QUIC_Address = Qnil;
14
+
15
+ static void Protocol_QUIC_Address_free(void *data) {
16
+ if (data) {
17
+ delete reinterpret_cast<Protocol::QUIC::Address *>(data);
18
+ }
19
+ }
20
+
21
+ static size_t Protocol_QUIC_Address_size(const void *data) {
22
+ return sizeof(Protocol::QUIC::Address);
23
+ }
24
+
25
+ const rb_data_type_t Protocol_QUIC_Address_type = {
26
+ .wrap_struct_name = "Protocol::QUIC::Address",
27
+ .function = {
28
+ .dmark = NULL,
29
+ .dfree = Protocol_QUIC_Address_free,
30
+ .dsize = Protocol_QUIC_Address_size,
31
+ },
32
+ .data = NULL,
33
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
34
+ };
35
+
36
+ Protocol::QUIC::Address * Protocol_QUIC_Address_get(VALUE self)
37
+ {
38
+ Protocol::QUIC::Address *address;
39
+
40
+ TypedData_Get_Struct(self, Protocol::QUIC::Address, &Protocol_QUIC_Address_type, address);
41
+
42
+ return address;
43
+ }
44
+
45
+ VALUE Protocol_QUIC_Address_allocate(VALUE klass) {
46
+ return TypedData_Wrap_Struct(klass, &Protocol_QUIC_Address_type, NULL);
47
+ }
48
+
49
+ static VALUE Protocol_QUIC_Address_initialize(VALUE self) {
50
+ DATA_PTR(self) = new Protocol::QUIC::Address();
51
+
52
+ return self;
53
+ }
54
+
55
+ static VALUE Protocol_QUIC_Address_inspect(VALUE self) {
56
+ auto address = Protocol_QUIC_Address_get(self);
57
+ auto string = address->to_string();
58
+
59
+ VALUE class_name = rb_inspect(rb_class_of(self));
60
+
61
+ return rb_sprintf("<%" PRIsVALUE ":%p '%s'>", class_name, (void*)self, string.c_str());
62
+ }
63
+
64
+ static VALUE Protocol_QUIC_Address_family(VALUE self) {
65
+ Protocol::QUIC::Address *address = Protocol_QUIC_Address_get(self);
66
+
67
+ return RB_INT2NUM(address->family());
68
+ }
69
+
70
+ static VALUE Protocol_QUIC_Address_data(VALUE self) {
71
+ Protocol::QUIC::Address *address = Protocol_QUIC_Address_get(self);
72
+
73
+ return rb_str_new((const char *)&address->data.sa, address->length);
74
+ }
75
+
76
+ VALUE Protocol_QUIC_Address_wrap(VALUE klass, const Protocol::QUIC::Address & address)
77
+ {
78
+ VALUE self = Protocol_QUIC_Address_allocate(klass);
79
+ Protocol_QUIC_Address_initialize(self);
80
+
81
+ Protocol::QUIC::Address *data = Protocol_QUIC_Address_get(self);
82
+
83
+ *data = address;
84
+
85
+ return self;
86
+ }
87
+
88
+ VALUE Protocol_QUIC_Address_s_resolve(VALUE klass, VALUE host, VALUE service, VALUE family, VALUE type, VALUE flags)
89
+ {
90
+ StringValue(host);
91
+ StringValue(service);
92
+
93
+ auto addresses = Protocol::QUIC::Address::resolve(
94
+ std::string_view(RSTRING_PTR(host), RSTRING_LEN(host)),
95
+ std::string_view(RSTRING_PTR(service), RSTRING_LEN(service)),
96
+ RB_NUM2INT(family),
97
+ RB_NUM2INT(type),
98
+ RB_NUM2INT(flags)
99
+ );
100
+
101
+ VALUE result = rb_ary_new_capa(addresses.size());
102
+
103
+ for (auto & address : addresses) {
104
+ rb_ary_push(result, Protocol_QUIC_Address_wrap(klass, address));
105
+ }
106
+
107
+ return result;
108
+ }
109
+
110
+ void Init_Protocol_QUIC_Address(VALUE Protocol_QUIC) {
111
+ Protocol_QUIC_Address =
112
+ rb_define_class_under(Protocol_QUIC, "Address", rb_cObject);
113
+
114
+ rb_define_singleton_method(Protocol_QUIC_Address, "resolve", Protocol_QUIC_Address_s_resolve, 5);
115
+
116
+ rb_define_alloc_func(Protocol_QUIC_Address, Protocol_QUIC_Address_allocate);
117
+ rb_define_method(Protocol_QUIC_Address, "initialize", Protocol_QUIC_Address_initialize, 0);
118
+ rb_define_method(Protocol_QUIC_Address, "inspect", Protocol_QUIC_Address_inspect, 0);
119
+
120
+ rb_define_method(Protocol_QUIC_Address, "family", Protocol_QUIC_Address_family, 0);
121
+ rb_define_method(Protocol_QUIC_Address, "data", Protocol_QUIC_Address_data, 0);
122
+ }
@@ -0,0 +1,30 @@
1
+ //
2
+ // Address.hpp
3
+ // This file is part of the "Protocol::QUIC" project and released under the MIT License.
4
+ //
5
+ // Created by Samuel Williams on 27/4/2023.
6
+ // Copyright, 2023, by Samuel Williams. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <ruby.h>
12
+
13
+ #include <Protocol/QUIC/Address.hpp>
14
+
15
+ #ifdef __cplusplus
16
+ extern "C" {
17
+ #endif
18
+
19
+ extern VALUE Protocol_QUIC_Address;
20
+
21
+ void Init_Protocol_QUIC_Address(VALUE Protocol_QUIC);
22
+
23
+ Protocol::QUIC::Address * Protocol_QUIC_Address_get(VALUE self);
24
+
25
+ VALUE Protocol_QUIC_Address_allocate(VALUE klass);
26
+ VALUE Protocol_QUIC_Address_wrap(VALUE klass, const Protocol::QUIC::Address & address);
27
+
28
+ #ifdef __cplusplus
29
+ }
30
+ #endif
@@ -0,0 +1,157 @@
1
+
2
+ #include "Client.hpp"
3
+
4
+ #include "Configuration.hpp"
5
+ #include "TLS/ClientContext.hpp"
6
+ #include "Socket.hpp"
7
+ #include "Address.hpp"
8
+ #include "Stream.hpp"
9
+
10
+ #include <unordered_map>
11
+
12
+ VALUE Protocol_QUIC_Client = Qnil;
13
+
14
+ class RubyClient : public Protocol::QUIC::Client {
15
+ public:
16
+ VALUE self;
17
+
18
+ private:
19
+ VALUE _configuration;
20
+ VALUE _tls_context;
21
+ VALUE _socket;
22
+ VALUE _remote_address;
23
+ std::unordered_map<Protocol::QUIC::StreamID, VALUE> _ruby_streams;
24
+
25
+ public:
26
+ RubyClient(VALUE self, VALUE configuration, VALUE tls_context, VALUE socket, VALUE remote_address, VALUE chosen_version) : Protocol::QUIC::Client(*Protocol_QUIC_Configuration_get(configuration), *Protocol_QUIC_TLS_ClientContext_get(tls_context), *Protocol_QUIC_Socket_get(socket), *Protocol_QUIC_Address_get(remote_address), RB_NUM2UINT(chosen_version)), self(self), _configuration(configuration), _tls_context(tls_context), _socket(socket), _remote_address(remote_address) {}
27
+ virtual ~RubyClient() {}
28
+
29
+ void handshake_completed() override
30
+ {
31
+ rb_funcall(self, rb_intern("handshake_completed"), 0);
32
+ }
33
+
34
+ Protocol::QUIC::Stream * create_stream(Protocol::QUIC::StreamID stream_id) override
35
+ {
36
+ VALUE stream = rb_funcall(self, rb_intern("create_stream"), 1, RB_LL2NUM(stream_id));
37
+ _ruby_streams[stream_id] = stream;
38
+
39
+ return Protocol_QUIC_Stream_get(stream);
40
+ }
41
+
42
+ void disconnect() override
43
+ {
44
+ Protocol::QUIC::Client::disconnect();
45
+ _ruby_streams.clear();
46
+ }
47
+
48
+ void stream_close(Protocol::QUIC::Stream * stream, std::int32_t flags, std::uint64_t error_code) override
49
+ {
50
+ auto stream_id = stream->stream_id();
51
+ Protocol::QUIC::Client::stream_close(stream, flags, error_code);
52
+ _ruby_streams.erase(stream_id);
53
+ }
54
+
55
+ void stream_reset(Protocol::QUIC::Stream * stream, std::size_t final_size, std::uint64_t error_code) override
56
+ {
57
+ auto stream_id = stream->stream_id();
58
+ Protocol::QUIC::Client::stream_reset(stream, final_size, error_code);
59
+ _ruby_streams.erase(stream_id);
60
+ }
61
+
62
+ void mark() {
63
+ rb_gc_mark_movable(self);
64
+ rb_gc_mark_movable(_configuration);
65
+ rb_gc_mark_movable(_tls_context);
66
+ rb_gc_mark_movable(_socket);
67
+ rb_gc_mark_movable(_remote_address);
68
+
69
+ for (auto & [stream_id, ruby_stream] : _ruby_streams) {
70
+ rb_gc_mark_movable(ruby_stream);
71
+ }
72
+ }
73
+
74
+ void compact() {
75
+ self = rb_gc_location(self);
76
+ _configuration = rb_gc_location(_configuration);
77
+ _tls_context = rb_gc_location(_tls_context);
78
+ _socket = rb_gc_location(_socket);
79
+ _remote_address = rb_gc_location(_remote_address);
80
+
81
+ for (auto & [stream_id, ruby_stream] : _ruby_streams) {
82
+ ruby_stream = rb_gc_location(ruby_stream);
83
+ }
84
+ }
85
+ };
86
+
87
+ static void Protocol_QUIC_Client_mark(void *data)
88
+ {
89
+ if (data) {
90
+ reinterpret_cast<RubyClient *>(data)->mark();
91
+ }
92
+ }
93
+
94
+ static void Protocol_QUIC_Client_compact(void *data)
95
+ {
96
+ if (data) {
97
+ reinterpret_cast<RubyClient *>(data)->compact();
98
+ }
99
+ }
100
+
101
+ static void Protocol_QUIC_Client_free(void *data)
102
+ {
103
+ if (data) {
104
+ delete reinterpret_cast<Protocol::QUIC::Client *>(data);
105
+ }
106
+ }
107
+
108
+ static size_t Protocol_QUIC_Client_size(const void *data) {
109
+ return sizeof(RubyClient);
110
+ }
111
+
112
+ static const rb_data_type_t Protocol_QUIC_Client_type = {
113
+ .wrap_struct_name = "Protocol::QUIC::Client",
114
+ .function = {
115
+ .dmark = Protocol_QUIC_Client_mark,
116
+ .dfree = Protocol_QUIC_Client_free,
117
+ .dsize = Protocol_QUIC_Client_size,
118
+ .dcompact = Protocol_QUIC_Client_compact,
119
+ },
120
+ .data = NULL,
121
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
122
+ };
123
+
124
+ Protocol::QUIC::Client * Protocol_QUIC_Client_get(VALUE self)
125
+ {
126
+ Protocol::QUIC::Client *configuration;
127
+ TypedData_Get_Struct(self, Protocol::QUIC::Client, &Protocol_QUIC_Client_type, configuration);
128
+ return configuration;
129
+ }
130
+
131
+ static VALUE Protocol_QUIC_Client_allocate(VALUE klass) {
132
+ return TypedData_Wrap_Struct(klass, &Protocol_QUIC_Client_type, NULL);
133
+ }
134
+
135
+ static VALUE Protocol_QUIC_Client_initialize(VALUE self, VALUE configuration, VALUE tls_context, VALUE socket, VALUE remote_address, VALUE chosen_version) {
136
+ Protocol::QUIC::Client *client = new RubyClient(self, configuration, tls_context, socket, remote_address, chosen_version);
137
+ DATA_PTR(self) = client;
138
+ return self;
139
+ }
140
+
141
+ static VALUE Protocol_QUIC_Client_connect(VALUE self) {
142
+ Protocol::QUIC::Client *client = Protocol_QUIC_Client_get(self);
143
+
144
+ client->connect();
145
+
146
+ return Qnil;
147
+ }
148
+
149
+ void Init_Protocol_QUIC_Client(VALUE Protocol_QUIC) {
150
+ Protocol_QUIC_Client =
151
+ rb_define_class_under(Protocol_QUIC, "Client", rb_cObject);
152
+
153
+ rb_define_alloc_func(Protocol_QUIC_Client, Protocol_QUIC_Client_allocate);
154
+ rb_define_method(Protocol_QUIC_Client, "initialize", Protocol_QUIC_Client_initialize, 5);
155
+
156
+ rb_define_method(Protocol_QUIC_Client, "connect", Protocol_QUIC_Client_connect, 0);
157
+ }
@@ -0,0 +1,27 @@
1
+ //
2
+ // Client.h
3
+ // This file is part of the "Protocol::QUIC" project and released under the MIT License.
4
+ //
5
+ // Created by Samuel Williams on 27/4/2023.
6
+ // Copyright, 2023, by Samuel Williams. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <ruby.h>
12
+
13
+ #include <Protocol/QUIC/Client.hpp>
14
+
15
+ #ifdef __cplusplus
16
+ extern "C" {
17
+ #endif
18
+
19
+ extern VALUE Protocol_QUIC_Client;
20
+
21
+ void Init_Protocol_QUIC_Client(VALUE Protocol_QUIC);
22
+
23
+ Protocol::QUIC::Client * Protocol_QUIC_Client_get(VALUE self);
24
+
25
+ #ifdef __cplusplus
26
+ }
27
+ #endif
@@ -0,0 +1,74 @@
1
+
2
+ #include <ruby.h>
3
+
4
+ #include "Configuration.hpp"
5
+
6
+ #include <stdarg.h>
7
+ #include <stdio.h>
8
+
9
+ #include <ngtcp2/ngtcp2.h>
10
+
11
+ VALUE Protocol_QUIC_Configuration = Qnil;
12
+
13
+ static void Protocol_QUIC_Configuration_free(void *data)
14
+ {
15
+ if (data) {
16
+ delete reinterpret_cast<Protocol::QUIC::Configuration *>(data);
17
+ }
18
+ }
19
+
20
+ static size_t Protocol_QUIC_Configuration_size(const void *data) {
21
+ return sizeof(Protocol::QUIC::Configuration);
22
+ }
23
+
24
+ static const rb_data_type_t Protocol_QUIC_Configuration_type = {
25
+ .wrap_struct_name = "Protocol::QUIC::Configuration",
26
+ .function = {
27
+ .dmark = NULL,
28
+ .dfree = Protocol_QUIC_Configuration_free,
29
+ .dsize = Protocol_QUIC_Configuration_size,
30
+ },
31
+ .data = NULL,
32
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
33
+ };
34
+
35
+ static VALUE Protocol_QUIC_Configuration_allocate(VALUE klass) {
36
+ auto configuration = new Protocol::QUIC::Configuration();
37
+
38
+ return TypedData_Wrap_Struct(klass, &Protocol_QUIC_Configuration_type, configuration);
39
+ }
40
+
41
+ Protocol::QUIC::Configuration * Protocol_QUIC_Configuration_get(VALUE self)
42
+ {
43
+ Protocol::QUIC::Configuration *configuration;
44
+
45
+ TypedData_Get_Struct(self, Protocol::QUIC::Configuration, &Protocol_QUIC_Configuration_type, configuration);
46
+
47
+ return configuration;
48
+ }
49
+
50
+ static VALUE Protocol_QUIC_Configuration_initialize(VALUE self) {
51
+ Protocol::QUIC::Configuration *configuration;
52
+
53
+ TypedData_Get_Struct(self, Protocol::QUIC::Configuration, &Protocol_QUIC_Configuration_type, configuration);
54
+
55
+ return self;
56
+ }
57
+
58
+ static VALUE Protocol_QUIC_Configuration_static_secret(VALUE self) {
59
+ Protocol::QUIC::Configuration *configuration;
60
+
61
+ TypedData_Get_Struct(self, Protocol::QUIC::Configuration, &Protocol_QUIC_Configuration_type, configuration);
62
+
63
+ return rb_str_new((const char *)configuration->static_secret.data(), configuration->static_secret.size());
64
+ }
65
+
66
+ void Init_Protocol_QUIC_Configuration(VALUE Protocol_QUIC) {
67
+ Protocol_QUIC_Configuration =
68
+ rb_define_class_under(Protocol_QUIC, "Configuration", rb_cObject);
69
+
70
+ rb_define_alloc_func(Protocol_QUIC_Configuration, Protocol_QUIC_Configuration_allocate);
71
+ rb_define_method(Protocol_QUIC_Configuration, "initialize", Protocol_QUIC_Configuration_initialize, 0);
72
+
73
+ rb_define_method(Protocol_QUIC_Configuration, "static_secret", Protocol_QUIC_Configuration_static_secret, 0);
74
+ }
@@ -0,0 +1,27 @@
1
+ //
2
+ // Configuration.h
3
+ // This file is part of the "Protocol::QUIC" project and released under the MIT License.
4
+ //
5
+ // Created by Samuel Williams on 27/4/2023.
6
+ // Copyright, 2023, by Samuel Williams. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <ruby.h>
12
+
13
+ #include <Protocol/QUIC/Configuration.hpp>
14
+
15
+ #ifdef __cplusplus
16
+ extern "C" {
17
+ #endif
18
+
19
+ extern VALUE Protocol_QUIC_Configuration;
20
+
21
+ void Init_Protocol_QUIC_Configuration(VALUE Protocol_QUIC);
22
+
23
+ Protocol::QUIC::Configuration * Protocol_QUIC_Configuration_get(VALUE self);
24
+
25
+ #ifdef __cplusplus
26
+ }
27
+ #endif
@@ -0,0 +1,50 @@
1
+
2
+ #include <ruby.h>
3
+
4
+ #include "Connection.hpp"
5
+ #include "ruby/internal/intern/vm.h"
6
+
7
+ #include <stdarg.h>
8
+ #include <stdio.h>
9
+
10
+ #include <ngtcp2/ngtcp2.h>
11
+
12
+ VALUE Protocol_QUIC_Connection = Qnil;
13
+
14
+ static void Protocol_QUIC_Connection_free(void *data)
15
+ {
16
+ if (data) {
17
+ delete reinterpret_cast<Protocol::QUIC::Connection *>(data);
18
+ }
19
+ }
20
+
21
+ static size_t Protocol_QUIC_Connection_size(const void *data) {
22
+ return sizeof(Protocol::QUIC::Connection);
23
+ }
24
+
25
+ const rb_data_type_t Protocol_QUIC_Connection_type = {
26
+ .wrap_struct_name = "Protocol::QUIC::Connection",
27
+ .function = {
28
+ .dmark = NULL,
29
+ .dfree = Protocol_QUIC_Connection_free,
30
+ .dsize = Protocol_QUIC_Connection_size,
31
+ },
32
+ .data = NULL,
33
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY,
34
+ };
35
+
36
+ Protocol::QUIC::Connection * Protocol_QUIC_Connection_get(VALUE self)
37
+ {
38
+ Protocol::QUIC::Connection *connection;
39
+
40
+ TypedData_Get_Struct(self, Protocol::QUIC::Connection, &Protocol_QUIC_Connection_type, connection);
41
+
42
+ return connection;
43
+ }
44
+
45
+ void Init_Protocol_QUIC_Connection(VALUE Protocol_QUIC) {
46
+ Protocol_QUIC_Connection =
47
+ rb_define_class_under(Protocol_QUIC, "Connection", rb_cObject);
48
+
49
+ rb_undef_alloc_func(Protocol_QUIC_Connection);
50
+ }
@@ -0,0 +1,29 @@
1
+ //
2
+ // Connection.h
3
+ // This file is part of the "Protocol::QUIC" project and released under the MIT License.
4
+ //
5
+ // Created by Samuel Williams on 27/4/2023.
6
+ // Copyright, 2023, by Samuel Williams. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <ruby.h>
12
+
13
+ #include <Protocol/QUIC/Connection.hpp>
14
+
15
+ #ifdef __cplusplus
16
+ extern "C" {
17
+ #endif
18
+
19
+ extern VALUE Protocol_QUIC_Connection;
20
+
21
+ extern const rb_data_type_t Protocol_QUIC_Connection_type;
22
+
23
+ void Init_Protocol_QUIC_Connection(VALUE Protocol_QUIC);
24
+
25
+ Protocol::QUIC::Connection * Protocol_QUIC_Connection_get(VALUE self);
26
+
27
+ #ifdef __cplusplus
28
+ }
29
+ #endif