mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
icmp: update docs
Makes parameter names not start in capitals. Change-Id: I1861da0cbaff304b251f9540613cff8dc7beafd6 Reviewed-on: https://go-review.googlesource.com/126638 Reviewed-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,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
|
||||
|
||||
@@ -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