diff --git a/msg.go b/msg.go index 2bd08257..b26f1a2e 100644 --- a/msg.go +++ b/msg.go @@ -286,7 +286,7 @@ End: // In theory, the pointers are only allowed to jump backward. // We let them jump anywhere and stop jumping after a while. -// UnpackDomainName unpack a domain name. +// UnpackDomainName unpacks a domain name into a string. func UnpackDomainName(msg []byte, off int) (s string, off1 int, ok bool) { s = "" lenmsg := len(msg) @@ -1041,7 +1041,8 @@ func (h *MsgHdr) String() string { return s } -// Pack a msg: convert it to wire format. +// Pack packs a Msg: it is converted to to wire format. +// If the dns.Compress is true the message will be in compressed wire format. func (dns *Msg) Pack() (msg []byte, ok bool) { var dh Header compression := make(map[string]int) // Compression pointer mappings @@ -1109,7 +1110,7 @@ func (dns *Msg) Pack() (msg []byte, ok bool) { return msg[:off], true } -// Unpack a binary message to a Msg structure. +// Unpack unpacks a binary message to a Msg structure. func (dns *Msg) Unpack(msg []byte) bool { // Header. var dh Header diff --git a/update.go b/update.go index ed281594..0edeee9e 100644 --- a/update.go +++ b/update.go @@ -125,7 +125,7 @@ func (u *Msg) RRsetNotUsed(rr []RR) { // NONE rrset rr Delete an RR from RRset RRsetDeleteRR // zone rrset rr Add to an RRset RRsetAddRdata -// RRsetAddRdata adds an complete RRset, see RFC 2136 section 2.5.1 +// RRsetAddRdata creates a dynamic update packet that adds an complete RRset, see RFC 2136 section 2.5.1 func (u *Msg) RRsetAddRdata(rr []RR) { if len(u.Question) == 0 { panic("empty question section") @@ -137,7 +137,7 @@ func (u *Msg) RRsetAddRdata(rr []RR) { } } -// RRsetDelete deletes an RRset, see RFC 2136 section 2.5.2 +// RRsetDelete creates a dynamic update packet that deletes an RRset, see RFC 2136 section 2.5.2 func (u *Msg) RRsetDelete(rr []RR) { u.Ns = make([]RR, len(rr)) for i, r := range rr { @@ -148,7 +148,7 @@ func (u *Msg) RRsetDelete(rr []RR) { } } -// NameDelete deletes all RRsets of a name, see RFC 2136 section 2.5.3 +// NameDelete creates a dynamic update packet that deletes all RRsets of a name, see RFC 2136 section 2.5.3 func (u *Msg) NameDelete(rr []RR) { u.Ns = make([]RR, len(rr)) for i, r := range rr { @@ -156,7 +156,7 @@ func (u *Msg) NameDelete(rr []RR) { } } -// RRsetDeleteRR deletes RR from the RRSset, see RFC 2136 section 2.5.4 +// RRsetDeleteRR creates a dynamic update packet deletes RR from the RRSset, see RFC 2136 section 2.5.4 func (u *Msg) RRsetDeleteRR(rr []RR) { u.Ns = make([]RR, len(rr)) for i, r := range rr {