icmp

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package icmp provides icmp enhanced methods based on the golang icmp package

Index

Constants

View Source
const (
	ProtocolIPv4ICMP = 1  // IANA ICMP for IPv4
	ProtocolIPv6ICMP = 58 // IANA ICMP for IPv6
)

IANA ICMP

Variables

This section is empty.

Functions

This section is empty.

Types

type Ping

type Ping struct {
	MaxRTT time.Duration
	// contains filtered or unexported fields
}

Ping represents ping fields

func NewPing

func NewPing() *Ping

NewPing creates a new ping object

func (*Ping) DelIP

func (p *Ping) DelIP(ipAddr string)

func (*Ping) IP

func (p *Ping) IP(ipAddr string)

func (*Ping) Network

func (p *Ping) Network()

func (*Ping) PacketSize

func (p *Ping) PacketSize(s int)

func (*Ping) Ping

func (p *Ping) Ping(out chan string)

func (*Ping) SetTTL

func (p *Ping) SetTTL()

func (*Ping) Start

func (p *Ping) Start()

type Trace

type Trace struct {
	// contains filtered or unexported fields
}

Trace represents trace properties

func (*Trace) Bind

func (i *Trace) Bind() int

Bind starts to listen for ICMP reply

func (*Trace) Done

func (i *Trace) Done(fd int)

Done close the socket

func (*Trace) Init

func (i *Trace) Init(dest string, timeout int64)

Init set the basic parameters

func (*Trace) Recv

func (i *Trace) Recv(fd int) (int, int, string)

Recv gets the replied icmp packet

func (*Trace) Run

func (i *Trace) Run(ip string)

Run provides trace based on the other methods

func (*Trace) Send

func (i *Trace) Send() error

Send tries to send an UDP packet

func (*Trace) SetTTL

func (i *Trace) SetTTL(ttl int)

SetTTL set the IP packat time to live

Jump to

Keyboard shortcuts

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