File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,25 @@ pub const MESSAGE_NONCE_LENGTH: usize = 12;
29
29
/// The Id nonce length (in bytes).
30
30
pub const ID_NONCE_LENGTH : usize = 16 ;
31
31
32
+ pub struct Nat ;
33
+
34
+ impl ProtocolIdentity < 3 > for Nat {
35
+ const PROTOCOL_ID_BYTES : [ u8 ; 6 ] = * b"discv5" ;
36
+ const PROTOCOL_VERSION_BYTES : [ u8 ; 2 ] = 0x0001_u16 . to_be_bytes ( ) ;
37
+ const IMPLEMENTATION_FEATURES : [ u8 ; 3 ] = * b"nat" ;
38
+ }
32
39
pub struct DefaultProtocolId { }
33
40
34
41
impl ProtocolIdentity for DefaultProtocolId {
35
42
const PROTOCOL_ID_BYTES : [ u8 ; 6 ] = * b"discv5" ;
36
43
const PROTOCOL_VERSION_BYTES : [ u8 ; 2 ] = 0x0001_u16 . to_be_bytes ( ) ;
44
+ const IMPLEMENTATION_FEATURES : [ u8 ; 0 ] = * b"" ;
37
45
}
38
46
39
- pub trait ProtocolIdentity {
47
+ pub trait ProtocolIdentity < const N : usize = 0 > : Sync + Send {
40
48
const PROTOCOL_ID_BYTES : [ u8 ; 6 ] ;
41
49
const PROTOCOL_VERSION_BYTES : [ u8 ; 2 ] ;
50
+ const IMPLEMENTATION_FEATURES : [ u8 ; N ] ;
42
51
}
43
52
44
53
pub ( crate ) const MAX_PACKET_SIZE : usize = 1280 ;
You can’t perform that action at this time.
0 commit comments