Check if set delayed acknowledge timer struct exists.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4578 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
6dc556a891
commit
16f4e24e19
19
configure.in
19
configure.in
|
@ -343,6 +343,25 @@ AC_MSG_RESULT([$sctp_connectx_new])
|
||||||
if [[ "x$sctp_connectx_new" = "xyes" ]]; then
|
if [[ "x$sctp_connectx_new" = "xyes" ]]; then
|
||||||
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SCTP_CONNECTX_4"
|
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SCTP_CONNECTX_4"
|
||||||
fi
|
fi
|
||||||
|
AC_MSG_CHECKING([whether sctp_sack_info struct is present])
|
||||||
|
AC_TRY_COMPILE([#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/sctp.h>],[struct sctp_sack_info assoc_value;],[sctp_sack_info=yes])
|
||||||
|
AC_MSG_RESULT([$sctp_sack_info])
|
||||||
|
if [[ "x$sctp_sack_info" = "xyes" ]]; then
|
||||||
|
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SACK_INFO_STRUCT"
|
||||||
|
else
|
||||||
|
AC_MSG_CHECKING([whether sctp_assoc_value struct is present])
|
||||||
|
AC_TRY_COMPILE([#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/sctp.h>],[struct sctp_assoc_value assoc_value;],[sctp_assoc_value=yes])
|
||||||
|
AC_MSG_RESULT([$sctp_assoc_value])
|
||||||
|
if [[ "x$sctp_assoc_value" = "xyes" ]]; then
|
||||||
|
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_ASSOC_VALUE_STRUCT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
if [[ "x$HAVE_SCTP" != "xno" ]]; then
|
if [[ "x$HAVE_SCTP" != "xno" ]]; then
|
||||||
SCTP_FLAGS="-DHAVE_SCTP"
|
SCTP_FLAGS="-DHAVE_SCTP"
|
||||||
|
|
|
@ -257,8 +257,9 @@ bool LKSocket::setParams(const NamedList& params)
|
||||||
if (!aux)
|
if (!aux)
|
||||||
Debug(&plugin,DebugNote,"Failed to set SCTP paddr params! Reason: %s",strerror(errno));
|
Debug(&plugin,DebugNote,"Failed to set SCTP paddr params! Reason: %s",strerror(errno));
|
||||||
#ifdef SCTP_DELAYED_ACK_TIME
|
#ifdef SCTP_DELAYED_ACK_TIME
|
||||||
|
#ifdef HAVE_SACK_INFO_STRUCT
|
||||||
struct sctp_sack_info sack_info;
|
struct sctp_sack_info sack_info;
|
||||||
bzero(&paddr_params, sizeof(paddr_params));
|
bzero(&sack_info, sizeof(sack_info));
|
||||||
if (params.getParam(YSTRING("sack_delay"))) {
|
if (params.getParam(YSTRING("sack_delay"))) {
|
||||||
sack_info.sack_delay = params.getIntValue(YSTRING("sack_delay"));
|
sack_info.sack_delay = params.getIntValue(YSTRING("sack_delay"));
|
||||||
if (sack_info.sack_delay > 500)
|
if (sack_info.sack_delay > 500)
|
||||||
|
@ -270,6 +271,25 @@ bool LKSocket::setParams(const NamedList& params)
|
||||||
ret |= aux;
|
ret |= aux;
|
||||||
if (!aux)
|
if (!aux)
|
||||||
Debug(&plugin,DebugNote,"Failed to set SCTP sack params! Reason: %s",strerror(errno));
|
Debug(&plugin,DebugNote,"Failed to set SCTP sack params! Reason: %s",strerror(errno));
|
||||||
|
#elif HAVE_ASSOC_VALUE_STRUCT
|
||||||
|
struct sctp_assoc_value sassoc_value;
|
||||||
|
bzero(&sassoc_value, sizeof(sassoc_value));
|
||||||
|
if (params.getParam(YSTRING("sack_delay"))) {
|
||||||
|
sassoc_value.assoc_value = params.getIntValue(YSTRING("sack_delay"));
|
||||||
|
if (sassoc_value.assoc_value > 500)
|
||||||
|
sassoc_value.assoc_value = 500;
|
||||||
|
}
|
||||||
|
if (params.getParam(YSTRING("sack_freq")))
|
||||||
|
Debug(&plugin,DebugConf,"Unable to set sack_freq param! sack_info struct is missing!");
|
||||||
|
aux = setOption(IPPROTO_SCTP,SCTP_DELAYED_ACK_TIME, &sassoc_value, sizeof(sassoc_value));
|
||||||
|
ret |= aux;
|
||||||
|
if (!aux)
|
||||||
|
Debug(&plugin,DebugNote,"Failed to set SCTP sack params! Reason: %s",strerror(errno));
|
||||||
|
#else // HAVE_SACK_INFO_STRUCT
|
||||||
|
Debug(&plugin,DebugConf,"SCTP delayed ack time is unavailable no struct present!!");
|
||||||
|
#endif
|
||||||
|
#else // SCTP_DELAYED_ACK_TIME
|
||||||
|
Debug(&plugin,DebugConf,"SCTP delayed ack time is unavailable");
|
||||||
#endif
|
#endif
|
||||||
aux = Socket::setParams(params);
|
aux = Socket::setParams(params);
|
||||||
return ret || aux;
|
return ret || aux;
|
||||||
|
|
Loading…
Reference in New Issue