|
reSIProcate/rutil
9694
|
#include <DnsHostRecord.hxx>


Public Member Functions | |
| DnsHostRecord (const RROverlay &) | |
| DnsHostRecord (const Data name, const in_addr addr) | |
| ~DnsHostRecord () | |
| Data | host () const |
| in_addr | addr () const |
| const Data & | name () const |
| bool | isSameValue (const Data &value) const |
| EncodeStream & | dump (EncodeStream &strm) const |
Private Attributes | |
| in_addr | mAddr |
| Data | mName |
Definition at line 17 of file DnsHostRecord.hxx.
| DnsHostRecord::DnsHostRecord | ( | const RROverlay & | overlay | ) |
Definition at line 27 of file DnsHostRecord.cxx.
References resip::RROverlay::data(), mAddr, mName, resip::RROverlay::msg(), resip::RROverlay::msgLength(), name(), resip::RROverlay::nameLength(), and RRFIXEDSZ.
{
char* name = 0;
long len = 0;
int status = ares_expand_name(overlay.data()-overlay.nameLength()-RRFIXEDSZ, overlay.msg(), overlay.msgLength(), &name, &len);
(void)status;
assert(status == ARES_SUCCESS); // .kw. what should we do if bad?
mName = name;
free(name);
memcpy(&mAddr, overlay.data(), sizeof(in_addr));
}

| resip::DnsHostRecord::DnsHostRecord | ( | const Data | name, |
| const in_addr | addr | ||
| ) | [inline] |
| resip::DnsHostRecord::~DnsHostRecord | ( | ) | [inline] |
Definition at line 22 of file DnsHostRecord.hxx.
{}
| in_addr resip::DnsHostRecord::addr | ( | ) | const [inline] |
| EncodeStream & DnsHostRecord::dump | ( | EncodeStream & | strm | ) | const [virtual] |
Implements resip::DnsResourceRecord.
Definition at line 50 of file DnsHostRecord.cxx.
References resip::DnsUtil::inet_ntop(), mAddr, and mName.
{
strm << mName << "(A)--> " << DnsUtil::inet_ntop(mAddr);
return strm;
}

| Data DnsHostRecord::host | ( | ) | const |
Definition at line 39 of file DnsHostRecord.cxx.
References mAddr.
Referenced by resip::RRList::encodeRecordItem().
| bool DnsHostRecord::isSameValue | ( | const Data & | value | ) | const [virtual] |
Implements resip::DnsResourceRecord.
Definition at line 44 of file DnsHostRecord.cxx.
References resip::DnsUtil::inet_ntop(), and mAddr.
{
return DnsUtil::inet_ntop(mAddr) == value;
}

| const Data& resip::DnsHostRecord::name | ( | ) | const [inline, virtual] |
Implements resip::DnsResourceRecord.
Definition at line 27 of file DnsHostRecord.hxx.
References mName.
Referenced by DnsHostRecord(), and resip::RRList::encodeRecordItem().
{ return mName; }
in_addr resip::DnsHostRecord::mAddr [private] |
Definition at line 32 of file DnsHostRecord.hxx.
Referenced by addr(), DnsHostRecord(), dump(), host(), and isSameValue().
Data resip::DnsHostRecord::mName [private] |
Definition at line 33 of file DnsHostRecord.hxx.
Referenced by DnsHostRecord(), dump(), and name().
1.7.5.1