diff options
| author | Tero Marttila <[email protected]> | 2016-06-19 19:46:23 +0300 |
|---|---|---|
| committer | Tero Marttila <[email protected]> | 2016-06-19 19:46:23 +0300 |
| commit | 9026b24cc14cbf8806b1d706e3768169dcc4d0c8 (patch) | |
| tree | d6cdf4212d41037f1f8c23386d770478be21bbce /dns.go | |
| parent | adab1510c992ba09983f6cbeebe46fe07eedaa5d (diff) | |
split up modules
Diffstat (limited to 'dns.go')
| -rw-r--r-- | dns.go | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +package main + +import ( + "github.com/miekg/dns" + "fmt" +) + +const TSIG_FUDGE_SECONDS = 300 +type TSIGAlgorithm string + +func (t *TSIGAlgorithm) UnmarshalFlag(value string) error { + switch (value) { + case "hmac-md5", "md5": + *t = dns.HmacMD5 + case "hmac-sha1", "sha1": + *t = dns.HmacSHA1 + case "hmac-sha256", "sha256": + *t = dns.HmacSHA256 + case "hmac-sha512", "sha512": + *t = dns.HmacSHA512 + default: + return fmt.Errorf("Invalid --tsig-algorithm=%v", value) + } + + return nil +} |
