@fails-components/webtransport-transport-http3-quiche 1.0.0-rc.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.
Files changed (67) hide show
  1. package/CMakeLists.txt +978 -0
  2. package/LICENSE +39 -0
  3. package/LICENSE.chromium +27 -0
  4. package/LICENSE.envoy +207 -0
  5. package/build.js +315 -0
  6. package/lib/clientsocket.js +80 -0
  7. package/lib/index.js +47 -0
  8. package/lib/serversocket.js +80 -0
  9. package/lib/socket.js +118 -0
  10. package/lib/types.ts +15 -0
  11. package/lib/utils.js +12 -0
  12. package/package.json +68 -0
  13. package/platform/icufix/fakedata.cpp +8 -0
  14. package/platform/quiche/quic/core/io/socket_win.inc +3 -0
  15. package/platform/quiche_platform_impl/quiche_bug_tracker_impl.h +7 -0
  16. package/platform/quiche_platform_impl/quiche_client_stats_impl.h +7 -0
  17. package/platform/quiche_platform_impl/quiche_command_line_flags_impl.h +7 -0
  18. package/platform/quiche_platform_impl/quiche_containers_impl.h +7 -0
  19. package/platform/quiche_platform_impl/quiche_event_loop_impl.h +7 -0
  20. package/platform/quiche_platform_impl/quiche_export_impl.h +6 -0
  21. package/platform/quiche_platform_impl/quiche_flag_utils_impl.h +11 -0
  22. package/platform/quiche_platform_impl/quiche_flags_impl.h +8 -0
  23. package/platform/quiche_platform_impl/quiche_googleurl_impl.h +8 -0
  24. package/platform/quiche_platform_impl/quiche_iovec_impl.h +10 -0
  25. package/platform/quiche_platform_impl/quiche_logging_impl.h +21 -0
  26. package/platform/quiche_platform_impl/quiche_mem_slice_impl.h +2 -0
  27. package/platform/quiche_platform_impl/quiche_mutex_impl.h +8 -0
  28. package/platform/quiche_platform_impl/quiche_prefetch_impl.h +11 -0
  29. package/platform/quiche_platform_impl/quiche_reference_counted_impl.h +16 -0
  30. package/platform/quiche_platform_impl/quiche_server_stats_impl.h +7 -0
  31. package/platform/quiche_platform_impl/quiche_stack_trace_impl.h +12 -0
  32. package/platform/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h +8 -0
  33. package/platform/quiche_platform_impl/quiche_testvalue_impl.h +1 -0
  34. package/platform/quiche_platform_impl/quiche_thread_local_impl.h +6 -0
  35. package/platform/quiche_platform_impl/quiche_time_utils_impl.h +13 -0
  36. package/platform/quiche_platform_impl/quiche_udp_socket_platform_impl.h +39 -0
  37. package/readme.md +20 -0
  38. package/src/http3backendresponse.cc +36 -0
  39. package/src/http3backendresponse.h +109 -0
  40. package/src/http3client.cc +1402 -0
  41. package/src/http3client.h +531 -0
  42. package/src/http3clientsession.cc +65 -0
  43. package/src/http3clientsession.h +58 -0
  44. package/src/http3clientstream.cc +52 -0
  45. package/src/http3clientstream.h +42 -0
  46. package/src/http3dispatcher.cc +62 -0
  47. package/src/http3dispatcher.h +57 -0
  48. package/src/http3server.cc +529 -0
  49. package/src/http3server.h +149 -0
  50. package/src/http3serverbackend.cc +104 -0
  51. package/src/http3serverbackend.h +96 -0
  52. package/src/http3serversession.cc +123 -0
  53. package/src/http3serversession.h +95 -0
  54. package/src/http3serverstream.cc +463 -0
  55. package/src/http3serverstream.h +114 -0
  56. package/src/http3sessioncache.cc +85 -0
  57. package/src/http3sessioncache.h +59 -0
  58. package/src/http3wtsessionvisitor.cc +312 -0
  59. package/src/http3wtsessionvisitor.h +257 -0
  60. package/src/http3wtstreamvisitor.cc +286 -0
  61. package/src/http3wtstreamvisitor.h +323 -0
  62. package/src/librarymain.cc +86 -0
  63. package/src/librarymain.h +42 -0
  64. package/src/napialarmfactory.cc +51 -0
  65. package/src/napialarmfactory.h +165 -0
  66. package/src/socketjswriter.cc +46 -0
  67. package/src/socketjswriter.h +100 -0
