mirror of
https://github.com/fumiama/water.git
synced 2026-06-17 17:10:34 +08:00
add ipv4 total len in wu
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package waterutil
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"net"
|
||||
)
|
||||
|
||||
@@ -12,6 +13,10 @@ func IPv4ECN(packet []byte) byte {
|
||||
return packet[1] & 0x03
|
||||
}
|
||||
|
||||
func IPv4TotalLength(packet []byte) uint16 {
|
||||
return binary.BigEndian.Uint16(packet[2:4])
|
||||
}
|
||||
|
||||
func IPv4Identification(packet []byte) [2]byte {
|
||||
return [2]byte{packet[4], packet[5]}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user