func (b IPv6Header) FlowLabel() int {
	return int(b[1]&0x0f)<<16 | int(b[2])<<8 | int(b[3])
}
FlowLabel is flow label
package camo
import (
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"net"
)
const (
	IPv4HeaderLen = 20
	IPv6HeaderLen = 40
)
func GetIPPacketVersion(b []byte) int {
	return int(b[0] >> 4)
}
type IPv4Header []byte
func (b IPv4Header) Version() int {
	return int(b[0] >> 4)
}
func (b IPv4Header) Len() int {
	return int(b[0]&0x0f) << 2
}
func (b IPv4Header) TOS() int {
	return int(b[1])
}
func (b IPv4Header) TotalLen() int {
	return int(binary.BigEndian.Uint16(b[2:4]))
}
func (b IPv4Header) ID() int {
	return int(binary.BigEndian.Uint16(b[4:6]))
}
func (b IPv4Header) Flags() int {
	return (int(binary.BigEndian.Uint16(b[6:8])) & 0xe000) >> 13
}
func (b IPv4Header) FragOff() int {
	return int(binary.BigEndian.Uint16(b[6:8])) & 0x1fff
}
func (b IPv4Header) TTL() int {
	return int(b[8])
}
func (b IPv4Header) Protocol() int {
	return int(b[9])
}
func (b IPv4Header) Checksum() int {
	return int(binary.BigEndian.Uint16(b[10:12]))
}
func (b IPv4Header) Src() net.IP {
	return net.IP(b[12:16])
}
func (b IPv4Header) Dst() net.IP {
	return net.IP(b[16:20])
}
func (b IPv4Header) Options() []byte {
	hdrlen := b.Len()
	if hdrlen > IPv4HeaderLen {
		if len(b) >= hdrlen {
			return b[IPv4HeaderLen:hdrlen]
		}
		return b[IPv4HeaderLen:]
	}
	return nil
}
func (b IPv4Header) String() string {
	return fmt.Sprintf("ver=%d hdrlen=%d tos=%#x totallen=%d id=%#x flags=%#x fragoff=%#x ttl=%d proto=%d cksum=%#x src=%v dst=%v", b.Version(), b.Len(), b.TOS(), b.TotalLen(), b.ID(), b.Flags(), b.FragOff(), b.TTL(), b.Protocol(), b.Checksum(), b.Src(), b.Dst())
}
type IPv6Header []byte
func (b IPv6Header) Version() int {
	return int(b[0]) >> 4
}
func (b IPv6Header) TrafficClass() int {
	return int(b[0]&0x0f)<<4 | int(b[1])>>4
}