PARAM_BRFWDDELAY,
PARAM_TXHOLDCNT,
PARAM_MAXHOPS,
+ PARAM_BRHELLO,
PARAM_FORCEPROTVERS,
PARAM_TOPCHNGTIME,
PARAM_TOPCHNGCNT,
{ PARAM_BRFWDDELAY, "bridge-forward-delay" },
{ PARAM_TXHOLDCNT, "tx-hold-count" },
{ PARAM_MAXHOPS, "max-hops" },
+ { PARAM_BRHELLO, "hello-time" },
{ PARAM_FORCEPROTVERS,"force-protocol-version" },
{ PARAM_TOPCHNGTIME, "time-since-topology-change" },
{ PARAM_TOPCHNGCNT, "topology-change-count" },
else
printf("none\n");
printf(" path cost %-10u ", s.root_path_cost);
- printf("internal path cost %u\n", s.internal_path_cost);
+ printf("internal path cost %u\n", s.internal_path_cost);
printf(" max age %-10hhu ", s.root_max_age);
- printf("bridge max age %hhu\n", s.bridge_max_age);
+ printf("bridge max age %hhu\n", s.bridge_max_age);
printf(" forward delay %-10hhu ", s.root_forward_delay);
- printf("bridge forward delay %hhu\n", s.bridge_forward_delay);
+ printf("bridge forward delay %hhu\n", s.bridge_forward_delay);
printf(" tx hold count %-10u ", s.tx_hold_count);
- printf("max hops %hhu\n", s.max_hops);
- printf(" force protocol version %s\n",
+ printf("max hops %hhu\n", s.max_hops);
+ printf(" hello time %-10u ", s.bridge_hello_time);
+ printf("force protocol version %s\n",
PROTO_VERS_STR(s.protocol_version));
printf(" time since topology change %u\n",
s.time_since_topology_change);
case PARAM_MAXHOPS:
printf("%hhu\n", s.max_hops);
break;
+ case PARAM_BRHELLO:
+ printf("%hhu\n", s.bridge_hello_time);
+ break;
case PARAM_FORCEPROTVERS:
printf("%s\n", PROTO_VERS_STR(s.protocol_version));
break;
return set_bridge_cfg(bridge_max_age, max_age);
}
+static int cmd_setbridgehello(int argc, char *const *argv)
+{
+ int br_index = get_index(argv[1], "bridge");
+ if(0 > br_index)
+ return br_index;
+ unsigned int hello_time = getuint(argv[2]);
+ if(hello_time > 255)
+ hello_time = 255;
+ return set_bridge_cfg(bridge_hello_time, hello_time);
+}
+
static int cmd_setbridgefdelay(int argc, char *const *argv)
{
int br_index = get_index(argv[1], "bridge");
"<bridge> <fwd_delay>", "Set bridge forward delay (4-30)"},
{2, 0, "setmaxhops", cmd_setbridgemaxhops,
"<bridge> <max_hops>", "Set bridge max hops (6-40)"},
+ {2, 0, "sethello", cmd_setbridgehello,
+ "<bridge> <hello_time>", "Set bridge hello time (1-10)"},
{2, 0, "setforcevers", cmd_setbridgeforcevers,
"<bridge> {mstp|rstp|stp}", "Force Spanning Tree protocol version"},
{2, 0, "settxholdcount", cmd_setbridgetxholdcount,
* ---- Bad IEEE! ----
* For now I decide: All structures will hold Hello_Time,
* because in 802.1D they do.
- * Maybe 802.1Q-2011 clarifies this, but I don't have the text.
+ * Besides, it is necessary for compatibility with old STP implementations.
*/
/* 802.1Q-2005 does not define but widely use variable name newInfoXst.
assign(tree->BridgeTimes.Forward_Delay, br->Forward_Delay);
assign(tree->BridgeTimes.Max_Age, br->Max_Age);
assign(tree->BridgeTimes.Message_Age, (__u8)0);
- /* 17.14 of 802.1D */
- assign(tree->BridgeTimes.Hello_Time, (__u8)2);
+ assign(tree->BridgeTimes.Hello_Time, br->Hello_Time);
/* 12.8.1.1.3.(b,c,d) */
tree->time_since_topology_change = 0;
assign(br->Transmit_Hold_Count, 6u); /* 17.14 of 802.1D */
assign(br->Migrate_Time, 3u); /* 17.14 of 802.1D */
assign(br->Ageing_Time, 300u);/* 8.8.3 Table 8-3 */
+ assign(br->Hello_Time, (__u8)2); /* 17.14 of 802.1D */
br->uptime = 0;
assign(status->tx_hold_count, br->Transmit_Hold_Count);
status->protocol_version = br->ForceProtocolVersion;
status->enabled = br->bridgeEnabled;
+ assign(status->bridge_hello_time, br->Hello_Time);
}
/* 12.8.1.2 Read MSTI Bridge Protocol Parameters */
}
}
+ if(cfg->set_bridge_hello_time)
+ {
+ if((1 > cfg->bridge_hello_time) || (10 < cfg->bridge_hello_time))
+ {
+ ERROR_BRNAME(br, "Bridge Hello Time must be between 1 and 10");
+ r = -1;
+ }
+ }
+
if(r)
return r;
}
}
+ if(cfg->set_bridge_hello_time)
+ {
+ if(cfg->bridge_hello_time != br->Hello_Time)
+ {
+ INFO_BRNAME(br, "bridge hello_time new=%hhu, old=%hhu",
+ cfg->bridge_hello_time, br->Hello_Time);
+ assign(br->Hello_Time, cfg->bridge_hello_time);
+ changed = changedBridgeTimes = true;
+ }
+ }
+
/* Thirdly, finalize changes */
if(changedBridgeTimes)
{
assign(tree->BridgeTimes.remainingHops, br->MaxHops);
assign(tree->BridgeTimes.Forward_Delay, br->Forward_Delay);
assign(tree->BridgeTimes.Max_Age, br->Max_Age);
+ assign(tree->BridgeTimes.Hello_Time, br->Hello_Time);
/* Comment found in rstpd by Srinivas Aji:
* Do this for any change in BridgeTimes.
* Otherwise we fail UNH rstp.op_D test 3.2 since when administratively
__u8 MaxHops; /* 13.22.o */
__u8 Forward_Delay; /* 13.22.f */
__u8 Max_Age; /* 13.22.i */
+ /* The 802.1Q-2005 (13.22.j) says that this parameter is substituted by
+ * the per-port Hello Time, but we still need it for compatibility
+ * with old STP implementations.
+ */
+ __u8 Hello_Time;
unsigned int Transmit_Hold_Count; /* 13.22.g */
unsigned int Migrate_Time; /* 13.22.h */
unsigned int Ageing_Time; /* 8.8.3 */
unsigned int internal_path_cost;
bool enabled; /* not in standard */
__u8 max_hops;
+ __u8 bridge_hello_time;
} CIST_BridgeStatus;
void MSTP_IN_get_cist_bridge_status(bridge_t *br, CIST_BridgeStatus *status);
__u8 max_hops;
bool set_max_hops;
+
+ __u8 bridge_hello_time;
+ bool set_bridge_hello_time;
} CIST_BridgeConfig;
int MSTP_IN_set_cist_bridge_config(bridge_t *br, CIST_BridgeConfig *cfg);