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) { ...@@ -59,8 +59,9 @@ func (c *PacketConn) ReadFrom(b []byte) (int, net.Addr, error) {
} }
// WriteTo writes the ICMP message b to dst. // WriteTo writes the ICMP message b to dst.
// Dst must be net.UDPAddr when c is a non-privileged // The provided dst must be net.UDPAddr when c is a non-privileged
// datagram-oriented ICMP endpoint. Otherwise it must be net.IPAddr. // datagram-oriented ICMP endpoint.
// Otherwise it must be net.IPAddr.
func (c *PacketConn) WriteTo(b []byte, dst net.Addr) (int, error) { func (c *PacketConn) WriteTo(b []byte, dst net.Addr) (int, error) {
if !c.ok() { if !c.ok() {
return 0, errInvalidConn return 0, errInvalidConn
......
...@@ -14,11 +14,13 @@ import ( ...@@ -14,11 +14,13 @@ import (
// An Extension represents an ICMP extension. // An Extension represents an ICMP extension.
type Extension interface { type Extension interface {
// Len returns the length of ICMP extension. // 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 Len(proto int) int
// Marshal returns the binary encoding of ICMP extension. // 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) Marshal(proto int) ([]byte, error)
} }
......
...@@ -131,7 +131,8 @@ var parseFns = map[Type]func(int, Type, []byte) (MessageBody, error){ ...@@ -131,7 +131,8 @@ var parseFns = map[Type]func(int, Type, []byte) (MessageBody, error){
} }
// ParseMessage parses b as an ICMP message. // 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) { func ParseMessage(proto int, b []byte) (*Message, error) {
if len(b) < 4 { if len(b) < 4 {
return nil, errMessageTooShort return nil, errMessageTooShort
......
...@@ -7,11 +7,13 @@ package icmp ...@@ -7,11 +7,13 @@ package icmp
// A MessageBody represents an ICMP message body. // A MessageBody represents an ICMP message body.
type MessageBody interface { type MessageBody interface {
// Len returns the length of ICMP message body. // 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 Len(proto int) int
// Marshal returns the binary encoding of ICMP message body. // 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) 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