#  -*- text -*-
#
#
#  $Id: a945ba5d7c115340d6761ab8e5bd92fa8c672f40 $

#######################################################################
#
#  = ICMP Module
#
#  The module `icmp` is used for sending ICMP Echo Request messages.
#
#  This module is useful only for `xlat`.  Use it via the following expansion:
#
#	`%icmp(192.0.2.1)`
#
#  The module will "ping" the given IP address.  If that IP address responds
#  with an ICMP Echo Reply, then the result of the expansion will be `yes`.
#  If that IP address does not respond within the timeout, then the result
#  of the expansion will be `no`.
#
#  The IP address does not have to be a fixed string.  It can be another
#  expansion, such as:
#
#	`%icmp:(%{NAS-IP-Address})`
#
#
#  == Capabilities and Permissions
#
#  On Linux, you may need to do:
#
#	$ setcap cap_net_raw+ep ${bindir}/radiusd
#
#  In order for the `icmp` module to bind to a "raw" socket.
#

#
#  ## Configuration Settings
#
icmp {
	#
	#  interface:: Which interface to use for sending ICMP packets.
	#
	#  By default, packets are sent via the normal routing table.
	#
	#  Specifying an interface forces the packets to be sent via
	#  that particular interface.
	#
#	interface = eth0

	#
	#  src_ipaddr: Source address for ICMP messages.
	#
	src_ipaddr = *

	#
	#  timeout:: How long to wait for the reply.
	#
	#  Default is `1` seconds, which should be plenty for nearly
	#  anything. Range is `0.1s` to `10s`.
	#
	#  WARNING: You are strongly encouraged to NOT increase this
	#  value.  In fact, you are much better off decreasing it to a
	#  lower value.  Doing so will improve network stability and
	#  responsiveness.
	#
	timeout = 1s
}

#
#  ## Ping for IPv4
#
#  Copy of the `icmp` module, as it may be easier to remember `ping` than `icmp`.
#
icmp ping {
	timeout = 1s
	src_ipaddr = *
}

#
#  ## A version for ICMPv6
#
icmp ping6 {
	timeout = 1s
	src_ipaddr = ::
}
