Browse Source

x/net/icmp: update package documentation

Also fixes typos.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/182410043
Mikio Hara 11 years ago
parent
commit
0d0e5840f7
3 changed files with 11 additions and 8 deletions
  1. 1 1
      icmp/listen_stub.go
  2. 1 1
      icmp/listen_unix.go
  3. 9 6
      icmp/message.go

+ 1 - 1
icmp/listen_stub.go

@@ -12,7 +12,7 @@ package icmp
 // For non-privileged datagram-oriented ICMP endpoints, network must
 // be "udp4" or "udp6". The endpoint allows to read, write a few
 // limited ICMP messages such as echo request and echo reply.
-// Currently only Dariwn and Linux support this.
+// Currently only Darwin and Linux support this.
 //
 // Examples:
 //	ListenPacket("udp4", "192.168.0.1")

+ 1 - 1
icmp/listen_unix.go

@@ -25,7 +25,7 @@ const sysIP_STRIPHDR = 0x17 // for now only darwin supports this option
 // For non-privileged datagram-oriented ICMP endpoints, network must
 // be "udp4" or "udp6". The endpoint allows to read, write a few
 // limited ICMP messages such as echo request and echo reply.
-// Currently only Dariwn and Linux support this.
+// Currently only Darwin and Linux support this.
 //
 // Examples:
 //	ListenPacket("udp4", "192.168.0.1")

+ 9 - 6
icmp/message.go

@@ -2,8 +2,11 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package icmp provides basic functions for the manipulation of ICMP
-// message.
+// Package icmp provides basic functions for the manipulation of
+// messages used in the Internet Control Message Protocols,
+// ICMPv4 and ICMPv6.
+//
+// ICMPv4 and ICMPv6 are defined in RFC 792 and RFC 4443.
 package icmp
 
 import (
@@ -38,12 +41,12 @@ type Message struct {
 
 // Marshal returns the binary enconding of the ICMP message m.
 //
-// For ICMP for IPv4 message, the returned message always contains the
+// For an ICMPv4 message, the returned message always contains the
 // calculated checksum field.
 //
-// For ICMP for IPv6 message, the returned message contains the
-// calculated checksum field when psh is not nil, otherwise the kernel
-// will compute the checksum field during the message transmission.
+// For an ICMPv6 message, the returned message contains the calculated
+// checksum field when psh is not nil, otherwise the kernel will
+// compute the checksum field during the message transmission.
 // When psh is not nil, it must be the pseudo header for IPv6.
 func (m *Message) Marshal(psh []byte) ([]byte, error) {
 	var mtype int