mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-30 15:02:54 +00:00
babeld: Presenting interface configuration parameters
* Presenting the configuration parameters enable-timestamps, max-rtt-penalty, rtt-min, and rtt-max. * Using #defines for the default configuration values instead of magic numbers. * rtt-max and rtt-min are entered and presented in milliseconds, but stored and internally used in microseconds. Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
This commit is contained in:
parent
1182f26489
commit
aa3ba071f6
@ -484,7 +484,9 @@ DEFUN (babel_set_rtt_min,
|
|||||||
babel_ifp = babel_get_if_nfo(ifp);
|
babel_ifp = babel_get_if_nfo(ifp);
|
||||||
assert (babel_ifp != NULL);
|
assert (babel_ifp != NULL);
|
||||||
|
|
||||||
babel_ifp->rtt_min = rtt;
|
babel_ifp->rtt_min =
|
||||||
|
rtt
|
||||||
|
* 1000; // value entered in milliseconds and stored as microseconds
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,7 +506,9 @@ DEFUN (babel_set_rtt_max,
|
|||||||
babel_ifp = babel_get_if_nfo(ifp);
|
babel_ifp = babel_get_if_nfo(ifp);
|
||||||
assert (babel_ifp != NULL);
|
assert (babel_ifp != NULL);
|
||||||
|
|
||||||
babel_ifp->rtt_max = rtt;
|
babel_ifp->rtt_max =
|
||||||
|
rtt
|
||||||
|
* 1000; // value entered in milliseconds and stored as microseconds
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1328,6 +1332,27 @@ interface_config_write (struct vty *vty)
|
|||||||
babel_ifp->update_interval);
|
babel_ifp->update_interval);
|
||||||
write++;
|
write++;
|
||||||
}
|
}
|
||||||
|
if (CHECK_FLAG(babel_ifp->flags, BABEL_IF_TIMESTAMPS)) {
|
||||||
|
vty_out(vty, " babel enable-timestamps\n");
|
||||||
|
write++;
|
||||||
|
}
|
||||||
|
if (babel_ifp->max_rtt_penalty != BABEL_DEFAULT_MAX_RTT_PENALTY) {
|
||||||
|
vty_out(vty, " babel max-rtt-penalty %u\n",
|
||||||
|
babel_ifp->max_rtt_penalty);
|
||||||
|
write++;
|
||||||
|
}
|
||||||
|
if (babel_ifp->rtt_decay != BABEL_DEFAULT_RTT_DECAY) {
|
||||||
|
vty_out(vty, " babel rtt-decay %u\n", babel_ifp->rtt_decay);
|
||||||
|
write++;
|
||||||
|
}
|
||||||
|
if (babel_ifp->rtt_min != BABEL_DEFAULT_RTT_MIN) {
|
||||||
|
vty_out(vty, " babel rtt-min %u\n", babel_ifp->rtt_min / 1000);
|
||||||
|
write++;
|
||||||
|
}
|
||||||
|
if (babel_ifp->rtt_max != BABEL_DEFAULT_RTT_MAX) {
|
||||||
|
vty_out(vty, " babel rtt-max %u\n", babel_ifp->rtt_max / 1000);
|
||||||
|
write++;
|
||||||
|
}
|
||||||
/* Some parameters have different defaults for wired/wireless. */
|
/* Some parameters have different defaults for wired/wireless. */
|
||||||
if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED)) {
|
if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED)) {
|
||||||
if (!CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) {
|
if (!CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON)) {
|
||||||
@ -1395,9 +1420,10 @@ babel_interface_allocate (void)
|
|||||||
babel_ifp->bucket_time = babel_now.tv_sec;
|
babel_ifp->bucket_time = babel_now.tv_sec;
|
||||||
babel_ifp->bucket = BUCKET_TOKENS_MAX;
|
babel_ifp->bucket = BUCKET_TOKENS_MAX;
|
||||||
babel_ifp->hello_seqno = (frr_weak_random() & 0xFFFF);
|
babel_ifp->hello_seqno = (frr_weak_random() & 0xFFFF);
|
||||||
babel_ifp->rtt_min = 10000;
|
babel_ifp->rtt_decay = BABEL_DEFAULT_RTT_DECAY;
|
||||||
babel_ifp->rtt_max = 120000;
|
babel_ifp->rtt_min = BABEL_DEFAULT_RTT_MIN;
|
||||||
babel_ifp->max_rtt_penalty = 150;
|
babel_ifp->rtt_max = BABEL_DEFAULT_RTT_MAX;
|
||||||
|
babel_ifp->max_rtt_penalty = BABEL_DEFAULT_MAX_RTT_PENALTY;
|
||||||
babel_ifp->hello_interval = BABEL_DEFAULT_HELLO_INTERVAL;
|
babel_ifp->hello_interval = BABEL_DEFAULT_HELLO_INTERVAL;
|
||||||
babel_ifp->update_interval = BABEL_DEFAULT_UPDATE_INTERVAL;
|
babel_ifp->update_interval = BABEL_DEFAULT_UPDATE_INTERVAL;
|
||||||
babel_ifp->channel = BABEL_IF_CHANNEL_INTERFERING;
|
babel_ifp->channel = BABEL_IF_CHANNEL_INTERFERING;
|
||||||
|
@ -81,6 +81,11 @@ THE SOFTWARE.
|
|||||||
#define BABEL_DEFAULT_HELLO_INTERVAL 4000
|
#define BABEL_DEFAULT_HELLO_INTERVAL 4000
|
||||||
#define BABEL_DEFAULT_UPDATE_INTERVAL 16000
|
#define BABEL_DEFAULT_UPDATE_INTERVAL 16000
|
||||||
#define BABEL_DEFAULT_RESEND_DELAY 2000
|
#define BABEL_DEFAULT_RESEND_DELAY 2000
|
||||||
|
#define BABEL_DEFAULT_RTT_DECAY 42
|
||||||
|
|
||||||
|
/* Values in microseconds */
|
||||||
|
#define BABEL_DEFAULT_RTT_MIN 10000
|
||||||
|
#define BABEL_DEFAULT_RTT_MAX 120000
|
||||||
|
|
||||||
/* In units of seconds */
|
/* In units of seconds */
|
||||||
#define BABEL_DEFAULT_SMOOTHING_HALF_LIFE 4
|
#define BABEL_DEFAULT_SMOOTHING_HALF_LIFE 4
|
||||||
@ -90,6 +95,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
#define BABEL_DEFAULT_RXCOST_WIRED 96
|
#define BABEL_DEFAULT_RXCOST_WIRED 96
|
||||||
#define BABEL_DEFAULT_RXCOST_WIRELESS 256
|
#define BABEL_DEFAULT_RXCOST_WIRELESS 256
|
||||||
|
#define BABEL_DEFAULT_MAX_RTT_PENALTY 150
|
||||||
|
|
||||||
/* Babel structure. */
|
/* Babel structure. */
|
||||||
struct babel
|
struct babel
|
||||||
|
Loading…
Reference in New Issue
Block a user