ip

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ip ip操作相关函数

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSum added in v0.0.6

func CheckSum(data []byte) uint16

CheckSum 计算确认码

func FormatBlockIps added in v0.0.5

func FormatBlockIps(source []string) ([]string, error)

IP可以为单个IP,或者以”/”掩码格式IP段,或者以”-”连接符的IP段

func GetHostIp

func GetHostIp() string

GetHostIp 通过接口获取IP,获取第一个IP

func GetHostIpFilter

func GetHostIpFilter(ipPrefix string) string

GetHostIpFilter 查询接口IP,获取相关前缀的IP

参数 ipPrefix:IP前缀

func GetHostIpFromUDP

func GetHostIpFromUDP() string

GetHostIpFromUDP 通过udp访问自己来获取主机IP

func IpFlat added in v0.0.15

func IpFlat(ips string) string

* 10.124.61.200-223 10.124.61.224-226 10.124.61.175-179 将这种格式的IP展开

func Isping added in v0.0.6

func Isping(ip string) bool

Isping 测试IP连通性

func ValidateIp added in v0.0.5

func ValidateIp(ipv4 string) (bool, int)

Types

type ICMP added in v0.0.6

type ICMP struct {
	Type        uint8
	Code        uint8
	Checksum    uint16
	Identifier  uint16
	SequenceNum uint16
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL