Commit 8d04b09a authored by Mikio Hara's avatar Mikio Hara

icmp: update docs

Makes parameter names not start in capitals.

Change-Id: I1861da0cbaff304b251f9540613cff8dc7beafd6
Reviewed-on: https://go-review.googlesource.com/126638Reviewed-by: 's avatarMatt Layher <mdlayher@gmail.com>
parent 17b7cf40
......@@ -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)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment