@@ -5,12 +5,16 @@ package multiaddr
5
5
const (
6
6
P_IP4 = 0x0004
7
7
P_TCP = 0x0006
8
+ P_DNS4 = 0x0036
9
+ P_DNS6 = 0x0037
10
+ P_DNSADDR = 0x0038
8
11
P_UDP = 0x0111
9
12
P_DCCP = 0x0021
10
13
P_IP6 = 0x0029
11
14
P_IP6ZONE = 0x002A
12
15
P_QUIC = 0x01CC
13
16
P_SCTP = 0x0084
17
+ P_CIRCUIT = 0x0122
14
18
P_UDT = 0x012D
15
19
P_UTP = 0x012E
16
20
P_UNIX = 0x0190
@@ -23,6 +27,7 @@ const (
23
27
P_GARLIC64 = 0x01BE
24
28
P_GARLIC32 = 0x01BF
25
29
P_P2P_WEBRTC_DIRECT = 0x0114
30
+ P_WS = 0x01DD
26
31
)
27
32
28
33
var (
42
47
Path : false ,
43
48
Transcoder : TranscoderPort ,
44
49
}
50
+ protoDNS4 = Protocol {
51
+ Code : P_DNS4 ,
52
+ Size : LengthPrefixedVarSize ,
53
+ Name : "dns4" ,
54
+ VCode : CodeToVarint (P_DNS4 ),
55
+ Transcoder : TranscoderDns ,
56
+ }
57
+ protoDNS6 = Protocol {
58
+ Code : P_DNS6 ,
59
+ Size : LengthPrefixedVarSize ,
60
+ Name : "dns6" ,
61
+ VCode : CodeToVarint (P_DNS6 ),
62
+ Transcoder : TranscoderDns ,
63
+ }
64
+ protoDNSADDR = Protocol {
65
+ Code : P_DNSADDR ,
66
+ Size : LengthPrefixedVarSize ,
67
+ Name : "dnsaddr" ,
68
+ VCode : CodeToVarint (P_DNSADDR ),
69
+ Transcoder : TranscoderDns ,
70
+ }
45
71
protoUDP = Protocol {
46
72
Name : "udp" ,
47
73
Code : P_UDP ,
@@ -81,6 +107,14 @@ var (
81
107
Size : 16 ,
82
108
Transcoder : TranscoderPort ,
83
109
}
110
+
111
+ protoCIRCUIT = Protocol {
112
+ Code : P_CIRCUIT ,
113
+ Size : 0 ,
114
+ Name : "p2p-circuit" ,
115
+ VCode : CodeToVarint (P_CIRCUIT ),
116
+ }
117
+
84
118
protoONION2 = Protocol {
85
119
Name : "onion" ,
86
120
Code : P_ONION ,
@@ -154,17 +188,26 @@ var (
154
188
Code : P_P2P_WEBRTC_DIRECT ,
155
189
VCode : CodeToVarint (P_P2P_WEBRTC_DIRECT ),
156
190
}
191
+ protoWS = Protocol {
192
+ Name : "ws" ,
193
+ Code : P_WS ,
194
+ VCode : CodeToVarint (P_WS ),
195
+ }
157
196
)
158
197
159
198
func init () {
160
199
for _ , p := range []Protocol {
161
200
protoIP4 ,
162
201
protoTCP ,
202
+ protoDNS4 ,
203
+ protoDNS6 ,
204
+ protoDNSADDR ,
163
205
protoUDP ,
164
206
protoDCCP ,
165
207
protoIP6 ,
166
208
protoIP6ZONE ,
167
209
protoSCTP ,
210
+ protoCIRCUIT ,
168
211
protoONION2 ,
169
212
protoONION3 ,
170
213
protoGARLIC64 ,
@@ -177,6 +220,7 @@ func init() {
177
220
protoP2P ,
178
221
protoUNIX ,
179
222
protoP2P_WEBRTC_DIRECT ,
223
+ protoWS ,
180
224
} {
181
225
if err := AddProtocol (p ); err != nil {
182
226
panic (err )
0 commit comments