lib: rename one bfd parameter name to reflect real meaning

As to "struct bfd_session_arg", just rename parameter "ttl" to "hops", in order
to  reflect real meaning.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
This commit is contained in:
anlan_cs 2022-01-10 07:40:48 -05:00
parent 74a88f44c3
commit 03ff0db15d
2 changed files with 10 additions and 10 deletions

View File

@ -310,8 +310,8 @@ int zclient_bfd_command(struct zclient *zc, struct bfd_session_arg *args)
stream_putw(s, args->family); stream_putw(s, args->family);
stream_put(s, &args->src, addrlen); stream_put(s, &args->src, addrlen);
/* Send the expected TTL. */ /* Send the expected hops. */
stream_putc(s, args->ttl); stream_putc(s, args->hops);
/* Send interface name if any. */ /* Send interface name if any. */
if (args->mhop) { if (args->mhop) {
@ -349,8 +349,8 @@ int zclient_bfd_command(struct zclient *zc, struct bfd_session_arg *args)
stream_putw(s, args->family); stream_putw(s, args->family);
stream_put(s, &args->src, addrlen); stream_put(s, &args->src, addrlen);
/* Send the expected TTL. */ /* Send the expected hops. */
stream_putc(s, args->ttl); stream_putc(s, args->hops);
} else { } else {
/* Multi hop indicator. */ /* Multi hop indicator. */
stream_putc(s, 0); stream_putc(s, 0);
@ -396,7 +396,7 @@ struct bfd_session_params *bfd_sess_new(bsp_status_update updatecb, void *arg)
/* Set defaults. */ /* Set defaults. */
bsp->args.detection_multiplier = BFD_DEF_DETECT_MULT; bsp->args.detection_multiplier = BFD_DEF_DETECT_MULT;
bsp->args.ttl = 1; bsp->args.hops = 1;
bsp->args.min_rx = BFD_DEF_MIN_RX; bsp->args.min_rx = BFD_DEF_MIN_RX;
bsp->args.min_tx = BFD_DEF_MIN_TX; bsp->args.min_tx = BFD_DEF_MIN_TX;
bsp->args.vrf_id = VRF_DEFAULT; bsp->args.vrf_id = VRF_DEFAULT;
@ -648,13 +648,13 @@ void bfd_sess_set_vrf(struct bfd_session_params *bsp, vrf_id_t vrf_id)
void bfd_sess_set_hop_count(struct bfd_session_params *bsp, uint8_t hops) void bfd_sess_set_hop_count(struct bfd_session_params *bsp, uint8_t hops)
{ {
if (bsp->args.ttl == hops) if (bsp->args.hops == hops)
return; return;
/* If already installed, remove the old setting. */ /* If already installed, remove the old setting. */
_bfd_sess_remove(bsp); _bfd_sess_remove(bsp);
bsp->args.ttl = hops; bsp->args.hops = hops;
bsp->args.mhop = (hops > 1); bsp->args.mhop = (hops > 1);
} }
@ -692,7 +692,7 @@ enum bfd_session_state bfd_sess_status(const struct bfd_session_params *bsp)
uint8_t bfd_sess_hop_count(const struct bfd_session_params *bsp) uint8_t bfd_sess_hop_count(const struct bfd_session_params *bsp)
{ {
return bsp->args.ttl; return bsp->args.hops;
} }
const char *bfd_sess_profile(const struct bfd_session_params *bsp) const char *bfd_sess_profile(const struct bfd_session_params *bsp)

View File

@ -385,8 +385,8 @@ struct bfd_session_arg {
/** Multi hop indicator. */ /** Multi hop indicator. */
uint8_t mhop; uint8_t mhop;
/** Expected TTL. */ /** Expected hops. */
uint8_t ttl; uint8_t hops;
/** C bit (Control Plane Independent bit) indicator. */ /** C bit (Control Plane Independent bit) indicator. */
uint8_t cbit; uint8_t cbit;