diff --git a/acinclude.m4 b/acinclude.m4 index 0c8ccef..64e65d1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -35,6 +35,19 @@ AC_DEFUN([SIPSAK_TIMER], AC_DEFINE_UNQUOTED(DEFAULT_TIMEOUT, $def_timeout, [Default maximum timeout on waiting for response.]) ]) +AC_DEFUN([SIPSAK_OLD_FQDN], +[ + AC_MSG_CHECKING([oldstyle numeric]) + AC_ARG_ENABLE([ips], + AC_HELP_STRING([--disbale-ips], [compile with oldstyle --numeric behavior]), + [ + AC_MSG_RESULT([yes]) + AC_DEFINE([OLDSTYLE_FQDN], [1], [Oldstyle FQDN behavior]) + ], + [ AC_MSG_RESULT([not requested]) + ]) +]) + AC_DEFUN([CHECK_LIB_CARES], [ AC_MSG_CHECKING([for ares_version.h]) diff --git a/config.h.in b/config.h.in index a1e8316..3c7d098 100644 --- a/config.h.in +++ b/config.h.in @@ -193,6 +193,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Oldstyle FQDN behavior */ +#undef OLDSTYLE_FQDN + /* Name of package */ #undef PACKAGE diff --git a/configure b/configure index b481bfd..f12403e 100755 --- a/configure +++ b/configure @@ -1518,6 +1518,7 @@ Optional Features: --enable-dependency-tracking do not reject slow dependency extractors --enable-distcc compile in parallel with distcc --enable-timeout=SEC SIP timer T1 in SEC milliseconds (default 500) + --disbale-ips compile with oldstyle --numeric behavior Some influential environment variables: CC C compiler command @@ -8301,6 +8302,27 @@ _ACEOF + { echo "$as_me:$LINENO: checking oldstyle numeric" >&5 +echo $ECHO_N "checking oldstyle numeric... $ECHO_C" >&6; } + # Check whether --enable-ips was given. +if test "${enable_ips+set}" = set; then + enableval=$enable_ips; + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define OLDSTYLE_FQDN 1 +_ACEOF + + +else + { echo "$as_me:$LINENO: result: not requested" >&5 +echo "${ECHO_T}not requested" >&6; } + +fi + + + ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF diff --git a/configure.ac b/configure.ac index 3883cc2..fccb815 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,7 @@ else fi SIPSAK_TIMER +SIPSAK_OLD_FQDN AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/sipsak.c b/sipsak.c index ef7efba..3e6a890 100644 --- a/sipsak.c +++ b/sipsak.c @@ -123,7 +123,12 @@ void print_long_help() { " --outbound-proxy=HOSTNAME request target (outbound proxy)\n" " --hostname=HOSTNAME overwrites the local hostname in all headers\n" " --max-forwards=NUMBER the value for the max-forwards header field\n" - " --numeric use FQDN instead of IPs in the Via-Line\n"); +#ifdef OLDSTYLE_FQDN + " --numeric use IP instead of FQDN in the Via-Line\n" +#else + " --numeric use FQDN instead of IP in the Via-Line\n" +#endif +); printf(" --processes=NUMBER Divide the workflow among the number of processes\n" " --auth-username=STRING username for authentication\n" ); @@ -190,7 +195,11 @@ void print_help() { printf( " -H HOSTNAME overwrites the local hostname in all headers\n" " -m NUMBER the value for the max-forwards header field\n" - " -n use FQDN instead of IPs in the Via-Line\n" +#ifdef OLDSTYLE_FQDN + " -n use IP instead of FQDN in the Via-Line\n" +#else + " -n use FQDN instead of IP in the Via-Line\n" +#endif " -i deactivate the insertion of a Via-Line\n" " -a PASSWORD password for authentication\n" " (if omitted password=\"\")\n" @@ -288,7 +297,12 @@ int main(int argc, char *argv[]) warning_ext=rand_rem=nonce_count=replace_b=invite=message = 0; sleep_ms=empty_contact=nagios_warn=timing=outbound_proxy=symmetric = 0; namebeg=nameend=maxforw= -1; - numeric=via_ins=redirects=fix_crlf=processes = 1; +#ifdef OLDSTYLE_FQDN + numeric = 0; +#else + numeric = 1; +#endif + via_ins=redirects=fix_crlf=processes = 1; username=password=replace_str=hostname=contact_uri=mes_body = NULL; con_dis=auth_username=from_uri=headers=authhash = NULL; scheme = user = host = backup = req = rep = rec = NULL;