Documentation
¶
Index ¶
- type ErrorAlreadyExists
- type Pinger
- func (pp *Pinger) AddCallBack(ip net.IP, id int, cb func(*packet.Packet)) error
- func (pp *Pinger) DelCallBack(ip net.IP, id int) error
- func (pp *Pinger) GetCallback(ip net.IP, id int) (func(*packet.Packet), bool)
- func (pp *Pinger) Network() string
- func (pp *Pinger) Send(dst *net.IPAddr, sp *packet.Packet) error
- func (pp *Pinger) SendType() icmp.Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorAlreadyExists ¶
type ErrorAlreadyExists struct{}
ErrorAlreadyExists is returned if a callback already exists. Used to detect icmp ID conflicts
func (*ErrorAlreadyExists) Error ¶
func (e *ErrorAlreadyExists) Error() string
type Pinger ¶
type Pinger struct { Conn *icmp.PacketConn // contains filtered or unexported fields }
Pinger is a protocol specific pinger, either ipv4 or ipv6
func (*Pinger) AddCallBack ¶
AddCallBack adds an OnRecieve callback for a given IP and icmp id This implicitly starts the listening for these packets
func (*Pinger) DelCallBack ¶
DelCallBack deletes a callback for a given IP and icmp id This stops listening for these packets
func (*Pinger) GetCallback ¶
GetCallback returns the OnRecieve callback for for a given IP and icmp id
Click to show internal directories.
Click to hide internal directories.