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 AS_HELP_STRING([--with-low-tcpportrange=low/high],
68 [bind reserved TCP server sockets to ports within this range (default: unlimited)]),
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 AC_ARG_WITH(tcpportrange,
93 AS_HELP_STRING([--with-tcpportrange=low/high],
94 [bind unreserved TCP server sockets to ports within this range (default: unlimited)]),
95 [ TCPPORTRANGE="$withval" ],
96 [ TCPPORTRANGE="unlimited" ])
98 if test x"$TCPPORTRANGE" != x"unlimited"; then
99 if test x`echo "$TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
100 AC_MSG_ERROR([--with-tcpportrange requires two comma-separated positive numbers])
102 min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'`
103 max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'`
104 if test $min_tcp_port -gt $max_tcp_port; then
105 AC_MSG_ERROR([the second TCP port number must be greater than the first in --with-tcpportrange])
107 if test $min_tcp_port -lt 1024; then
108 AMANDA_MSG_WARN([the TCP port range should be 1024 or greater in --with-tcpportrange])
110 if test $max_tcp_port -ge 65536; then
111 AMANDA_MSG_WARN([the TCP port range should be less than 65536 in --with-tcpportrange])
113 AC_DEFINE_UNQUOTED(TCPPORTRANGE,$TCPPORTRANGE,
114 [A comma-separated list of two integers, determining the minimum and
115 * maximum unreserved TCP port numbers sockets should be bound to. ])
118 AC_ARG_WITH(udpportrange,
119 AS_HELP_STRING([--with-udpportrange=low/high],
120 [bind reserved UDP server sockets to ports within this range (default: unlimited)]),
121 [ UDPPORTRANGE="$withval" ],
122 [ UDPPORTRANGE="unlimited" ])
123 if test x"$UDPPORTRANGE" != x"unlimited"; then
124 if test x`echo "$UDPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
125 AC_MSG_ERROR([--with-udpportrange requires two comma-separated positive numbers])
127 min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'`
128 max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'`
129 if test $min_udp_port -gt $max_udp_port; then
130 AC_MSG_ERROR([the second UDP port number must be greater than the first in --with-udpportrange])
132 if test $max_udp_port -ge 1024; then
133 AMANDA_MSG_WARN([the UDP port range should be less than 1025 in --with-udpportrange])
135 if test $min_udp_port -le 0; then
136 AMANDA_MSG_WARN([the UDP port range should be greater than 0 in --with-udpportrange])
138 AC_DEFINE_UNQUOTED(UDPPORTRANGE,$UDPPORTRANGE,
139 [A comma-separated list of two integers, determining the minimum and
140 * maximum reserved UDP port numbers sockets should be bound to. ])
142 AC_SUBST(UDPPORTRANGE)
143 AC_SUBST(TCPPORTRANGE)
144 AC_SUBST(LOW_TCPPORTRANGE)
149 # AMANDA_WITH_BUFFERED_DUMP
153 # Implement --with-buffered-dump, and DEFINEs DUMPER_SOCKET_BUFFERING if the option
156 AC_DEFUN([AMANDA_WITH_BUFFERED_DUMP], [
157 AC_ARG_WITH(buffered-dump,
158 AS_HELP_STRING([--with-buffered-dump],
159 [buffer the dumping sockets on the server for speed]),
160 [ DUMPER_SOCKET_BUFFERING=$withval ],
161 [ DUMPER_SOCKET_BUFFERING=no ])
162 case "$DUMPER_SOCKET_BUFFERING" in
165 AC_DEFINE(DUMPER_SOCKET_BUFFERING,1,
166 [Define if dumper should buffer the sockets for faster throughput. ])
168 *) AC_MSG_ERROR([You must not supply an argument to --with-buffered-dump.]) ;;