Add warm spare feature for balance modes

This commit is contained in:
Joseph Henry 2022-09-14 10:09:29 -07:00
parent 2248b1f846
commit e18d206248
No known key found for this signature in database
GPG key ID: C45B33FF5EBC9344
2 changed files with 49 additions and 16 deletions

View file

@ -1058,7 +1058,7 @@ class Bond {
}
/**
* @return the number of links comprising this bond which are considered alive
* @return the number of links in this bond which are considered alive
*/
inline uint8_t getNumAliveLinks()
{
@ -1066,7 +1066,7 @@ class Bond {
};
/**
* @return the number of links comprising this bond
* @return the number of links in this bond
*/
inline uint8_t getNumTotalLinks()
{
@ -1312,6 +1312,14 @@ class Bond {
return (! ipvPref || ((p->_addr.isV4() && (ipvPref == 4 || ipvPref == 46 || ipvPref == 64)) || ((p->_addr.isV6() && (ipvPref == 6 || ipvPref == 46 || ipvPref == 64)))));
}
/**
* @return True if a path exists on a link marked as a spare
*/
inline bool isSpare()
{
return mode == ZT_BOND_SLAVE_MODE_SPARE;
}
/**
* @return True if a path is preferred over another on the same physical link (according to user pref.)
*/