icmp.go 349 B

12345678910111213141516
  1. // Copyright 2013 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package ipv4
  5. // An ICMPType represents a type of ICMP message.
  6. type ICMPType int
  7. func (typ ICMPType) String() string {
  8. s, ok := icmpTypes[typ]
  9. if !ok {
  10. return "<nil>"
  11. }
  12. return s
  13. }