cmdmon: add refresh command

This command can be used to resolve the names of configured sources to
IP addresses again.
This commit is contained in:
Gautier PHILIPPON
2015-09-29 16:08:43 +02:00
committed by Miroslav Lichvar
parent 440c159217
commit 3eb43f4619
6 changed files with 49 additions and 1 deletions

View File

@@ -129,6 +129,7 @@ static const char permissions[] = {
PERMIT_AUTH, /* MODIFY_MAKESTEP */
PERMIT_OPEN, /* SMOOTHING */
PERMIT_AUTH, /* SMOOTHTIME */
PERMIT_AUTH, /* REFRESH */
};
/* ================================================== */
@@ -1140,6 +1141,14 @@ handle_reselect(CMD_Request *rx_message, CMD_Reply *tx_message)
SRC_ReselectSource();
}
/* ================================================== */
static void
handle_refresh(CMD_Request *rx_message, CMD_Reply *tx_message)
{
NSR_RefreshAddresses();
}
/* ================================================== */
/* Read a packet and process it */
@@ -1534,6 +1543,10 @@ read_from_cmd_socket(void *anything)
handle_modify_polltarget(&rx_message, &tx_message);
break;
case REQ_REFRESH:
handle_refresh(&rx_message, &tx_message);
break;
default:
assert(0);
break;