github.com/osrg/gobgp/v3@v3.30.0/pkg/zebra/nexthopflag_string.go (about)

     1  // Code generated by "stringer -type=nexthopFlag"; DO NOT EDIT.
     2  
     3  package zebra
     4  
     5  import "strconv"
     6  
     7  func _() {
     8  	// An "invalid array index" compiler error signifies that the constant values have changed.
     9  	// Re-run the stringer command to generate them again.
    10  	var x [1]struct{}
    11  	_ = x[nexthopFlagActive-1]
    12  	_ = x[nexthopFlagFIB-2]
    13  	_ = x[nexthopFlagRecursive-4]
    14  	_ = x[nexthopFlagOnlink-8]
    15  	_ = x[nexthopFlagDuplicate-16]
    16  	_ = x[nexthopFlagRnhFiltered-32]
    17  	_ = x[nexthopFlagHasBackup-64]
    18  	_ = x[nexthopFlagSRTE-128]
    19  	_ = x[zapi6Frr7dot3nexthopFlagMatched-16]
    20  	_ = x[zapi6Frr7dot3nexthopFlagDuplicate-32]
    21  	_ = x[zapi6Frr7dot3nexthopFlagRnhFiltered-64]
    22  	_ = x[zapi6Frr7nexthopFlagFiltered-32]
    23  	_ = x[zapi6Frr7nexthopFlagDuplicate-64]
    24  	_ = x[zapi6Frr7nexthopFlagEvpnRvtep-128]
    25  }
    26  
    27  const (
    28  	_nexthopFlag_name_0 = "nexthopFlagActivenexthopFlagFIB"
    29  	_nexthopFlag_name_1 = "nexthopFlagRecursive"
    30  	_nexthopFlag_name_2 = "nexthopFlagOnlink"
    31  	_nexthopFlag_name_3 = "nexthopFlagDuplicate"
    32  	_nexthopFlag_name_4 = "nexthopFlagRnhFiltered"
    33  	_nexthopFlag_name_5 = "nexthopFlagHasBackup"
    34  	_nexthopFlag_name_6 = "nexthopFlagSRTE"
    35  )
    36  
    37  var (
    38  	_nexthopFlag_index_0 = [...]uint8{0, 17, 31}
    39  )
    40  
    41  func (i nexthopFlag) String() string {
    42  	switch {
    43  	case 1 <= i && i <= 2:
    44  		i -= 1
    45  		return _nexthopFlag_name_0[_nexthopFlag_index_0[i]:_nexthopFlag_index_0[i+1]]
    46  	case i == 4:
    47  		return _nexthopFlag_name_1
    48  	case i == 8:
    49  		return _nexthopFlag_name_2
    50  	case i == 16:
    51  		return _nexthopFlag_name_3
    52  	case i == 32:
    53  		return _nexthopFlag_name_4
    54  	case i == 64:
    55  		return _nexthopFlag_name_5
    56  	case i == 128:
    57  		return _nexthopFlag_name_6
    58  	default:
    59  		return "nexthopFlag(" + strconv.FormatInt(int64(i), 10) + ")"
    60  	}
    61  }