View Javadoc
1   /*
2    * Copyright 2023 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty.handler.codec.quic;
17  
18  import io.netty.util.internal.StringUtil;
19  
20  final class QuicheQuicTransportParameters implements QuicTransportParameters {
21      private final long[] values;
22  
23      QuicheQuicTransportParameters(long[] values) {
24          this.values = values;
25      }
26  
27      @Override
28      public long maxIdleTimeout() {
29          return values[0];
30      }
31  
32      @Override
33      public long maxUdpPayloadSize() {
34          return values[1];
35      }
36  
37      @Override
38      public long initialMaxData() {
39          return values[2];
40      }
41  
42      @Override
43      public long initialMaxStreamDataBidiLocal() {
44          return values[3];
45      }
46  
47      @Override
48      public long initialMaxStreamDataBidiRemote() {
49          return values[4];
50      }
51  
52      @Override
53      public long initialMaxStreamDataUni() {
54          return values[5];
55      }
56  
57      @Override
58      public long initialMaxStreamsBidi() {
59          return values[6];
60      }
61  
62      @Override
63      public long initialMaxStreamsUni() {
64          return values[7];
65      }
66  
67      @Override
68      public long ackDelayExponent() {
69          return values[8];
70      }
71  
72      @Override
73      public long maxAckDelay() {
74          return values[9];
75      }
76  
77      @Override
78      public boolean disableActiveMigration() {
79          return values[10] == 1;
80      }
81  
82      @Override
83      public long activeConnIdLimit() {
84          return values[11];
85      }
86  
87      @Override
88      public long maxDatagramFrameSize() {
89          return values[12];
90      }
91  
92      @Override
93      public String toString() {
94          return StringUtil.simpleClassName(this) + "[" +
95                  "maxIdleTimeout=" + maxIdleTimeout() +
96                  ", maxUdpPayloadSize=" + maxUdpPayloadSize() +
97                  ", initialMaxData=" + initialMaxData() +
98                  ", initialMaxStreamDataBidiLocal=" + initialMaxStreamDataBidiLocal() +
99                  ", initialMaxStreamDataBidiRemote=" + initialMaxStreamDataBidiRemote() +
100                 ", initialMaxStreamDataUni=" + initialMaxStreamDataUni() +
101                 ", initialMaxStreamsBidi=" + initialMaxStreamsBidi() +
102                 ", initialMaxStreamsUni=" + initialMaxStreamsUni() +
103                 ", ackDelayExponent=" + ackDelayExponent() +
104                 ", maxAckDelay=" + maxAckDelay() +
105                 ", disableActiveMigration=" + disableActiveMigration() +
106                 ", activeConnIdLimit=" + activeConnIdLimit() +
107                 ", maxDatagramFrameSize=" + maxDatagramFrameSize() +
108                 "]";
109     }
110 }