cmdmon: merge add server/peer requests

Instead of having two separate requests in the protocol for adding a
server and peer, specify the type of the new source in the request data.
This commit is contained in:
Miroslav Lichvar
2019-12-04 11:16:26 +01:00
parent 3763befd62
commit 00fff161cf
4 changed files with 47 additions and 35 deletions

View File

@@ -116,10 +116,11 @@ static const struct request_length request_lengths[] = {
REQ_LENGTH_ENTRY(ntp_data, ntp_data), /* NTP_DATA */
{ 0, 0 }, /* ADD_SERVER2 */
{ 0, 0 }, /* ADD_PEER2 */
REQ_LENGTH_ENTRY(ntp_source, null), /* ADD_SERVER3 */
REQ_LENGTH_ENTRY(ntp_source, null), /* ADD_PEER3 */
{ 0, 0 }, /* ADD_SERVER3 */
{ 0, 0 }, /* ADD_PEER3 */
REQ_LENGTH_ENTRY(null, null), /* SHUTDOWN */
REQ_LENGTH_ENTRY(null, null), /* ONOFFLINE */
REQ_LENGTH_ENTRY(ntp_source, null), /* ADD_SOURCE */
};
static const uint16_t reply_lengths[] = {