github.com/noisysockets/netstack@v0.6.0/pkg/tcpip/stack/headertype_string.go (about)

     1  // Copyright 2020 The gVisor Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at //
     6  //     http://www.apache.org/licenses/LICENSE-2.0
     7  //
     8  // Unless required by applicable law or agreed to in writing, software
     9  // distributed under the License is distributed on an "AS IS" BASIS,
    10  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  // Code generated by "stringer -type headerType ."; DO NOT EDIT.
    15  
    16  package stack
    17  
    18  import "strconv"
    19  
    20  func _() {
    21  	// An "invalid array index" compiler error signifies that the constant values have changed.
    22  	// Re-run the stringer command to generate them again.
    23  	var x [1]struct{}
    24  	_ = x[virtioNetHeader-0]
    25  	_ = x[linkHeader-1]
    26  	_ = x[networkHeader-2]
    27  	_ = x[transportHeader-3]
    28  	_ = x[numHeaderType-4]
    29  }
    30  
    31  const _headerType_name = "virtioNetHeaderlinkHeadernetworkHeadertransportHeadernumHeaderType"
    32  
    33  var _headerType_index = [...]uint8{0, 10, 23, 38, 51}
    34  
    35  func (i headerType) String() string {
    36  	if i < 0 || i >= headerType(len(_headerType_index)-1) {
    37  		return "headerType(" + strconv.FormatInt(int64(i), 10) + ")"
    38  	}
    39  	return _headerType_name[_headerType_index[i]:_headerType_index[i+1]]
    40  }