@@ -5,26 +5,27 @@ import (
5
5
"net"
6
6
"testing"
7
7
8
- "github.com/google/uuid"
9
8
"github.com/stretchr/testify/require"
10
9
)
11
10
11
+ var fakeRequestID = "00000"
12
+
12
13
var headerCases = map [string ]struct {
13
14
hdr Header
14
15
bytes []byte
15
16
}{
16
17
"host" : {
17
18
hdr : Header {
18
19
Version : 1 ,
19
- RequestID : uuid. UUID {} ,
20
+ RequestID : fakeRequestID ,
20
21
Protocol : ProtocolTCP ,
21
22
Port : 80 ,
22
23
Addr : AddrFromHost ("a.com" ),
23
24
},
24
25
bytes : []byte {
25
26
1 ,
26
- 0 , 0x1c ,
27
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
27
+ 0 , 0x11 ,
28
+ 0x30 , 0x30 , 0x30 , 0x30 , 0x30 ,
28
29
0 ,
29
30
0 , 80 ,
30
31
1 ,
@@ -34,15 +35,15 @@ var headerCases = map[string]struct {
34
35
"ipv4" : {
35
36
hdr : Header {
36
37
Version : 0 ,
37
- RequestID : uuid. UUID {} ,
38
+ RequestID : fakeRequestID ,
38
39
Protocol : ProtocolUDP ,
39
40
Port : 53 ,
40
41
Addr : AddrFromBytes (AddrTypeIP , net .IPv4 (192 , 168 , 1 , 1 ).To4 ()),
41
42
},
42
43
bytes : []byte {
43
44
0 ,
44
- 0 , 0x1b ,
45
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
45
+ 0 , 0x10 ,
46
+ 0x30 , 0x30 , 0x30 , 0x30 , 0x30 ,
46
47
1 ,
47
48
0 , 53 ,
48
49
0 ,
@@ -52,15 +53,15 @@ var headerCases = map[string]struct {
52
53
"ipv6" : {
53
54
hdr : Header {
54
55
Version : 0 ,
55
- RequestID : uuid. UUID {} ,
56
+ RequestID : fakeRequestID ,
56
57
Protocol : ProtocolTCP ,
57
58
Port : 8080 ,
58
59
Addr : AddrFromBytes (AddrTypeIP , net .IPv6loopback ),
59
60
},
60
61
bytes : []byte {
61
62
0 ,
62
- 0 , 0x27 ,
63
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
63
+ 0 , 0x1c ,
64
+ 0x30 , 0x30 , 0x30 , 0x30 , 0x30 ,
64
65
0 ,
65
66
0x1f , 0x90 ,
66
67
0 ,
0 commit comments