@@ -856,6 +856,11 @@ pub enum ControlMessageOwned {
856
856
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
857
857
Ipv6RecvErr ( libc:: sock_extended_err, Option <sockaddr_in6>) ,
858
858
859
+ /// `SOL_TLS` messages of type `TLS_GET_RECORD_TYPE`, containing the TLS message content type,
860
+ /// normally one of change_cipher_spec(20), alert(21), handshake(22) (for TLS 1.3
861
+ /// resumption tickets), application_data(23)
862
+ TlsGetRecordType ( u8 ) ,
863
+
859
864
/// Catch-all variant for unimplemented cmsg types.
860
865
#[ doc( hidden) ]
861
866
Unknown ( UnknownCmsg ) ,
@@ -873,6 +878,12 @@ pub struct Timestamps {
873
878
pub hw_raw: TimeSpec ,
874
879
}
875
880
881
+ // Defined in `linux/tls.h`
882
+ #[ cfg( all( target_os = "linux" ) ) ]
883
+ const TLS_GET_RECORD_TYPE : c_int = 2 ;
884
+
885
+ const SOL_TLS : c_int = 282 ;
886
+
876
887
impl ControlMessageOwned {
877
888
/// Decodes a `ControlMessageOwned` from raw bytes.
878
889
///
@@ -1015,6 +1026,11 @@ impl ControlMessageOwned {
1015
1026
let dl = ptr:: read_unaligned( p as * const libc:: sockaddr_in6) ;
1016
1027
ControlMessageOwned :: Ipv6OrigDstAddr ( dl)
1017
1028
} ,
1029
+ #[ cfg( all( target_os = "linux" ) ) ]
1030
+ ( SOL_TLS , TLS_GET_RECORD_TYPE ) => {
1031
+ let content_type = ptr:: read_unaligned( p as * const u8 ) ;
1032
+ ControlMessageOwned :: TlsGetRecordType ( content_type)
1033
+ } ,
1018
1034
( _, _) => {
1019
1035
let sl = std:: slice:: from_raw_parts( p, len) ;
1020
1036
let ucmsg = UnknownCmsg ( * header, Vec :: <u8 >:: from( sl) ) ;
0 commit comments