[Listener] check_configuration(): port numbers

This commit is contained in:
Matteo Cypriani 2011-03-11 13:23:46 +01:00
parent 5c123d769f
commit 8e1466eacc
1 changed files with 32 additions and 0 deletions

View File

@ -397,6 +397,38 @@ void check_configuration()
" the aggregation IP as the destination of"
" autocalibration requests.\n") ;
}
// Port numbers //
if (GET_AGGREGATION_PORT() < 1 || GET_AGGREGATION_PORT() > 65535)
{
if (GET_VERBOSE())
fprintf(stderr, "Warning! Bad aggregation_port:"
" failing back to the default value.\n") ;
SET_AGGREGATION_PORT(AGGREGATE_DEFAULT_PORT) ;
}
if (GET_LISTENING_PORT() < 1 || GET_LISTENING_PORT() > 65535)
{
if (GET_VERBOSE())
fprintf(stderr, "Warning! Bad listening_port:"
" failing back to the default value.\n") ;
SET_LISTENING_PORT(LOC_REQUEST_DEFAULT_PORT) ;
}
if (GET_AUTOCALIBRATION_REQUEST_PORT() < 1 ||
GET_AUTOCALIBRATION_REQUEST_PORT() > 65535)
{
if (GET_VERBOSE())
fprintf(stderr, "Warning! Bad autocalibration_request_port:"
" failing back to the default value.\n") ;
SET_AUTOCALIBRATION_REQUEST_PORT(DEFAULT_AUTOCALIBRATION_REQUEST_PORT) ;
}
if (GET_AUTOCALIBRATION_PORT() < 1 ||
GET_AUTOCALIBRATION_PORT() > 65535)
{
if (GET_VERBOSE())
fprintf(stderr, "Warning! Bad autocalibration_port:"
" failing back to the default value.\n") ;
SET_AUTOCALIBRATION_PORT(DEFAULT_AUTOCALIBRATION_PORT) ;
}
}