#include <cassert>
#include "dnsutil.h"
inline time_t CacheRRHeader::GetExpire() const { return m_tmExpire; }
inline time_t CacheRRHeader::GetTTL() const { return this->GetTTL(time(NULL)); }
inline time_t CacheRRHeader::GetTTL(time_t i_tmNow) const {
if (m_tmExpire <= i_tmNow) return 0;
return m_tmExpire - i_tmNow;
}
inline LabelListConstPtr RRHeader::GetName() const { return m_llpName; }
inline unsigned RRHeader::GetTTL() const { return m_uTTL; }
inline void CacheRRHeader::SetTTL(unsigned i_uTTL) {
m_tmExpire = time(NULL) + i_uTTL;
}
inline void RRHeader::SetName(LabelListPtr &i_llpr) { m_llpName = i_llpr; i_llpr = NULL; }
inline void RRHeader::SetTTL(unsigned i_uTTL) { m_uTTL = i_uTTL; }
inline bool CacheRRHeader::IsExpired(time_t i_tmNow) const {
if (m_tmExpire <= i_tmNow) return true;
return false;
}