icmpping

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestModel bool
)

Functions

func ClearSuccessIp

func ClearSuccessIp()

func GetSuccessIp

func GetSuccessIp() []string

func IcmpType

func IcmpType(rt uint8, rc uint8) string

func InitIcmpBytes

func InitIcmpBytes()

func StartHttpServer

func StartHttpServer()

func StartPing

func StartPing(distIp string, timeout int) (int, float64, bool)

func StartTask

func StartTask()

Types

type ICMP

type ICMP struct {
	Type        uint8  // 类型,8是请求,0是应答
	Code        uint8  // 代码,它与类型字段一起共同标识了ICMP报文的详细类型,比如说类型为3表示不可达,此时代码为0表示网络不可达,为1表示满意主机不可达等
	Checksum    uint16 // 校验和,对包括ICMP报文数据部分在内的整个ICMP数据报的校验和,以检验报文在传输过程中是否出现了差错,和IP报头中校验和计算方法一样
	Identifier  uint16 // 标识,用于标识本ICMP进程,但仅适用于回显请求和应答ICMP报文,对于目标不可达和超时,该字段为0
	SequenceNum uint16 // 序列号
}

icmp报头,8byte

Jump to

Keyboard shortcuts

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