Commit 1616ee4a authored by Juliusz Chroboczek's avatar Juliusz Chroboczek Committed by Juliusz Chroboczek

Add a per-interface flag rfc6126-compatible.

parent b98fb201
...@@ -411,6 +411,11 @@ for tunnel interfaces, and ...@@ -411,6 +411,11 @@ for tunnel interfaces, and
.B false .B false
otherwise. otherwise.
.TP .TP
.BR rfc6126\-compatible " {" true | false }
Only send TLVs that are defined by RFC 6126, the older version of Babel.
The default is
.BR false .
.TP
.BI rtt\-decay " decay" .BI rtt\-decay " decay"
This specifies the decay factor for the exponential moving average of This specifies the decay factor for the exponential moving average of
RTT samples, in units of 1/256. Must be between 1 and 256, inclusive. RTT samples, in units of 1/256. Must be between 1 and 256, inclusive.
......
...@@ -600,6 +600,12 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure, ...@@ -600,6 +600,12 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure,
if(c < -1) if(c < -1)
goto error; goto error;
if_conf->enable_timestamps = v; if_conf->enable_timestamps = v;
} else if(strcmp(token, "rfc6126-compatible") == 0) {
int v;
c = getbool(c, &v, gnc, closure);
if(c < -1)
goto error;
if_conf->rfc6126 = v;
} else if(strcmp(token, "rtt-decay") == 0) { } else if(strcmp(token, "rtt-decay") == 0) {
int decay; int decay;
c = getint(c, &decay, gnc, closure); c = getint(c, &decay, gnc, closure);
...@@ -707,6 +713,7 @@ merge_ifconf(struct interface_conf *dest, ...@@ -707,6 +713,7 @@ merge_ifconf(struct interface_conf *dest,
MERGE(faraway); MERGE(faraway);
MERGE(channel); MERGE(channel);
MERGE(enable_timestamps); MERGE(enable_timestamps);
MERGE(rfc6126);
MERGE(rtt_decay); MERGE(rtt_decay);
MERGE(rtt_min); MERGE(rtt_min);
MERGE(rtt_max); MERGE(rtt_max);
......
...@@ -434,6 +434,11 @@ interface_up(struct interface *ifp, int up) ...@@ -434,6 +434,11 @@ interface_up(struct interface *ifp, int up)
"but timestamps are disabled on interface %s.\n", "but timestamps are disabled on interface %s.\n",
ifp->name); ifp->name);
if(IF_CONF(ifp, rfc6126) == CONFIG_YES)
ifp->flags |= IF_RFC6126;
else
ifp->flags &= ~IF_RFC6126;
rc = check_link_local_addresses(ifp); rc = check_link_local_addresses(ifp);
if(rc < 0) { if(rc < 0) {
goto fail; goto fail;
......
...@@ -47,6 +47,7 @@ struct interface_conf { ...@@ -47,6 +47,7 @@ struct interface_conf {
char faraway; char faraway;
int channel; int channel;
int enable_timestamps; int enable_timestamps;
int rfc6126;
unsigned int rtt_decay; unsigned int rtt_decay;
unsigned int rtt_min; unsigned int rtt_min;
unsigned int rtt_max; unsigned int rtt_max;
...@@ -70,6 +71,8 @@ struct interface_conf { ...@@ -70,6 +71,8 @@ struct interface_conf {
#define IF_FARAWAY (1 << 4) #define IF_FARAWAY (1 << 4)
/* Send timestamps in Hello and IHU. */ /* Send timestamps in Hello and IHU. */
#define IF_TIMESTAMPS (1 << 5) #define IF_TIMESTAMPS (1 << 5)
/* Remain compatible with RFC 6126. */
#define IF_RFC6126 (1 << 6)
/* Only INTERFERING can appear on the wire. */ /* Only INTERFERING can appear on the wire. */
#define IF_CHANNEL_UNKNOWN 0 #define IF_CHANNEL_UNKNOWN 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment