3 # Networking-related macros
11 # Check for --with-fqdn, and DEFINE USE_FQDN if given.
13 AC_DEFUN([AMANDA_WITH_FQDN], [
15 AS_HELP_STRING([--with-fqdn],
16 [use FQDN's to backup multiple networks]),
17 [ USE_FQDN=$withval ], [ USE_FQDN=no ])
23 [Define for backups being done on a multiple networks and FQDNs are used. ])
25 *) AC_MSG_ERROR([You must not supply an argument to --with-fqdn option.])
32 # AMANDA_WITH_REUSEPORTS
36 # Check for --with-reuseports, and DEFINE USE_REUSEADDR if given.
38 AC_DEFUN([AMANDA_WITH_REUSEPORTS], [
39 AC_ARG_WITH(reuseports,
40 AS_HELP_STRING([--without-reuseaddr],
41 [Don't reuse network connections until full timeout period]),
43 y | ye | yes) USE_REUSEADDR=no;;
44 n | no) USE_REUSEADDR=yes;;
45 *) AC_MSG_ERROR([You must not supply an argument to --without-reuseports]);;
48 [ USE_REUSEADDR=yes; ])
49 if test x"$USE_REUSEADDR" = x"yes"; then
50 AC_DEFINE(USE_REUSEADDR,1,
51 [Define to set SO_REUSEADDR on network connections.])
57 # AMANDA_WITH_PORTRANGES
61 # Implement --with-low-tcpportrange, --with-tcpportrange, and --with-udpportrange.
62 # Results are DEFINED and substituted in LOW_TCPPORTRANGE, TCPPORTRANGE, and
63 # UDPPORTRANGE, respectively.
65 AC_DEFUN([AMANDA_WITH_PORTRANGES], [
66 AC_ARG_WITH(low-tcpportrange,
67 [ --with-low-tcpportrange=low,high
68 bind reserved TCP server sockets to ports within],
69 [ LOW_TCPPORTRANGE="$withval" ],
70 [ LOW_TCPPORTRANGE=unlimited ])
72 if test x"$LOW_TCPPORTRANGE" != x"unlimited"; then
73 if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
74 AC_MSG_ERROR([--with-low-tcpportrange requires two comma-separated positive numbers])
76 min_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/,.*//'`
77 max_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/.*,//'`
78 if test $min_low_tcp_port -gt $max_low_tcp_port; then
79 AC_MSG_ERROR([the second TCP port number must be greater than the first in --with-low-tcpportrange])
81 if test $min_low_tcp_port -lt 512; then
82 AMANDA_MSG_WARN([the low TCP port range should be 512 or greater in --with-low-tcpportrange])
84 if test $max_low_tcp_port -ge 1024; then
85 AMANDA_MSG_WARN([the low TCP port range should be less than 1024 in --with-low-tcpportrange])
87 AC_DEFINE_UNQUOTED(LOW_TCPPORTRANGE,$LOW_TCPPORTRANGE,
88 [A comma-separated list of two integers, determining the minimum and maximum
89 * reserved TCP port numbers sockets should be bound to. (mainly for amrecover) ])
92 dnl note that AS_HELP_STRING cannot handle commas in its argument..
93 AC_ARG_WITH(tcpportrange,
94 [ --with-tcpportrange=low,high
95 bind unreserved TCP server sockets to ports within],
96 [ TCPPORTRANGE="$withval" ],
97 [ TCPPORTRANGE="unlimited" ])
99 if test x"$TCPPORTRANGE" != x"unlimited"; then
100 if test x`echo "$TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
101 AC_MSG_ERROR([--with-tcpportrange requires two comma-separated positive numbers])
103 min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'`
104 max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'`
105 if test $min_tcp_port -gt $max_tcp_port; then
106 AC_MSG_ERROR([the second TCP port number must be greater than the first in --with-tcpportrange])
108 if test $min_tcp_port -lt 1024; then
109 AMANDA_MSG_WARN([the TCP port range should be 1024 or greater in --with-tcpportrange])
111 if test $max_tcp_port -ge 65536; then
112 AMANDA_MSG_WARN([the TCP port range should be less than 65536 in --with-tcpportrange])
114 AC_DEFINE_UNQUOTED(TCPPORTRANGE,$TCPPORTRANGE,
115 [A comma-separated list of two integers, determining the minimum and
116 * maximum unreserved TCP port numbers sockets should be bound to. ])
119 AC_ARG_WITH(udpportrange,
120 [ --with-udpportrange=low,high
121 bind reserved UDP server sockets to ports within],
122 [ UDPPORTRANGE="$withval" ],
123 [ UDPPORTRANGE="unlimited" ])
124 if test x"$UDPPORTRANGE" != x"unlimited"; then
125 if test x`echo "$UDPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
126 AC_MSG_ERROR([--with-udpportrange requires two comma-separated positive numbers])
128 min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'`
129 max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'`
130 if test $min_udp_port -gt $max_udp_port; then
131 AC_MSG_ERROR([the second UDP port number must be greater than the first in --with-udpportrange])
133 if test $max_udp_port -ge 1024; then
134 AMANDA_MSG_WARN([the UDP port range should be less than 1025 in --with-udpportrange])
136 if test $min_udp_port -le 0; then
137 AMANDA_MSG_WARN([the UDP port range should be greater than 0 in --with-udpportrange])
139 AC_DEFINE_UNQUOTED(UDPPORTRANGE,$UDPPORTRANGE,
140 [A comma-separated list of two integers, determining the minimum and
141 * maximum reserved UDP port numbers sockets should be bound to. ])
143 AC_SUBST(UDPPORTRANGE)
144 AC_SUBST(TCPPORTRANGE)
145 AC_SUBST(LOW_TCPPORTRANGE)
150 # AMANDA_WITH_BUFFERED_DUMP
154 # Implement --with-buffered-dump, and DEFINEs DUMPER_SOCKET_BUFFERING if the option
157 AC_DEFUN([AMANDA_WITH_BUFFERED_DUMP], [
158 AC_ARG_WITH(buffered-dump,
159 AS_HELP_STRING([--with-buffered-dump],
160 [buffer the dumping sockets on the server for speed]),
161 [ DUMPER_SOCKET_BUFFERING=$withval ],
162 [ DUMPER_SOCKET_BUFFERING=no ])
163 case "$DUMPER_SOCKET_BUFFERING" in
166 AC_DEFINE(DUMPER_SOCKET_BUFFERING,1,
167 [Define if dumper should buffer the sockets for faster throughput. ])
169 *) AC_MSG_ERROR([You must not supply an argument to --with-buffered-dump.]) ;;