@@ -119,6 +119,11 @@ func TestIPv4PacketFromBytes(t *testing.T) {
119
119
destinationMAC : net .HardwareAddr ([]byte {0x00 , 0x1A , 0xA0 , 0xBB , 0xCC , 0xDD }),
120
120
sourceMAC : net .HardwareAddr ([]byte {0x00 , 0x1A , 0xB0 , 0xCC , 0xDD , 0xEE }),
121
121
etherType : 0x0800 ,
122
+ payload : []byte {
123
+ 0x45 , 0x00 , 0x00 , 0x3c , 0x1c , 0x46 , 0x40 , 0x00 ,
124
+ 0x40 , 0x06 , 0xb1 , 0xe6 , 0xc0 , 0xa8 , 0x00 , 0x68 ,
125
+ 0xc0 , 0xa8 , 0x00 , 0x01 ,
126
+ },
122
127
},
123
128
header : ipv4Header {
124
129
version : 4 ,
@@ -156,6 +161,11 @@ func TestIPv4PacketFromBytes(t *testing.T) {
156
161
destinationMAC : net .HardwareAddr ([]byte {0x00 , 0x1A , 0xA0 , 0xBB , 0xCC , 0xDD }),
157
162
sourceMAC : net .HardwareAddr ([]byte {0x00 , 0x1A , 0xB0 , 0xCC , 0xDD , 0xEE }),
158
163
etherType : 0x0800 ,
164
+ payload : []byte {
165
+ 0x46 , 0x00 , 0x00 , 0x3c , 0x1c , 0x46 , 0x40 , 0x00 ,
166
+ 0x40 , 0x06 , 0xb1 , 0xe6 , 0xc0 , 0xa8 , 0x00 , 0x68 ,
167
+ 0xc0 , 0xa8 , 0x00 , 0x01 , 0x01 , 0x02 , 0x03 , 0x04 ,
168
+ },
159
169
},
160
170
header : ipv4Header {
161
171
version : 4 ,
@@ -344,6 +354,13 @@ func TestIPv6PacketFromBytes(t *testing.T) {
344
354
destinationMAC : net .HardwareAddr ([]byte {0x00 , 0x1A , 0xA0 , 0xBB , 0xCC , 0xDD }),
345
355
sourceMAC : net .HardwareAddr ([]byte {0x00 , 0x1A , 0xB0 , 0xCC , 0xDD , 0xEE }),
346
356
etherType : 0x86DD ,
357
+ payload : []byte {
358
+ 0x60 , 0x00 , 0x00 , 0x00 , 0x00 , 0x14 , 0x11 , 0x40 ,
359
+ 0xfe , 0x80 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
360
+ 0x02 , 0x1c , 0x7e , 0xff , 0xfe , 0xe4 , 0x2c , 0x00 ,
361
+ 0xfe , 0x80 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
362
+ 0x02 , 0x1c , 0x7e , 0xff , 0xfe , 0xe4 , 0x2c , 0x01 ,
363
+ },
347
364
},
348
365
header : ipv6Header {
349
366
version : 6 ,
0 commit comments