Package io.netty.handler.codec.quic
Interface QuicTokenHandler
-
- All Known Implementing Classes:
InsecureQuicTokenHandler
public interface QuicTokenHandler
Handle token related operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
maxTokenLength()
Return the maximal token length.int
validateToken(ByteBuf token, java.net.InetSocketAddress address)
Validate the token and return the offset,-1
is returned if the token is not valid.boolean
writeToken(ByteBuf out, ByteBuf dcid, java.net.InetSocketAddress address)
Generate a new token for the given destination connection id and address.
-
-
-
Method Detail
-
writeToken
boolean writeToken(ByteBuf out, ByteBuf dcid, java.net.InetSocketAddress address)
Generate a new token for the given destination connection id and address. This token is written toout
. If no token should be generated and so no token validation should take place at all this method should returnfalse
.- Parameters:
out
-ByteBuf
into which the token will be written.dcid
- the destination connection id. TheByteBuf.readableBytes()
will be at mostQuic.MAX_CONN_ID_LEN
.address
- theInetSocketAddress
of the sender.- Returns:
true
if a token was written and so validation should happen,false
otherwise.
-
validateToken
int validateToken(ByteBuf token, java.net.InetSocketAddress address)
Validate the token and return the offset,-1
is returned if the token is not valid.- Parameters:
token
- theByteBuf
that contains the token. The ownership is not transferred.address
- theInetSocketAddress
of the sender.- Returns:
- the start index after the token or
-1
if the token was not valid.
-
maxTokenLength
int maxTokenLength()
Return the maximal token length.- Returns:
- the maximal supported token length.
-
-