documentation

This commit is contained in:
Miek Gieben 2011-09-08 19:41:26 +02:00
parent e8b68c8621
commit 2de43f486f
2 changed files with 9 additions and 8 deletions

View File

@ -11,8 +11,9 @@ 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 {
// HashName hashes a string or label according to RFC5155. It returns
// the hashed string.
func HashName(label string, ha int, iterations int, salt string) string {
saltwire := new(saltWireFmt)
saltwire.Salt = salt
wire := make([]byte, DefaultMsgSize)

View File

@ -65,9 +65,9 @@ func (u *Update) NameNotUsed(rr []RR) {
// RRsetUsedFull sets the RRs in the prereq section to
// "RRset exists (value dependent -- with rdata)" RRs. RFC 2136 section 2.4.2.
func (u *Update) RRsetUsedFull(rr []RR) {
if len(u.Msg.Question) == 0 {
panic("empty question section")
}
if len(u.Msg.Question) == 0 {
panic("empty question section")
}
u.Answer = make([]RR, len(rr))
for i, r := range rr {
u.Answer[i] = r
@ -110,9 +110,9 @@ func (u *Update) RRsetNotUsed(rr []RR) {
// RRsetAddFull adds an complete RRset, see RFC 2136 section 2.5.1
func (u *Update) RRsetAddFull(rr []RR) {
if len(u.Msg.Question) == 0 {
panic("empty question section")
}
if len(u.Msg.Question) == 0 {
panic("empty question section")
}
u.Ns = make([]RR, len(rr))
for i, r := range rr {
u.Ns[i] = r