forked from java-native-access/jna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method to retrieve peer transport parameters (java-native-access#597
) Motivation: It is useful to be able to retrieve what limits the peer has set as transport parameters. Modifications: Add method to be able to retrieve transport parameters sent by the remote peer Result: Be able to inspect transport parameters that might enforce limits etc
- Loading branch information
1 parent
bdadcb8
commit fd02b1c
Showing
9 changed files
with
363 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
codec-classes-quic/src/main/java/io/netty/incubator/codec/quic/QuicTransportParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* Copyright 2023 The Netty Project | ||
* | ||
* The Netty Project licenses this file to you under the Apache License, | ||
* version 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package io.netty.incubator.codec.quic; | ||
|
||
/** | ||
* Transport parameters for QUIC. | ||
*/ | ||
public interface QuicTransportParameters { | ||
|
||
/** | ||
* The maximum idle timeout. | ||
* @return timeout. | ||
*/ | ||
long maxIdleTimeout(); | ||
|
||
/** | ||
* The maximum UDP payload size. | ||
* | ||
* @return maximum payload size. | ||
*/ | ||
long maxUdpPayloadSize(); | ||
|
||
/** | ||
* The initial flow control maximum data for the connection. | ||
* | ||
* @return flowcontrol. | ||
*/ | ||
long initialMaxData(); | ||
|
||
/** | ||
* The initial flow control maximum data for local bidirectional streams. | ||
* | ||
* @return flowcontrol. | ||
*/ | ||
long initialMaxStreamDataBidiLocal(); | ||
|
||
/** | ||
* The initial flow control maximum data for remote bidirectional streams. | ||
* | ||
* @return flowcontrol. | ||
*/ | ||
long initialMaxStreamDataBidiRemote(); | ||
|
||
/** | ||
* The initial flow control maximum data for unidirectional streams. | ||
* | ||
* @return flowcontrol. | ||
*/ | ||
long initialMaxStreamDataUni(); | ||
|
||
|
||
/** | ||
* The initial maximum bidirectional streams. | ||
* | ||
* @return streams. | ||
*/ | ||
long initialMaxStreamsBidi(); | ||
|
||
/** | ||
* The initial maximum unidirectional streams. | ||
* | ||
* @return streams. | ||
*/ | ||
long initialMaxStreamsUni(); | ||
|
||
/** | ||
* The ACK delay exponent | ||
* | ||
* @return exponent. | ||
*/ | ||
long ackDelayExponent(); | ||
|
||
/** | ||
* The max ACK delay. | ||
* | ||
* @return delay. | ||
*/ | ||
long maxAckDelay(); | ||
|
||
/** | ||
* Whether active migration is disabled. | ||
* | ||
* @return disabled. | ||
*/ | ||
boolean disableActiveMigration(); | ||
|
||
/** | ||
* The active connection ID limit. | ||
* | ||
* @return limit. | ||
*/ | ||
long activeConnIdLimit(); | ||
|
||
/** | ||
* DATAGRAM frame extension parameter, if any. | ||
* | ||
* @return param. | ||
*/ | ||
long maxDatagramFrameSize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...asses-quic/src/main/java/io/netty/incubator/codec/quic/QuicheQuicTransportParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright 2023 The Netty Project | ||
* | ||
* The Netty Project licenses this file to you under the Apache License, | ||
* version 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package io.netty.incubator.codec.quic; | ||
|
||
final class QuicheQuicTransportParameters implements QuicTransportParameters { | ||
private final long[] values; | ||
|
||
QuicheQuicTransportParameters(long[] values) { | ||
this.values = values; | ||
} | ||
|
||
@Override | ||
public long maxIdleTimeout() { | ||
return values[0]; | ||
} | ||
|
||
@Override | ||
public long maxUdpPayloadSize() { | ||
return values[1]; | ||
} | ||
|
||
@Override | ||
public long initialMaxData() { | ||
return values[2]; | ||
} | ||
|
||
@Override | ||
public long initialMaxStreamDataBidiLocal() { | ||
return values[3]; | ||
} | ||
|
||
@Override | ||
public long initialMaxStreamDataBidiRemote() { | ||
return values[4]; | ||
} | ||
|
||
@Override | ||
public long initialMaxStreamDataUni() { | ||
return values[5]; | ||
} | ||
|
||
@Override | ||
public long initialMaxStreamsBidi() { | ||
return values[6]; | ||
} | ||
|
||
@Override | ||
public long initialMaxStreamsUni() { | ||
return values[7]; | ||
} | ||
|
||
@Override | ||
public long ackDelayExponent() { | ||
return values[8]; | ||
} | ||
|
||
@Override | ||
public long maxAckDelay() { | ||
return values[9]; | ||
} | ||
|
||
@Override | ||
public boolean disableActiveMigration() { | ||
return values[10] == 1; | ||
} | ||
|
||
@Override | ||
public long activeConnIdLimit() { | ||
return values[11]; | ||
} | ||
|
||
@Override | ||
public long maxDatagramFrameSize() { | ||
return values[12]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.