From: Michal 'vorner' Vaner Date: Wed, 7 Nov 2012 09:45:32 +0000 (+0100) Subject: [2384] Document the use of units in TTL X-Git-Tag: trac2487_base~1^2~29^2~2^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f2d93292adc4282298bd82b7d4cb83f362d502e;p=thirdparty%2Fkea.git [2384] Document the use of units in TTL --- diff --git a/src/lib/dns/rrttl.h b/src/lib/dns/rrttl.h index 62bf8862ba..3b2bf42c06 100644 --- a/src/lib/dns/rrttl.h +++ b/src/lib/dns/rrttl.h @@ -74,15 +74,18 @@ public: explicit RRTTL(uint32_t ttlval) : ttlval_(ttlval) {} /// Constructor from a string. /// - /// This version of the implementation only accepts decimal TTL values in - /// seconds. - /// In a near future version, we'll extend it so that we can accept more - /// convenient ones such as "2H" or "1D". - /// - /// If the given string is not recognized as a valid representation of - /// an RR TTL, an exception of class \c InvalidRRTTL will be thrown. - /// - /// \param ttlstr A string representation of the \c RRTTL + /// It accepts either a decimal number, specifying number of seconds. Or, + /// it can be given a sequence of numbers and units, like "2H" (meaning + /// two hours), "1W3D" (one week and 3 days). The allowed units are W, D, + /// H, M and S. They can be also specified in lower-case. No further + /// restrictions are checked (so they can be specified in arbitrary order + /// and even things like "1D1D" can be used to specify two days). The + /// unit at the last number can be omitted in case it is seconds. + /// + /// \param ttlstr A string representation of the \c RRTTL. + /// + /// \throw InvalidRRTTL in case the string is not recognized as valid + /// TTL representation. explicit RRTTL(const std::string& ttlstr); /// Constructor from wire-format data. ///