Documentation ¶
Index ¶
- Constants
- func ConvertHexToIp(hex string) string
- func ConvertIpToHex(ip string) string
- func FindInterfaceByIp(addr string) (*net.Interface, error)
- func FormatMac(data string, format string) (string, error)
- func GetCidrHostNum(maskLen int) uint
- func GetCidrIpMask(maskLen int) string
- func GetCidrIpRange(cidr string) (string, string)
- func GetCidrIpRangeHex(cidr string) (string, string)
- func GetLocalIps() []string
- func HostsOfCidr(cidr string) ([]string, error)
- func IntegerStringToMac(intMacStr, separ string) []string
- func IsIpInGateway(ip, min, max string) bool
- func IsValidIp(input string) bool
- func ParseMac(s string) net.HardwareAddr
- func SendMultiCastDataByInterface(ni *net.Interface, remoteAddr *net.UDPAddr, message string, respPrefix string, ...) ([]string, error)
- func SendUdpData(host string, port int, message []byte, timeout time.Duration, bufferSize int) (string, error)
Constants ¶
View Source
const ( MacFormatColon3 = "colon-3" MacFormatColon6 = "colon-6" MacFormatHyphen3 = "hyphen-3" MacFormatHyphen6 = "hyphen-6" MacFormatDot6 = "dot-6" MacFormatNoDelim = "no-delim" )
View Source
const TextLineSeparator = "\r\n"
Variables ¶
This section is empty.
Functions ¶
func ConvertHexToIp ¶
func ConvertIpToHex ¶
func FindInterfaceByIp ¶ added in v0.1.6
func FormatMac ¶ added in v0.1.8
colon-3,冒号,0000:0000:0000 colon-6,冒号,00:00:00:00:00:00 hyphen-3,中划线,0000-0000-0000 hyphen-6,中划线,00-00-00-00-00-00 dot-6,点分割,00.00.00.00.00.00 no-delim,无分隔符,000000000000
func GetCidrHostNum ¶
GetCidrHostNum @Description: 计算得到CIDR地址范围内可拥有的主机数量 @param maskLen @return uint
func GetCidrIpMask ¶
GetCidrIpMask @Description: 获取Cidr的掩码 @param maskLen @return string
func GetCidrIpRange ¶
func GetCidrIpRangeHex ¶
func GetLocalIps ¶ added in v0.1.6
func GetLocalIps() []string
func HostsOfCidr ¶
func IntegerStringToMac ¶
func IsIpInGateway ¶
func ParseMac ¶
func ParseMac(s string) net.HardwareAddr
func SendMultiCastDataByInterface ¶ added in v0.1.6
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.