package/lib/index.js ADDED
@@ -0,0 +1,47 @@
1
+ import { existsSync } from 'fs'
2
+ import { createRequire } from 'module'
3
+ import * as path from 'path'
4
+ import * as url from 'url'
5
+ import { arch, platform } from 'node:process'
6
+ import { logger } from './utils.js'
7
+
8
+ const log = logger(`webtransport:native(${process?.pid})`)
9
+
10
+ const binplatform = platform + '_' + arch
11
+ const require = createRequire(import.meta.url)
12
+ const dirname = url.fileURLToPath(new URL('.', import.meta.url))
13
+ let buildpath = '../build_' + binplatform
14
+
15
+ if (!existsSync(path.join(dirname, buildpath))) buildpath = '../build' // use precompiled only if own compilation does not exist
16
+
17
+ let wtpath = buildpath + '/Release/webtransport.node'
18
+
19
+ if (
20
+ process.env.NODE_ENV !== 'production' &&
21
+ existsSync(path.join(dirname, buildpath + '/Debug/webtransport.node'))
22
+ ) {
23
+ wtpath = buildpath + '/Debug/webtransport.node'
24
+ }
25
+ log('load webtransport binary:', wtpath)
26
+
27
+ export const wtrouter = require(wtpath)
28
+ export const quicheInit = wtrouter.quicheInit
29
+
30
+ let quicheInited = false
31
+
32
+ /**
33
+ * @param {{quicheLogVerbose?: Number, path?: string}} [args]
34
+ */
35
+ export const checkQuicheInit = function (args) {
36
+ if (!quicheInited) {
37
+ quicheInit({
38
+ quicheLogVerbose: args?.quicheLogVerbose ? args.quicheLogVerbose : -1
39
+ })
40
+ quicheInited = true
41
+ }
42
+ }
43
+
44
+ export const Http3WebTransportClient = wtrouter.Http3WebTransportClient
45
+ export const Http3WebTransportServer = wtrouter.Http3WebTransportServer
46
+ export { Http3WebTransportClientSocket } from './clientsocket.js'
47
+ export { Http3WebTransportServerSocket } from './serversocket.js'
@@ -0,0 +1,80 @@
1
+ import { createSocket } from 'node:dgram'
2
+ import { lookup } from 'node:dns/promises'
3
+
4
+ import { logger } from './utils.js'
5
+ import { Http3WebTransportSocket } from './socket.js'
6
+
7
+ const log = logger(`webtransport:Http3WebTransportServerSocket(${process.pid})`)
8
+
9
+ export class Http3WebTransportServerSocket extends Http3WebTransportSocket {
10
+ /**
11
+ * @param {import('../../../main/lib/types.js').HttpWebTransportInit|undefined} args
12
+ */
13
+ constructor(args) {
14
+ super(args)
15
+ let port = args?.port
16
+ if (typeof port === 'undefined') port = 443
17
+ this.port = Number(port)
18
+ this.host = args?.host || 'localhost'
19
+ /** @type {import('../../../main/lib/session.js').HttpServer} */
20
+ // @ts-ignore
21
+ this.jsobj = undefined // the transport will set this
22
+
23
+ /** @type {import('node:dns').LookupAddress|undefined} */
24
+ this.address = undefined
25
+ }
26
+
27
+ init() {
28
+ lookup(this.host)
29
+ .then((result) => {
30
+ this.address = result
31
+ this.socketInt = createSocket({
32
+ type: result.family === 4 ? 'udp4' : 'udp6'
33
+ })
34
+
35
+ this.socketInt.on('listening', () => {
36
+ const addr = this.socketInt.address()
37
+ const retObj = {
38
+ port: addr?.port,
39
+ host: addr?.address
40
+ }
41
+ this.jsobj.onServerListening(retObj)
42
+ })
43
+
44
+ this.socketInt.on('error', (error) => {
45
+ this.jsobj.onServerError(error)
46
+ })
47
+
48
+ this.socketInt.on('close', () => {
49
+ this.jsobj.onServerClose()
50
+ })
51
+
52
+ this.socketInt.on('message', (msg, rinfo) => {
53
+ // console.log('srv msg', msg, rinfo)
54
+ const haschlos = this.cobj.recvPaket({
55
+ msg,
56
+ rinfo,
57
+ selfaddress: this.socketInt.address()
58
+ })
59
+ if (!this.chlosSched && haschlos) {
60
+ setImmediate(this.doProcessBufferedChlos)
61
+ this.chlosSched = true
62
+ }
63
+ })
64
+ this.socketInt.bind(this.port, this.address?.address)
65
+ this.cobj.onCanWrite()
66
+ })
67
+ .catch((error) => {
68
+ log('Problem server:', error)
69
+ // hostname not known
70
+ this.jsobj.onServerError()
71
+ })
72
+ }
73
+
74
+ stopServer() {
75
+ this.cobj.destroy()
76
+ this.socketInt.close()
77
+ this.closed = true
78
+ // TODO call close on all sessions
79
+ }
80
+ }
package/lib/socket.js ADDED
@@ -0,0 +1,118 @@
1
+ import { X509Certificate, createVerify } from 'node:crypto'
2
+ import { logger } from './utils.js'
3
+ import { rootCertificates } from 'node:tls'
4
+ const log = logger(`webtransport:Http3WebTransportSocket(${process.pid})`)
5
+
6
+ globalThis.FAILSsetTimeoutAlarm = (
7
+ /** @type {{ fireJS: () => void; }} */ alarm,
8
+ /** @type {number} */ delay
9
+ ) => {
10
+ return setTimeout(alarm.fireJS.bind(alarm), delay)
11
+ }
12
+
13
+ globalThis.FAILSVerifyProof = (
14
+ /** @type {{ certs: string[]; hostname: string; server_config?: string; signature?: string; }} */ obj
15
+ ) => {
16
+ try {
17
+ if (obj.certs.length < 1) return false
18
+ const leafcert = new X509Certificate(obj.certs[0])
19
+ if (!leafcert.checkHost(obj.hostname)) return false
20
+
21
+ if (obj.server_config) {
22
+ if (!obj.signature) return false
23
+ const verify = createVerify('SHA256')
24
+ verify.write(obj.server_config)
25
+ verify.end()
26
+ if (!verify.verify(leafcert.publicKey, obj.signature, 'hex')) return false
27
+ }
28
+
29
+ const curdate = new Date()
30
+
31
+ if (
32
+ new Date(leafcert.validFrom) > curdate ||
33
+ new Date(leafcert.validTo) < curdate
34
+ )
35
+ return false
36
+
37
+ let curcert = leafcert
38
+ for (let certnum = 1; certnum < obj.certs.length; certnum++) {
39
+ const nextcert = new X509Certificate(obj.certs[certnum])
40
+
41
+ if (
42
+ new Date(nextcert.validFrom) > curdate ||
43
+ new Date(nextcert.validTo) < curdate
44
+ )
45
+ return false
46
+
47
+ if (!curcert.checkIssued(nextcert)) return false
48
+ if (!curcert.verify(nextcert.publicKey)) return false
49
+ curcert = nextcert
50
+ }
51
+ // curcert must be one of the rootCertificates
52
+
53
+ if (
54
+ !rootCertificates.some((rootCA) => {
55
+ const testCert = new X509Certificate(rootCA)
56
+ if (curcert.checkIssued(testCert)) {
57
+ if (!curcert.verify(testCert.publicKey)) return false
58
+ else return true
59
+ } else return false
60
+ })
61
+ )
62
+ return false
63
+ } catch (error) {
64
+ log('VerifyProof error:', error)
65
+ return false
66
+ }
67
+ return true
68
+ }
69
+
70
+ export class Http3WebTransportSocket {
71
+ /**
72
+ * @param {import('../../../main/lib/types.js').HttpWebTransportInit|undefined} args
73
+ */
74
+ constructor(args) {
75
+ /** @type {import('node:dgram').Socket} */
76
+ // @ts-ignore
77
+ this.socketInt = undefined // the transport will set this
78
+ // @ts-ignore
79
+ this.cobj = undefined // the transport will set this
80
+ this.chlosSched = false
81
+ this.packetSendCB = this.packetSendCB.bind(this)
82
+ this.doProcessBufferedChlos = this.doProcessBufferedChlos.bind(this)
83
+ this.blocked = false
84
+ this.closed = false
85
+ }
86
+
87
+ doProcessBufferedChlos() {
88
+ this.cobj.processBufferedChlos()
89
+ this.chlosSched = false
90
+ }
91
+
92
+ /**
93
+ * @param {import('./types').UDPServerSocketSend} args
94
+ */
95
+
96
+ sendPacket({ msg, offset, length, port, address }) {
97
+ if (this.closed) return true
98
+ this.socketInt.send(
99
+ msg, // It seems that we need a copy, so maybe a js side buffer is a better choice, we copy now on c++ side
100
+ offset,
101
+ length,
102
+ port,
103
+ address,
104
+ this.packetSendCB
105
+ )
106
+ // @ts-ignore
107
+ const blocked = this.socketInt.getSendQueueCount() > 0
108
+ this.blocked = this.blocked || blocked
109
+ return blocked
110
+ }
111
+
112
+ packetSendCB() {
113
+ // @ts-ignore
114
+ if (this.socketInt.getSendQueueCount() === 0 && this.blocked) {
115
+ this.cobj.onCanWrite()
116
+ }
117
+ }
118
+ }
package/lib/types.ts ADDED
@@ -0,0 +1,15 @@
1
+
2
+ export interface UDPServerSocketSend {
3
+ msg: Uint8Array
4
+ offset: number
5
+ length: number
6
+ port:number
7
+ address: string
8
+ }
9
+
10
+ export interface Logger {
11
+ (formatter: any, ...args: any[]): void
12
+ error: (formatter: any, ...args: any[]) => void
13
+ trace: (formatter: any, ...args: any[]) => void
14
+ }
15
+
package/lib/utils.js ADDED
@@ -0,0 +1,12 @@
1
+ import debug from 'debug'
2
+
3
+ /**
4
+ * @param {string} name
5
+ * @returns {import('./types').Logger}
6
+ */
7
+ export function logger(name) {
8
+ return Object.assign(debug(name), {
9
+ error: debug(`${name}:error`),
10
+ trace: process?.env.DEBUG_TRACE ? debug(`${name}:trace`) : () => {}
11
+ })
12
+ }
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@fails-components/webtransport-transport-http3-quiche",
3
+ "version": "1.0.0-rc.1",
4
+ "description": "A component to add webtransport support (server and client) to node.js, transport using libquiche",
5
+ "exports": {
6
+ ".": {
7
+ "node": "./lib/index.js"
8
+ }
9
+ },
10
+ "engines": {
11
+ "node": ">=16.5"
12
+ },
13
+ "type": "module",
14
+ "types": "./dist/lib/index.d.ts",
15
+ "scripts": {
16
+ "start": "node test/echoserver.js",
17
+ "install": "node build.js install",
18
+ "dobuild": "node build.js build",
19
+ "rebuild": "node build.js rebuild",
20
+ "rebuild-debug": "node build.js rebuild-debug -D",
21
+ "build-debug": "node build.js build-debug",
22
+ "prebuild": "node build.js prebuild",
23
+ "types": "tsc",
24
+ "lint": "eslint lib"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/fails-components/webtransport.git"
29
+ },
30
+ "keywords": [
31
+ "webtransport"
32
+ ],
33
+ "author": "Marten Richter",
34
+ "license": "BSD-3-Clause",
35
+ "bugs": {
36
+ "url": "https://github.com/fails-components/webtransport/issues"
37
+ },
38
+ "homepage": "https://github.com/fails-components/webtransport#readme",
39
+ "dependencies": {
40
+ "@types/debug": "^4.1.7",
41
+ "bindings": "^1.5.0",
42
+ "cmake-js": "^7.2.1",
43
+ "debug": "^4.3.4",
44
+ "node-addon-api": "^7.0.0",
45
+ "prebuild-install": "^7.1.1"
46
+ },
47
+ "devDependencies": {
48
+ "@babel/core": "^7.17.10",
49
+ "@babel/eslint-parser": "^7.17.0",
50
+ "@babel/plugin-syntax-import-attributes": "^7.23.3",
51
+ "@types/node": "^18.15.3",
52
+ "eslint": "^7.32.0",
53
+ "eslint-config-prettier": "^7.2.0",
54
+ "eslint-config-standard": "^16.0.2",
55
+ "eslint-plugin-import": "^2.25.2",
56
+ "eslint-plugin-node": "^11.1.0",
57
+ "eslint-plugin-prettier": "^3.4.1",
58
+ "eslint-plugin-promise": "^4.3.1",
59
+ "eslint-plugin-standard": "^4.1.0",
60
+ "prettier": "^2.4.1",
61
+ "typescript": "^4.8.4"
62
+ },
63
+ "binary": {
64
+ "napi_versions": [
65
+ 6
66
+ ]
67
+ }
68
+ }
@@ -0,0 +1,8 @@
1
+ #include "unicode/putil.h"
2
+ #include "unicode/udata.h"
3
+ #include "unicode/uversion.h"
4
+ #include "ucmndata.h"
5
+
6
+ extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT;
7
+
8
+ const DataHeader U_ICUDATA_ENTRY_POINT = { {0,0,0}, {0,0,0,0,0,0,0,0,0}};
@@ -0,0 +1,3 @@
1
+ #include "absl/strings/ascii.h"
2
+ #warning "Fake socketwin included"
3
+ #include "third_party/quiche/quiche/quic/core/io/socket_win.inc"
@@ -0,0 +1,7 @@
1
+ // use default impl
2
+ #ifndef QUICHE_BUG_TRACKER
3
+ #define QUICHE_BUG_TRACKER
4
+
5
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_bug_tracker_impl.h"
6
+
7
+ #endif
@@ -0,0 +1,7 @@
1
+ // use default impl
2
+ #ifndef QUICHE_CLIENT_STATS_IMPL
3
+ #define QUICHE_CLIENT_STATS_IMPL
4
+
5
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_client_stats_impl.h"
6
+
7
+ #endif
@@ -0,0 +1,7 @@
1
+ // use default impl
2
+ #ifndef QUICHE_COMMAND_LINE_FLAGS_IMPL
3
+ #define QUICHE_COMMAND_LINE_FLAGS_IMPL
4
+
5
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_command_line_flags_impl.h"
6
+
7
+ #endif
@@ -0,0 +1,7 @@
1
+ // use default impl
2
+ #ifndef QUICHE_CONTAINER_IMPL
3
+ #define QUICHE_CONTAINER_IMPL
4
+
5
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_containers_impl.h"
6
+
7
+ #endif
@@ -0,0 +1,7 @@
1
+ // use default impl
2
+ #ifndef QUICHE_EVENT_LOOP_IMPL
3
+ #define QUICHE_EVENT_LOOP_IMPL
4
+
5
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_event_loop_impl.h"
6
+
7
+ #endif
@@ -0,0 +1,6 @@
1
+ #ifndef QUICHE_EXPORT_IMPL_HEADER
2
+ #define QUICHE_EXPORT_IMPL_HEADER
3
+
4
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_export_impl.h"
5
+
6
+ #endif
@@ -0,0 +1,11 @@
1
+ // Copyright 2020 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_FLAG_UTILS_IMPL_H_
6
+ #define NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_FLAG_UTILS_IMPL_H_
7
+
8
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_flag_utils_impl.h"
9
+
10
+
11
+ #endif // NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_FLAG_UTILS_IMPL_H_
@@ -0,0 +1,8 @@
1
+ // only for redirects
2
+
3
+ #ifndef NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_FLAG_IMPL_H_
4
+ #define NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_FLAG_IMPL_H_
5
+
6
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_flags_impl.h"
7
+
8
+ #endif
@@ -0,0 +1,8 @@
1
+ // only for redirects
2
+
3
+ #ifndef NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_GOOGLEURL_IMPL_H_
4
+ #define NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_GOOGLEURL_IMPL_H_
5
+
6
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_googleurl_impl.h"
7
+
8
+ #endif
@@ -0,0 +1,10 @@
1
+ // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef NET_QUICHE_PLATFORM_IMPL_QUIC_IOVEC_IMPL_H_
6
+ #define NET_QUICHE_PLATFORM_IMPL_QUIC_IOVEC_IMPL_H_
7
+
8
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_iovec_impl.h"
9
+
10
+ #endif // NET_QUIC_PLATFORM_IMPL_QUIC_IOVEC_IMPL_H_
@@ -0,0 +1,21 @@
1
+ // modified for fails webtransport by Marten Richter
2
+
3
+ //original Copyright by
4
+
5
+ // Copyright 2021 The Chromium Authors. All rights reserved.
6
+ // Use of this source code is governed by a BSD-style license that can be
7
+ // found in the LICENSE file.
8
+
9
+ // This file does not actually implement logging, it merely provides enough of
10
+ // logging code for QUICHE to compile. QUICHE embedders are encouraged to
11
+ // override this file with their own logic. If at some point logging becomes a
12
+ // part of Abseil, this file will likely start using that instead.
13
+
14
+
15
+
16
+ #ifndef QUICHE_COMMON_PLATFORM_NODE_QUICHE_PLATFORM_IMPL_QUICHE_LOGGING_IMPL_H_
17
+ #define QUICHE_COMMON_PLATFORM_NODE_QUICHE_PLATFORM_IMPL_QUICHE_LOGGING_IMPL_H_
18
+
19
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_logging_impl.h"
20
+
21
+ #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_LOGGING_IMPL_H_
@@ -0,0 +1,2 @@
1
+ // use the default
2
+ #include "quiche/common/platform/default/quiche_platform_impl/quiche_mem_slice_impl.h"
@@ -0,0 +1,8 @@
1
+ // from envoy so LICENSE.envoy applies
2
+ // use default impl
3
+ #ifndef QUICHE_MUTEX_IMPL
4
+ #define QUICHE_MUTEX_IMPL
5
+
6
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_mutex_impl.h"
7
+
8
+ #endif
@@ -0,0 +1,11 @@
1
+ // Copyright 2017 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef QUICHE_PREFETCH_IMPL_H_
6
+ #define QUICHE_PREFETCH_IMPL_H_
7
+
8
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_prefetch_impl.h"
9
+
10
+
11
+ #endif
@@ -0,0 +1,16 @@
1
+ // from envoy so LICENSE.envoy applies
2
+ #ifndef NET_QUIC_PLATFORM_IMPL_QUIC_REFERENCE_COUNTED_IMPL_H_
3
+ #define NET_QUIC_PLATFORM_IMPL_QUIC_REFERENCE_COUNTED_IMPL_H_
4
+
5
+ // NOLINT(namespace-envoy)
6
+
7
+ // This file is part of the QUICHE platform implementation, and is not to be
8
+ // consumed or referenced directly by other Envoy code. It serves purely as a
9
+ // porting layer for QUICHE.
10
+
11
+
12
+
13
+ #include "quiche/common/platform/default/quiche_platform_impl/quiche_reference_counted_impl.h"
14
+
15
+
16
+ #endif // NET_QUIC_PLATFORM_IMPL_QUIC_REFERENCE_COUNTED_IMPL_H_
@@ -0,0 +1,7 @@
1
+ // from envoy so LICENSE.envoy applies
2
+ #ifndef QUICHE_SERVER_STATS_IMPL
3
+ #define QUICHE_SERVER_STATS_IMPL
4
+
5
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_server_stats_impl.h"
6
+
7
+ #endif
@@ -0,0 +1,12 @@
1
+ // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef NET_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_
6
+ #define NET_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_
7
+
8
+ #include <string>
9
+
10
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_stack_trace_impl.h"
11
+
12
+ #endif // NET_QUIC_PLATFORM_IMPL_QUIC_STACK_TRACE_IMPL_H_
@@ -0,0 +1,8 @@
1
+
2
+ // Copyright (c) 2019 The Chromium Authors. All rights reserved.
3
+ // Use of this source code is governed by a BSD-style license that can be
4
+ // found in the LICENSE file.
5
+ #ifndef NET_QUIC_PLATFORM_IMPL_QUIC_STREAM_BUFFER_ALLOCATOR_IMPL_H_
6
+ #define NET_QUIC_PLATFORM_IMPL_QUIC_STREAM_BUFFER_ALLOCATOR_IMPL_H_
7
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h"
8
+ #endif // NET_QUIC_PLATFORM_IMPL_QUIC_STREAM_BUFFER_ALLOCATOR_IMPL_H_
@@ -0,0 +1 @@
1
+ #include "quiche/common/platform/default/quiche_platform_impl/quiche_testvalue_impl.h"
@@ -0,0 +1,6 @@
1
+ #ifndef QUICHE_THREAD_LOCAL_IMPL
2
+ #define QUICHE_THREAD_LOCAL_IMPL
3
+
4
+ #include "quiche/common/platform/default/quiche_platform_impl/quiche_thread_local_impl.h"
5
+
6
+ #endif
@@ -0,0 +1,13 @@
1
+ // from envoy so LICENSE.envoy applies
2
+ // NOLINT(namespace-envoy)
3
+
4
+ // This file is part of the QUICHE platform implementation, and is not to be
5
+ // consumed or referenced directly by other Envoy code. It serves purely as a
6
+ // porting layer for QUICHE.
7
+
8
+ #ifndef QUICHE_TIME_UTILS_IMPL
9
+ #define QUICHE_TIME_UTILS_IMPL
10
+
11
+ #include "third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_time_utils_impl.h"
12
+
13
+ #endif
@@ -0,0 +1,39 @@
1
+ // Copyright 2020 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef NET_QUICHE_PLATFORM_IMPL_QUICHE_UDP_SOCKET_PLATFORM_IMPL_H_
6
+ #define NET_QUICHE_PLATFORM_IMPL_QUICHE_UDP_SOCKET_PLATFORM_IMPL_H_
7
+
8
+ #ifndef WIN32
9
+ #include <sys/socket.h>
10
+ #endif
11
+
12
+ #include <cstddef>
13
+ #include <cstdint>
14
+
15
+ namespace quiche {
16
+
17
+ const size_t kCmsgSpaceForGooglePacketHeaderImpl = 0;
18
+
19
+ inline bool GetGooglePacketHeadersFromControlMessageImpl(
20
+ struct ::cmsghdr* cmsg,
21
+ char** packet_headers,
22
+ size_t* packet_headers_len) {
23
+ return false;
24
+ }
25
+
26
+ inline void SetGoogleSocketOptionsImpl(int fd) {}
27
+
28
+ inline int GetEcnCmsgArgsPreserveDscpImpl(const int /*fd*/,
29
+ const int /*address_family*/,
30
+ uint8_t /*ecn_codepoint*/,
31
+ int& /*type*/, void* /*value*/,
32
+ socklen_t& /*value_len*/) {
33
+ // TODO(b/273081493): implement this.
34
+ return 0;
35
+ }
36
+
37
+ } // namespace quic
38
+
39
+ #endif // NET_QUIC_PLATFORM_IMPL_QUIC_UDP_SOCKET_PLATFORM_IMPL_H_
package/readme.md ADDED
@@ -0,0 +1,20 @@
1
+ !["FAILS logo"](failslogo.svg)
2
+ # Fancy automated internet lecture system (**FAILS**) - components (Webtransport module)
3
+
4
+ Linux tests on master ![master](https://github.com/fails-components/webtransport/actions/workflows/libtest-linux.yml/badge.svg?branch=master)
5
+
6
+ Windows tests on master ![master](https://github.com/fails-components/webtransport/actions/workflows/libtest-windows.yml/badge.svg?branch=master)
7
+
8
+ Macos tests on master ![master](https://github.com/fails-components/webtransport/actions/workflows/libtest-macos.yml/badge.svg?branch=master)
9
+
10
+ (c) 2022- Marten Richter
11
+
12
+ The package provides the http/3 libquiche transports or the main package.
13
+
14
+ This package is part of FAILS.
15
+ A web-based lecture system developed out of university lectures.
16
+
17
+ While FAILS as a whole is licensed via GNU Affero GPL version 3.0, this package is licensed under a BSD-style license that can be found in the LICENSE file, while code taken from other projects is still under their respective license (see LICENSE file for details).
18
+ This package is licensed more permissive since it can be useful outside of the FAILS environment.
19
+
20
+ This package only provides the C++ binding to libquiche for http/3 support, please see the `@fails-components/webtransport` package for complete information in [readme.md](../../main/readme.md). Note you can not and should not use this package without the main package. The version of this package must match the version number of the main package. This package ABI or API is not stable and should only be used by the node.js package and not in another package.