goping

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FD_ISSET

func FD_ISSET(p *syscall.FdSet, i int) bool

func FD_SET

func FD_SET(p *syscall.FdSet, i int)

func FD_ZERO

func FD_ZERO(p *syscall.FdSet)

Types

type EchoReply

type EchoReply struct {
	WhenSent time.Time //When the Echo Request was sent
	WhenRecv time.Time //When the Echo Reply was received
	Type     uint8     //The type of the icmpReply Packet
	Code     uint8     //The Code for the Echo Reply
}

Represent an EchoReply received from the network

type EchoRequest

type EchoRequest struct {
	WhenSent time.Time     //The time this request was sent over the socket
	To       net.IPAddr    //The Ip Address of the request
	Size     uint8         //The number of bytes to send
	TOS      uint8         //The DSCP flag of the ip header
	TTL      uint8         //The TTL flag of the ip header
	Timeout  time.Duration // The timeout
	// contains filtered or unexported fields
}

Represent an Echo Request to be sent over the network

type Ping

type Ping struct {
	To       string            //hostname of the target host
	Times    int               //The number of EchoRequests we should sent
	Timeout  time.Duration     //The duration we should wait for an EchoReply for each EchoRequest
	Interval time.Duration     //The duration we should wait between the sent EchoRequests
	TOS      int               //The Type of Service  to be sent in the EchoRequest IP Header
	TTL      int               //The Time to live to be sent in the  EchoRequest IP Header
	Size     uint              //The number of bytes to sent in each EchoRequest
	PeakTh   int               //The number of peaks to remove
	UserData map[string]string //User data

	Id uint64 //the id of this request. It is created  in the NewPing function and can be used to debug

	Toaddr net.IPAddr //Stores the resolved ip address
	// contains filtered or unexported fields
}

The Ping Request object

func NewPing

func NewPing(to string) (*Ping, error)

type Pong

type Pong struct {
	Ping         *Ping         //A reference to the Ping Request
	EchoRequests []EchoRequest //All the EchoRequests sent over the socket for the Ping Request
	EchoReplies  []EchoReply   //All the EchoReplies received from the socket for the Ping Request
}

The Response Object returned to the caller

Jump to

Keyboard shortcuts

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