@@ -130,32 +130,33 @@ extension TunnelConfiguration {
130
130
if let listenPort = interface. listenPort {
131
131
output. append ( " ListenPort = \( listenPort) \n " )
132
132
}
133
- if let Jc = interface. Jc {
134
- output. append ( " Jc = \( Jc) \n " )
133
+
134
+ if let junkPacketCount = interface. junkPacketCount {
135
+ output. append ( " Jc = \( junkPacketCount) \n " )
135
136
}
136
- if let Jmin = interface. Jmin {
137
- output. append ( " Jmin = \( Jmin ) \n " )
137
+ if let junkPacketMinSize = interface. junkPacketMinSize {
138
+ output. append ( " Jmin = \( junkPacketMinSize ) \n " )
138
139
}
139
- if let Jmax = interface. Jmax {
140
- output. append ( " Jmax = \( Jmax ) \n " )
140
+ if let junkPacketMaxSize = interface. junkPacketMaxSize {
141
+ output. append ( " Jmax = \( junkPacketMaxSize ) \n " )
141
142
}
142
- if let S1 = interface. S1 {
143
- output. append ( " S1 = \( S1 ) \n " )
143
+ if let initPacketJunkSize = interface. initPacketJunkSize {
144
+ output. append ( " S1 = \( initPacketJunkSize ) \n " )
144
145
}
145
- if let S2 = interface. S2 {
146
- output. append ( " S2 = \( S2 ) \n " )
146
+ if let responsePacketJunkSize = interface. responsePacketJunkSize {
147
+ output. append ( " S2 = \( responsePacketJunkSize ) \n " )
147
148
}
148
- if let H1 = interface. H1 {
149
- output. append ( " H1 = \( H1 ) \n " )
149
+ if let initPacketMagicHeader = interface. initPacketMagicHeader {
150
+ output. append ( " H1 = \( initPacketMagicHeader ) \n " )
150
151
}
151
- if let H2 = interface. H2 {
152
- output. append ( " H2 = \( H2 ) \n " )
152
+ if let responsePacketMagicHeader = interface. responsePacketMagicHeader {
153
+ output. append ( " H2 = \( responsePacketMagicHeader ) \n " )
153
154
}
154
- if let H3 = interface. H3 {
155
- output. append ( " H3 = \( H3 ) \n " )
155
+ if let underloadPacketMagicHeader = interface. underloadPacketMagicHeader {
156
+ output. append ( " H3 = \( underloadPacketMagicHeader ) \n " )
156
157
}
157
- if let H4 = interface. H4 {
158
- output. append ( " H4 = \( H4 ) \n " )
158
+ if let transportPacketMagicHeader = interface. transportPacketMagicHeader {
159
+ output. append ( " H4 = \( transportPacketMagicHeader ) \n " )
159
160
}
160
161
if !interface. addresses. isEmpty {
161
162
let addressString = interface. addresses. map { $0. stringRepresentation } . joined ( separator: " , " )
@@ -235,59 +236,59 @@ extension TunnelConfiguration {
235
236
}
236
237
interface. mtu = mtu
237
238
}
238
- if let JcString = attributes [ " jc " ] {
239
- guard let jc = UInt16 ( JcString ) else {
240
- throw ParseError . interfaceHasInvalidCustomParam ( JcString )
239
+ if let junkPacketCountString = attributes [ " jc " ] {
240
+ guard let junkPacketCount = UInt16 ( junkPacketCountString ) else {
241
+ throw ParseError . interfaceHasInvalidCustomParam ( junkPacketCountString )
241
242
}
242
- interface. Jc = jc
243
+ interface. junkPacketCount = junkPacketCount
243
244
}
244
- if let JminString = attributes [ " jmin " ] {
245
- guard let jmin = UInt16 ( JminString ) else {
246
- throw ParseError . interfaceHasInvalidCustomParam ( JminString )
245
+ if let junkPacketMinSizeString = attributes [ " jmin " ] {
246
+ guard let junkPacketMinSize = UInt16 ( junkPacketMinSizeString ) else {
247
+ throw ParseError . interfaceHasInvalidCustomParam ( junkPacketMinSizeString )
247
248
}
248
- interface. Jmin = jmin
249
+ interface. junkPacketMinSize = junkPacketMinSize
249
250
}
250
- if let JmaxString = attributes [ " jmax " ] {
251
- guard let jmax = UInt16 ( JmaxString ) else {
252
- throw ParseError . interfaceHasInvalidCustomParam ( JmaxString )
251
+ if let junkPacketMaxSizeString = attributes [ " jmax " ] {
252
+ guard let junkPacketMaxSize = UInt16 ( junkPacketMaxSizeString ) else {
253
+ throw ParseError . interfaceHasInvalidCustomParam ( junkPacketMaxSizeString )
253
254
}
254
- interface. Jmax = jmax
255
+ interface. junkPacketMaxSize = junkPacketMaxSize
255
256
}
256
- if let S1String = attributes [ " s1 " ] {
257
- guard let s1 = UInt16 ( S1String ) else {
258
- throw ParseError . interfaceHasInvalidCustomParam ( S1String )
257
+ if let initPacketJunkSizeString = attributes [ " s1 " ] {
258
+ guard let initPacketJunkSize = UInt16 ( initPacketJunkSizeString ) else {
259
+ throw ParseError . interfaceHasInvalidCustomParam ( initPacketJunkSizeString )
259
260
}
260
- interface. S1 = s1
261
+ interface. initPacketJunkSize = initPacketJunkSize
261
262
}
262
- if let S2String = attributes [ " s2 " ] {
263
- guard let s2 = UInt16 ( S2String ) else {
264
- throw ParseError . interfaceHasInvalidCustomParam ( S2String )
263
+ if let responsePacketJunkSizeString = attributes [ " s2 " ] {
264
+ guard let responsePacketJunkSize = UInt16 ( responsePacketJunkSizeString ) else {
265
+ throw ParseError . interfaceHasInvalidCustomParam ( responsePacketJunkSizeString )
265
266
}
266
- interface. S2 = s2
267
+ interface. responsePacketJunkSize = responsePacketJunkSize
267
268
}
268
- if let H1String = attributes [ " h1 " ] {
269
- guard let h1 = UInt32 ( H1String ) else {
270
- throw ParseError . interfaceHasInvalidCustomParam ( H1String )
269
+ if let initPacketMagicHeaderString = attributes [ " h1 " ] {
270
+ guard let initPacketMagicHeader = UInt32 ( initPacketMagicHeaderString ) else {
271
+ throw ParseError . interfaceHasInvalidCustomParam ( initPacketMagicHeaderString )
271
272
}
272
- interface. H1 = h1
273
+ interface. initPacketMagicHeader = initPacketMagicHeader
273
274
}
274
- if let H2String = attributes [ " h2 " ] {
275
- guard let h2 = UInt32 ( H2String ) else {
276
- throw ParseError . interfaceHasInvalidCustomParam ( H2String )
275
+ if let responsePacketMagicHeaderString = attributes [ " h2 " ] {
276
+ guard let responsePacketMagicHeader = UInt32 ( responsePacketMagicHeaderString ) else {
277
+ throw ParseError . interfaceHasInvalidCustomParam ( responsePacketMagicHeaderString )
277
278
}
278
- interface. H2 = h2
279
+ interface. responsePacketMagicHeader = responsePacketMagicHeader
279
280
}
280
- if let H3String = attributes [ " h3 " ] {
281
- guard let h3 = UInt32 ( H3String ) else {
282
- throw ParseError . interfaceHasInvalidCustomParam ( H3String )
281
+ if let underloadPacketMagicHeaderString = attributes [ " h3 " ] {
282
+ guard let underloadPacketMagicHeader = UInt32 ( underloadPacketMagicHeaderString ) else {
283
+ throw ParseError . interfaceHasInvalidCustomParam ( underloadPacketMagicHeaderString )
283
284
}
284
- interface. H3 = h3
285
+ interface. underloadPacketMagicHeader = underloadPacketMagicHeader
285
286
}
286
- if let H4String = attributes [ " h4 " ] {
287
- guard let h4 = UInt32 ( H4String ) else {
288
- throw ParseError . interfaceHasInvalidCustomParam ( H4String )
287
+ if let transportPacketMagicHeaderString = attributes [ " h4 " ] {
288
+ guard let transportPacketMagicHeader = UInt32 ( transportPacketMagicHeaderString ) else {
289
+ throw ParseError . interfaceHasInvalidCustomParam ( transportPacketMagicHeaderString )
289
290
}
290
- interface. H4 = h4
291
+ interface. transportPacketMagicHeader = transportPacketMagicHeader
291
292
}
292
293
return interface
293
294
}
0 commit comments