mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
Fresh dep ensure
This commit is contained in:
5
vendor/golang.org/x/net/icmp/endpoint.go
generated
vendored
5
vendor/golang.org/x/net/icmp/endpoint.go
generated
vendored
@ -59,8 +59,9 @@ func (c *PacketConn) ReadFrom(b []byte) (int, net.Addr, error) {
|
||||
}
|
||||
|
||||
// WriteTo writes the ICMP message b to dst.
|
||||
// Dst must be net.UDPAddr when c is a non-privileged
|
||||
// datagram-oriented ICMP endpoint. Otherwise it must be net.IPAddr.
|
||||
// The provided dst must be net.UDPAddr when c is a non-privileged
|
||||
// datagram-oriented ICMP endpoint.
|
||||
// Otherwise it must be net.IPAddr.
|
||||
func (c *PacketConn) WriteTo(b []byte, dst net.Addr) (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
|
6
vendor/golang.org/x/net/icmp/extension.go
generated
vendored
6
vendor/golang.org/x/net/icmp/extension.go
generated
vendored
@ -14,11 +14,13 @@ import (
|
||||
// An Extension represents an ICMP extension.
|
||||
type Extension interface {
|
||||
// Len returns the length of ICMP extension.
|
||||
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
|
||||
// The provided proto must be either the ICMPv4 or ICMPv6
|
||||
// protocol number.
|
||||
Len(proto int) int
|
||||
|
||||
// Marshal returns the binary encoding of ICMP extension.
|
||||
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
|
||||
// The provided proto must be either the ICMPv4 or ICMPv6
|
||||
// protocol number.
|
||||
Marshal(proto int) ([]byte, error)
|
||||
}
|
||||
|
||||
|
3
vendor/golang.org/x/net/icmp/extension_test.go
generated
vendored
3
vendor/golang.org/x/net/icmp/extension_test.go
generated
vendored
@ -277,8 +277,7 @@ func TestMarshalAndParseExtension(t *testing.T) {
|
||||
0x20, 0x00, 0x00, 0x00,
|
||||
},
|
||||
obj: []byte{
|
||||
0x00, 0x0c, 0x03, 0x02,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x08, 0x03, 0x02,
|
||||
0x00, 0x00, 0x03, 0x8f,
|
||||
},
|
||||
ext: &InterfaceIdent{
|
||||
|
8
vendor/golang.org/x/net/icmp/interface.go
generated
vendored
8
vendor/golang.org/x/net/icmp/interface.go
generated
vendored
@ -259,7 +259,7 @@ func (ifi *InterfaceIdent) Len(_ int) int {
|
||||
}
|
||||
return 4 + (l+3)&^3
|
||||
case typeInterfaceByIndex:
|
||||
return 4 + 8
|
||||
return 4 + 4
|
||||
case typeInterfaceByAddress:
|
||||
return 4 + 4 + (len(ifi.Addr)+3)&^3
|
||||
default:
|
||||
@ -284,7 +284,7 @@ func (ifi *InterfaceIdent) marshal(proto int, b []byte) error {
|
||||
case typeInterfaceByName:
|
||||
copy(b[4:], ifi.Name)
|
||||
case typeInterfaceByIndex:
|
||||
binary.BigEndian.PutUint64(b[4:4+8], uint64(ifi.Index))
|
||||
binary.BigEndian.PutUint32(b[4:4+4], uint32(ifi.Index))
|
||||
case typeInterfaceByAddress:
|
||||
binary.BigEndian.PutUint16(b[4:4+2], uint16(ifi.AFI))
|
||||
b[4+2] = byte(len(ifi.Addr))
|
||||
@ -302,10 +302,10 @@ func parseInterfaceIdent(b []byte) (Extension, error) {
|
||||
case typeInterfaceByName:
|
||||
ifi.Name = strings.Trim(string(b[4:]), string(0))
|
||||
case typeInterfaceByIndex:
|
||||
if len(b[4:]) < 8 {
|
||||
if len(b[4:]) < 4 {
|
||||
return nil, errInvalidExtension
|
||||
}
|
||||
ifi.Index = int(binary.BigEndian.Uint64(b[4 : 4+8]))
|
||||
ifi.Index = int(binary.BigEndian.Uint32(b[4 : 4+4]))
|
||||
case typeInterfaceByAddress:
|
||||
if len(b[4:]) < 4 {
|
||||
return nil, errInvalidExtension
|
||||
|
12
vendor/golang.org/x/net/icmp/ipv4.go
generated
vendored
12
vendor/golang.org/x/net/icmp/ipv4.go
generated
vendored
@ -17,8 +17,16 @@ import (
|
||||
// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.
|
||||
var freebsdVersion uint32
|
||||
|
||||
// ParseIPv4Header parses b as an IPv4 header of ICMP error message
|
||||
// invoking packet, which is contained in ICMP error message.
|
||||
// ParseIPv4Header returns the IPv4 header of the IPv4 packet that
|
||||
// triggered an ICMP error message.
|
||||
// This is found in the Data field of the ICMP error message body.
|
||||
//
|
||||
// The provided b must be in the format used by a raw ICMP socket on
|
||||
// the local system.
|
||||
// This may differ from the wire format, and the format used by a raw
|
||||
// IP socket, depending on the system.
|
||||
//
|
||||
// To parse an IPv6 header, use ipv6.ParseHeader.
|
||||
func ParseIPv4Header(b []byte) (*ipv4.Header, error) {
|
||||
if len(b) < ipv4.HeaderLen {
|
||||
return nil, errHeaderTooShort
|
||||
|
11
vendor/golang.org/x/net/icmp/message.go
generated
vendored
11
vendor/golang.org/x/net/icmp/message.go
generated
vendored
@ -24,10 +24,12 @@ import (
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
// BUG(mikio): This package is not implemented on JS, NaCl and Plan 9.
|
||||
// BUG(mikio): This package is not implemented on AIX, JS, NaCl and
|
||||
// Plan 9.
|
||||
|
||||
var (
|
||||
errInvalidConn = errors.New("invalid connection")
|
||||
errInvalidProtocol = errors.New("invalid protocol")
|
||||
errMessageTooShort = errors.New("message too short")
|
||||
errHeaderTooShort = errors.New("header too short")
|
||||
errBufferTooShort = errors.New("buffer too short")
|
||||
@ -80,7 +82,7 @@ func (m *Message) Marshal(psh []byte) ([]byte, error) {
|
||||
case ipv6.ICMPType:
|
||||
mtype = int(typ)
|
||||
default:
|
||||
return nil, errInvalidConn
|
||||
return nil, errInvalidProtocol
|
||||
}
|
||||
b := []byte{byte(mtype), byte(m.Code), 0, 0}
|
||||
if m.Type.Protocol() == iana.ProtocolIPv6ICMP && psh != nil {
|
||||
@ -130,7 +132,8 @@ var parseFns = map[Type]func(int, Type, []byte) (MessageBody, error){
|
||||
}
|
||||
|
||||
// ParseMessage parses b as an ICMP message.
|
||||
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
|
||||
// The provided proto must be either the ICMPv4 or ICMPv6 protocol
|
||||
// number.
|
||||
func ParseMessage(proto int, b []byte) (*Message, error) {
|
||||
if len(b) < 4 {
|
||||
return nil, errMessageTooShort
|
||||
@ -143,7 +146,7 @@ func ParseMessage(proto int, b []byte) (*Message, error) {
|
||||
case iana.ProtocolIPv6ICMP:
|
||||
m.Type = ipv6.ICMPType(b[0])
|
||||
default:
|
||||
return nil, errInvalidConn
|
||||
return nil, errInvalidProtocol
|
||||
}
|
||||
if fn, ok := parseFns[m.Type]; !ok {
|
||||
m.Body, err = parseDefaultMessageBody(proto, b[4:])
|
||||
|
6
vendor/golang.org/x/net/icmp/messagebody.go
generated
vendored
6
vendor/golang.org/x/net/icmp/messagebody.go
generated
vendored
@ -7,11 +7,13 @@ package icmp
|
||||
// A MessageBody represents an ICMP message body.
|
||||
type MessageBody interface {
|
||||
// Len returns the length of ICMP message body.
|
||||
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
|
||||
// The provided proto must be either the ICMPv4 or ICMPv6
|
||||
// protocol number.
|
||||
Len(proto int) int
|
||||
|
||||
// Marshal returns the binary encoding of ICMP message body.
|
||||
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
|
||||
// The provided proto must be either the ICMPv4 or ICMPv6
|
||||
// protocol number.
|
||||
Marshal(proto int) ([]byte, error)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user