func (b ICMPv4) Sequence() uint16 {
	return binary.BigEndian.Uint16(b[icmpv4SequenceOffset:])
}
Sequence retrieves the Sequence field from an ICMPv4 message.
package header
import (
	"encoding/binary"
	"github.com/google/netstack/tcpip"
	"github.com/google/netstack/tcpip/buffer"
)
type ICMPv4 []byte
const (
	ICMPv4PayloadOffset = 8
	ICMPv4MinimumSize = 8
	ICMPv4ProtocolNumber tcpip.TransportProtocolNumber = 1
	icmpv4ChecksumOffset = 2
	icmpv4MTUOffset = 6
	icmpv4IdentOffset = 4
	icmpv4SequenceOffset = 6
)
type ICMPv4Type byte
const (
	ICMPv4EchoReply      ICMPv4Type = 0
	ICMPv4DstUnreachable ICMPv4Type = 3
	ICMPv4SrcQuench      ICMPv4Type = 4
	ICMPv4Redirect       ICMPv4Type = 5
	ICMPv4Echo           ICMPv4Type = 8
	ICMPv4TimeExceeded   ICMPv4Type = 11
	ICMPv4ParamProblem   ICMPv4Type = 12
	ICMPv4Timestamp      ICMPv4Type = 13
	ICMPv4TimestampReply ICMPv4Type = 14
	ICMPv4InfoRequest    ICMPv4Type = 15
	ICMPv4InfoReply      ICMPv4Type = 16
)
const (
	ICMPv4PortUnreachable     = 3
	ICMPv4FragmentationNeeded = 4
)
func (b ICMPv4) Type() ICMPv4Type { return ICMPv4Type(b[0]) }
func (b ICMPv4) SetType(t ICMPv4Type) { b[0] = byte(t) }
func (b ICMPv4) Code() byte { return b[1] }
func (b ICMPv4) SetCode(c byte) { b[1] = c }
func (b ICMPv4) Checksum() uint16 {
	return binary.BigEndian.Uint16(b[icmpv4ChecksumOffset:])
}
func (b ICMPv4) SetChecksum(checksum uint16) {
	binary.BigEndian.PutUint16(b[icmpv4ChecksumOffset:], checksum)
}
func (ICMPv4) SourcePort() uint16 {
	return 0
}
func (ICMPv4) DestinationPort() uint16 {
	return 0
}
func (ICMPv4) SetSourcePort(uint16) {
}
func (ICMPv4) SetDestinationPort(uint16) {
}
func (b ICMPv4) Payload() []byte {
	return b[ICMPv4PayloadOffset:]
}
func (b ICMPv4) MTU() uint16 {
	return binary.BigEndian.Uint16(b[icmpv4MTUOffset:])
}
func (b ICMPv4) SetMTU(mtu uint16) {
	binary.BigEndian.PutUint16(b[icmpv4MTUOffset:], mtu)
}
func (b ICMPv4) Ident() uint16 {
	return binary.BigEndian.Uint16(b[icmpv4IdentOffset:])
}
func (b ICMPv4) SetIdent(ident uint16) {
	binary.BigEndian.PutUint16(b[icmpv4IdentOffset:], ident)
}