inet.af/netstack@v0.0.0-20220214151720-7585b01ddccf/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[linkHeader-0] 25 _ = x[networkHeader-1] 26 _ = x[transportHeader-2] 27 _ = x[numHeaderType-3] 28 } 29 30 const _headerType_name = "linkHeadernetworkHeadertransportHeadernumHeaderType" 31 32 var _headerType_index = [...]uint8{0, 10, 23, 38, 51} 33 34 func (i headerType) String() string { 35 if i < 0 || i >= headerType(len(_headerType_index)-1) { 36 return "headerType(" + strconv.FormatInt(int64(i), 10) + ")" 37 } 38 return _headerType_name[_headerType_index[i]:_headerType_index[i+1]] 39 }