Skip to content

Commit f91fdb2

Browse files
committed
Adds minimal impl
1 parent f13f040 commit f91fdb2

File tree

9 files changed

+263
-30
lines changed

9 files changed

+263
-30
lines changed

quic/s2n-quic-core/src/packet/handshake.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ pub type EncryptedHandshake<'a> =
6565
pub type CleartextHandshake<'a> = Handshake<&'a [u8], &'a [u8], PacketNumber, DecoderBufferMut<'a>>;
6666

6767
impl<'a> ProtectedHandshake<'a> {
68+
pub fn get_wire_bytes(&self) -> Vec<u8> {
69+
self.payload.buffer.encode_to_vec()
70+
}
71+
6872
#[inline]
6973
pub(crate) fn decode(
7074
_tag: Tag,

quic/s2n-quic-core/src/packet/short.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ impl<'a> ProtectedShort<'a> {
194194
.get_checked_range(&self.destination_connection_id)
195195
.into_less_safe_slice()
196196
}
197+
198+
pub fn get_wire_bytes(&self) -> Vec<u8> {
199+
self.payload.buffer.encode_to_vec()
200+
}
197201
}
198202

199203
impl<'a> EncryptedShort<'a> {

quic/s2n-quic-transport/src/connection/connection_container/tests.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ impl connection::Trait for TestConnection {
138138
_datagram: &mut <Self::Config as endpoint::Config>::DatagramEndpoint,
139139
_dc_endpoint: &mut <Self::Config as endpoint::Config>::DcEndpoint,
140140
_conn_limits_endpoint: &mut <Self::Config as endpoint::Config>::ConnectionLimits,
141+
_random_generator: &mut <Self::Config as endpoint::Config>::RandomGenerator,
142+
_packet_interceptor: &mut <Self::Config as endpoint::Config>::PacketInterceptor,
143+
_connection_id_format: &mut <Self::Config as endpoint::Config>::ConnectionIdFormat,
141144
) -> Result<(), connection::Error> {
142145
Ok(())
143146
}
@@ -153,6 +156,7 @@ impl connection::Trait for TestConnection {
153156
_datagram_endpoint: &mut <Self::Config as endpoint::Config>::DatagramEndpoint,
154157
_dc_endpoint: &mut <Self::Config as endpoint::Config>::DcEndpoint,
155158
_conn_limits_endpoint: &mut <Self::Config as endpoint::Config>::ConnectionLimits,
159+
_connection_id_format: &<Self::Config as endpoint::Config>::ConnectionIdFormat,
156160
) -> Result<(), ProcessingError> {
157161
Ok(())
158162
}
@@ -169,6 +173,7 @@ impl connection::Trait for TestConnection {
169173
_datagram_endpoint: &mut <Self::Config as endpoint::Config>::DatagramEndpoint,
170174
_dc_endpoint: &mut <Self::Config as endpoint::Config>::DcEndpoint,
171175
_conn_limits_endpoint: &mut <Self::Config as endpoint::Config>::ConnectionLimits,
176+
_connection_id_format: &<Self::Config as endpoint::Config>::ConnectionIdFormat,
172177
) -> Result<(), ProcessingError> {
173178
Ok(())
174179
}
@@ -185,6 +190,7 @@ impl connection::Trait for TestConnection {
185190
_datagram_endpoint: &mut <Self::Config as endpoint::Config>::DatagramEndpoint,
186191
_dc_endpoint: &mut <Self::Config as endpoint::Config>::DcEndpoint,
187192
_connection_limits_endpoint: &mut <Self::Config as endpoint::Config>::ConnectionLimits,
193+
_connection_id_format: &<Self::Config as endpoint::Config>::ConnectionIdFormat,
188194
) -> Result<(), ProcessingError> {
189195
Ok(())
190196
}

0 commit comments

Comments
 (0)