Documentation ¶
Index ¶
- Variables
- func CheckIpRange(curIp net.IP, fromIp net.IP, toIp net.IP) bool
- func IsLAN(addr string) bool
- func ReadBigEndian(content []byte, target interface{}) (err error)
- func ReadLittleEndian(content []byte, target interface{}) (err error)
- func ReadSocket(conn net.Conn, length uint32) (buf []byte, err error)
- func ReadSocketWithMaxLength(conn net.Conn, length uint32, maxLength uint32) (buf []byte, err error)
- func WriteBigEndian(content interface{}) (result []byte, err error)
- func WriteLittleEndian(content interface{}) (result []byte, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AFromIp = net.ParseIP("10.0.0.0") AToIp = net.ParseIP("10.255.255.255") BFromIp = net.ParseIP("172.16.0.0") BToIp = net.ParseIP("172.31.255.255") CFromIp = net.ParseIP("192.168.0.0") CToIp = net.ParseIP("192.168.255.255") )
局域网网段
Functions ¶
func ReadBigEndian ¶
按大端序解析[]byte到结构体
func ReadLittleEndian ¶
按小端序解析[]byte到结构体
func ReadSocket ¶
从连接中读取数据,不判断最大长度
func ReadSocketWithMaxLength ¶
func ReadSocketWithMaxLength( conn net.Conn, length uint32, maxLength uint32, ) (buf []byte, err error)
从连接中读取数据,判断最大长度
func WriteLittleEndian ¶
将数据转换为小端序
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.