dnshostrecord.cxx

来自「这是国外的resip协议栈」· CXX 代码 · 共 53 行

CXX
53
字号
#if defined(HAVE_CONFIG_H)#include "rutil/config.hxx"#endif#include <stdlib.h>#if defined(USE_ARES)#include "ares.h"#include "ares_dns.h"#endif#ifndef __CYGWIN__#ifndef RRFIXEDSZ#define RRFIXEDSZ 10#endif#endif#include "rutil/Data.hxx"#include "rutil/DnsUtil.hxx"#include "rutil/BaseException.hxx"#include "RROverlay.hxx"#include "DnsResourceRecord.hxx"#include "DnsHostRecord.hxx"using namespace resip;DnsHostRecord::DnsHostRecord(const RROverlay& overlay){   char* name = 0;   int len = 0;   ares_expand_name(overlay.data()-overlay.nameLength()-RRFIXEDSZ, overlay.msg(), overlay.msgLength(), &name, &len);   mName = name;   free(name);   memcpy(&mAddr, overlay.data(), sizeof(in_addr));}Data DnsHostRecord::host() const{   return Data(inet_ntoa(mAddr));}bool DnsHostRecord::isSameValue(const Data& value) const{   return DnsUtil::inet_ntop(mAddr) == value;}std::ostream&DnsHostRecord::dump(std::ostream& strm) const{   strm << mName << "(A)--> " << DnsUtil::inet_ntop(mAddr);   return strm;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?