forked from TrueCloudLab/frostfs-api-go
[#356] refs: Add functions to work with zero subnet
Add helper functions which provide ease of use with subnet zero IDs. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
580f6c5554
commit
f0af5ce759
2 changed files with 30 additions and 0 deletions
|
@ -183,6 +183,16 @@ func (s *SubnetID) GetValue() uint32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
// IsZeroSubnet returns true iff the SubnetID refers to zero subnet.
|
||||
func IsZeroSubnet(id *SubnetID) bool {
|
||||
return id.GetValue() == 0
|
||||
}
|
||||
|
||||
// MakeZeroSubnet makes the SubnetID to refer to zero subnet.
|
||||
func MakeZeroSubnet(id *SubnetID) {
|
||||
id.SetValue(0)
|
||||
}
|
||||
|
||||
func (v *Version) GetMajor() uint32 {
|
||||
if v != nil {
|
||||
return v.major
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue