From ffd7a5acb6c580c82365de9ae9f7750a9dfe7755 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 30 Mar 2011 15:44:28 +0200 Subject: [PATCH] documentation --- dnssec.go | 2 +- nsec3.go | 13 +++++++------ resolver.go | 7 ++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dnssec.go b/dnssec.go index 46be2889..4872ec68 100644 --- a/dnssec.go +++ b/dnssec.go @@ -158,7 +158,7 @@ func (k *RR_DNSKEY) ToDS(h int) *RR_DS { // the values: Inception, Expiration, KeyTag, SignerName and Algorithm. // The rest is copied from the RRset. Returns true when the signing went OK. // The Signature data in the RRSIG is filled by this method. -// There is no check if rrset is a proper (RFC 2181) RRSet. +// There is no check if RRSet is a proper (RFC 2181) RRSet. func (s *RR_RRSIG) Sign(k PrivateKey, rrset RRset) bool { if k == nil { return false diff --git a/nsec3.go b/nsec3.go index bd121ba3..61368192 100644 --- a/nsec3.go +++ b/nsec3.go @@ -11,8 +11,8 @@ type saltWireFmt struct { Salt string "size-hex" } -// Hash a string/label according to RFC5155 -func HashName(label string, ha int, iterations int, salt string) string { +// Hash a string/label according to RFC5155. +func hashName(label string, ha int, iterations int, salt string) string { saltwire := new(saltWireFmt) saltwire.Salt = salt wire := make([]byte, DefaultMsgSize) @@ -49,9 +49,10 @@ func HashName(label string, ha int, iterations int, salt string) string { return unpackBase32(nsec3) } -// Hash the ownername and the next owner name in -// an NSEC3 record, use the parameters from the NSEC3 itself. +// Hash the ownername and the next owner name in an NSEC3 record according +// to RFC 5155. +// Use the parameters from the NSEC3 itself. func (nsec3 *RR_NSEC3) HashNames() { - nsec3.Header().Name = HashName(nsec3.Header().Name, int(nsec3.Hash), int(nsec3.Iterations), nsec3.Salt) - nsec3.NextDomain = HashName(nsec3.NextDomain, int(nsec3.Hash), int(nsec3.Iterations), nsec3.Salt) + nsec3.Header().Name = hashName(nsec3.Header().Name, int(nsec3.Hash), int(nsec3.Iterations), nsec3.Salt) + nsec3.NextDomain = hashName(nsec3.NextDomain, int(nsec3.Hash), int(nsec3.Iterations), nsec3.Salt) } diff --git a/resolver.go b/resolver.go index dd540a81..7ffaad8f 100644 --- a/resolver.go +++ b/resolver.go @@ -11,7 +11,7 @@ import ( ) // These channels are global so that all parts of the application -// can send queries (or even pick them up) +// can send queries (or even pick them up). var ( // Request an async query by sending to this channel. QueryRequest chan *Query @@ -85,8 +85,9 @@ func query(n string, f func(*Conn, *Msg)) { panic("not reached") } -// Simple query function that waits for and returns the reply. -func QuerySimple(n string, d *Conn, m *Msg) (*Msg, os.Error) { +// QuerySimple performs a query and waits for the reply before +// returning. +func SimpleQuery(n string, d *Conn, m *Msg) (*Msg, os.Error) { err := d.Dial(n) if err != nil { return nil, err