Documentation ¶
Overview ¶
Package ping is a generated protocol buffer package.
It is generated from these files:
github.com/google/cloudprober/probes/ping/config.proto
It has these top-level messages:
ProbeConf
Package ping implements a fast ping prober. It sends ICMP pings to a list of targets and reports statistics on packets sent, received and latency experienced.
This ping implementation supports two types of sockets: Raw and datagram ICMP sockets.
Raw sockets require root privileges and all the ICMP noise is copied on all raw sockets opened for ICMP. We have to deal with the unwanted ICMP noise.
On the other hand, datagram ICMP sockets are unprivileged and implemented in such a way that kernel copies only relevant packets on them. Kernel assigns a local port for such sockets and rewrites ICMP id of the outgoing packets to match that port number. Incoming ICMP packets' ICMP id is matched with the local port to find the correct destination socket.
More about these sockets: http://lwn.net/Articles/420800/ Note: On some linux distributions these sockets are not enabled by default; you can enable them by doing something like the following:
sudo sysctl -w net.ipv4.ping_group_range="0 5000"
Index ¶
- Constants
- type Probe
- type ProbeConf
- func (*ProbeConf) Descriptor() ([]byte, []int)
- func (m *ProbeConf) GetIpVersion() int32
- func (m *ProbeConf) GetPacketsIntervalMsec() int32
- func (m *ProbeConf) GetPacketsPerProbe() int32
- func (m *ProbeConf) GetPayloadSize() int32
- func (m *ProbeConf) GetResolveTargetsInterval() int32
- func (m *ProbeConf) GetSource() isProbeConf_Source
- func (m *ProbeConf) GetSourceInterface() string
- func (m *ProbeConf) GetSourceIp() string
- func (m *ProbeConf) GetStatsExportInterval() int32
- func (m *ProbeConf) GetUseDatagramSocket() bool
- func (*ProbeConf) ProtoMessage()
- func (m *ProbeConf) Reset()
- func (m *ProbeConf) String() string
- func (*ProbeConf) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type ProbeConf_SourceInterface
- type ProbeConf_SourceIp
Constants ¶
const Default_ProbeConf_IpVersion int32 = 4
const Default_ProbeConf_PacketsIntervalMsec int32 = 25
const Default_ProbeConf_PacketsPerProbe int32 = 2
const Default_ProbeConf_PayloadSize int32 = 56
const Default_ProbeConf_ResolveTargetsInterval int32 = 5
const Default_ProbeConf_StatsExportInterval int32 = 5
const Default_ProbeConf_UseDatagramSocket bool = true
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Probe ¶
type Probe struct {
// contains filtered or unexported fields
}
Probe implements a ping probe type that sends ICMP ping packets to the targets and reports back statistics on packets sent, received and the rtt.
type ProbeConf ¶
type ProbeConf struct { // Set the source address to send packets from, either by providing an address // or a network interface. // // Types that are valid to be assigned to Source: // *ProbeConf_SourceIp // *ProbeConf_SourceInterface Source isProbeConf_Source `protobuf_oneof:"source"` // Packets per probe PacketsPerProbe *int32 `protobuf:"varint,6,opt,name=packets_per_probe,json=packetsPerProbe,def=2" json:"packets_per_probe,omitempty"` // How long to wait between two packets to the same target PacketsIntervalMsec *int32 `protobuf:"varint,7,opt,name=packets_interval_msec,json=packetsIntervalMsec,def=25" json:"packets_interval_msec,omitempty"` // Export stats after these many probes StatsExportInterval *int32 `protobuf:"varint,8,opt,name=stats_export_interval,json=statsExportInterval,def=5" json:"stats_export_interval,omitempty"` // Resolve targets after these many probes ResolveTargetsInterval *int32 `` /* 129-byte string literal not displayed */ // Ping payload size PayloadSize *int32 `protobuf:"varint,10,opt,name=payload_size,json=payloadSize,def=56" json:"payload_size,omitempty"` // IP protocol version IpVersion *int32 `protobuf:"varint,11,opt,name=ip_version,json=ipVersion,def=4" json:"ip_version,omitempty"` // Use datagram socket for ICMP. // This option enables unprivileged pings (that is, you don't require root // privilege to send ICMP packets). Note that most of the Linux distributions // don't allow unprivileged pings by default. To enable unprivileged pings on // some Linux distributions, you may need to run the following command: // sudo sysctl -w net.ipv4.ping_group_range="0 <large valid group id>" // net.ipv4.ping_group_range system setting takes two integers that specify // the group id range that is allowed to execute the unprivileged pings. Note // that the same setting (with ipv4 in the path) applies to IPv6 as well. UseDatagramSocket *bool `protobuf:"varint,12,opt,name=use_datagram_socket,json=useDatagramSocket,def=1" json:"use_datagram_socket,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*ProbeConf) Descriptor ¶
func (*ProbeConf) GetIpVersion ¶
func (*ProbeConf) GetPacketsIntervalMsec ¶
func (*ProbeConf) GetPacketsPerProbe ¶
func (*ProbeConf) GetPayloadSize ¶
func (*ProbeConf) GetResolveTargetsInterval ¶
func (*ProbeConf) GetSourceInterface ¶
func (*ProbeConf) GetSourceIp ¶
func (*ProbeConf) GetStatsExportInterval ¶
func (*ProbeConf) GetUseDatagramSocket ¶
func (*ProbeConf) ProtoMessage ¶
func (*ProbeConf) ProtoMessage()
type ProbeConf_SourceInterface ¶
type ProbeConf_SourceInterface struct {
SourceInterface string `protobuf:"bytes,4,opt,name=source_interface,json=sourceInterface,oneof"`
}
type ProbeConf_SourceIp ¶
type ProbeConf_SourceIp struct {
SourceIp string `protobuf:"bytes,3,opt,name=source_ip,json=sourceIp,oneof"`
}