github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/tcpip/stack/hook_string.go (about)

     1  // Copyright 2021 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 Hook ."; 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[Prerouting-0]
    25  	_ = x[Input-1]
    26  	_ = x[Forward-2]
    27  	_ = x[Output-3]
    28  	_ = x[Postrouting-4]
    29  	_ = x[NumHooks-5]
    30  }
    31  
    32  const _Hook_name = "PreroutingInputForwardOutputPostroutingNumHooks"
    33  
    34  var _Hook_index = [...]uint8{0, 10, 15, 22, 28, 39, 47}
    35  
    36  func (i Hook) String() string {
    37  	if i >= Hook(len(_Hook_index)-1) {
    38  		return "Hook(" + strconv.FormatInt(int64(i), 10) + ")"
    39  	}
    40  	return _Hook_name[_Hook_index[i]:_Hook_index[i+1]]
    41  }