diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-03-10 17:31:57 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-03-16 22:14:57 +0300 |
| commit | 4df3e31c3d09f83340e7c1a0d7645d0bdddcb68f (patch) | |
| tree | 01b36a351e9a10d91d25d5dd802bb7f09a69108c /bfdd/config.c | |
| parent | 81ef5048dd229570f27c524d6d6268caecf3b663 (diff) | |
bfdd: separate echo rx/tx timers
Currently there is a single interval for both RX and TX echo functions.
This commit introduces separate RX and TX timers for echo packets.
The main advantage is to be able to set the receive interval to zero
when we don't want to receive echo packets from the remote system.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bfdd/config.c')
| -rw-r--r-- | bfdd/config.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/bfdd/config.c b/bfdd/config.c index b71670f012..a97caf137e 100644 --- a/bfdd/config.c +++ b/bfdd/config.c @@ -135,7 +135,8 @@ static int parse_list(struct json_object *jo, enum peer_list_type plt, bpc.bpc_detectmultiplier = BFD_DEFDETECTMULT; bpc.bpc_recvinterval = BFD_DEFREQUIREDMINRX; bpc.bpc_txinterval = BFD_DEFDESIREDMINTX; - bpc.bpc_echointerval = BFD_DEF_REQ_MIN_ECHO; + bpc.bpc_echorecvinterval = BFD_DEF_REQ_MIN_ECHO_RX; + bpc.bpc_echotxinterval = BFD_DEF_DES_MIN_ECHO_TX; switch (plt) { case PLT_IPV4: @@ -250,11 +251,16 @@ static int parse_peer_config(struct json_object *jo, struct bfd_peer_cfg *bpc) bpc->bpc_has_txinterval = true; zlog_debug(" transmit-interval: %" PRIu64, bpc->bpc_txinterval); - } else if (strcmp(key, "echo-interval") == 0) { - bpc->bpc_echointerval = json_object_get_int64(jo_val); - bpc->bpc_has_echointerval = true; - zlog_debug(" echo-interval: %" PRIu64, - bpc->bpc_echointerval); + } else if (strcmp(key, "echo-receive-interval") == 0) { + bpc->bpc_echorecvinterval = json_object_get_int64(jo_val); + bpc->bpc_has_echorecvinterval = true; + zlog_debug(" echo-receive-interval: %" PRIu64, + bpc->bpc_echorecvinterval); + } else if (strcmp(key, "echo-transmit-interval") == 0) { + bpc->bpc_echotxinterval = json_object_get_int64(jo_val); + bpc->bpc_has_echotxinterval = true; + zlog_debug(" echo-transmit-interval: %" PRIu64, + bpc->bpc_echotxinterval); } else if (strcmp(key, "create-only") == 0) { bpc->bpc_createonly = json_object_get_boolean(jo_val); zlog_debug(" create-only: %s", @@ -463,8 +469,10 @@ char *config_notify_config(const char *op, struct bfd_session *bs) bs->timers.required_min_rx / 1000); json_object_int_add(resp, "transmit-interval", bs->timers.desired_min_tx / 1000); - json_object_int_add(resp, "echo-interval", - bs->timers.required_min_echo / 1000); + json_object_int_add(resp, "echo-receive-interval", + bs->timers.required_min_echo_rx / 1000); + json_object_int_add(resp, "echo-transmit-interval", + bs->timers.desired_min_echo_tx / 1000); json_object_int_add(resp, "remote-detect-multiplier", bs->remote_detect_mult); @@ -472,7 +480,7 @@ char *config_notify_config(const char *op, struct bfd_session *bs) bs->remote_timers.required_min_rx / 1000); json_object_int_add(resp, "remote-transmit-interval", bs->remote_timers.desired_min_tx / 1000); - json_object_int_add(resp, "remote-echo-interval", + json_object_int_add(resp, "remote-echo-receive-interval", bs->remote_timers.required_min_echo / 1000); if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO)) |
