reSIProcate/rutil  9694
Classes | Public Member Functions | Private Attributes
resip::DnsSrvRecord Class Reference

#include <DnsSrvRecord.hxx>

Inheritance diagram for resip::DnsSrvRecord:
Inheritance graph
[legend]
Collaboration diagram for resip::DnsSrvRecord:
Collaboration graph
[legend]

List of all members.

Classes

class  SrvException

Public Member Functions

 DnsSrvRecord (const RROverlay &)
 ~DnsSrvRecord ()
int priority () const
int & priority ()
int weight () const
int port () const
const Datatarget () const
const Dataname () const
bool isSameValue (const Data &value) const
EncodeStream & dump (EncodeStream &strm) const

Private Attributes

int mPriority
int mWeight
int mPort
Data mTarget
Data mName

Detailed Description

Definition at line 16 of file DnsSrvRecord.hxx.


Constructor & Destructor Documentation

DnsSrvRecord::DnsSrvRecord ( const RROverlay overlay)

Definition at line 26 of file DnsSrvRecord.cxx.

References resip::RROverlay::data(), mName, mPort, mPriority, resip::RROverlay::msg(), resip::RROverlay::msgLength(), mTarget, mWeight, name(), resip::RROverlay::nameLength(), and RRFIXEDSZ.

{
   char* name = 0;
   long len = 0;
   if (ARES_SUCCESS != ares_expand_name(overlay.data()-overlay.nameLength()-RRFIXEDSZ, overlay.msg(), overlay.msgLength(), &name, &len))
   {
      throw SrvException("Failed parse of SRV record", __FILE__, __LINE__);
   }
   mName = name;
   free(name);

   mPriority = DNS__16BIT(overlay.data());
   mWeight = DNS__16BIT(overlay.data() + 2);
   mPort = DNS__16BIT(overlay.data() + 4);

   if (ARES_SUCCESS != ares_expand_name(overlay.data() + 6, overlay.msg(), overlay.msgLength(), &name, &len))
   {
      throw SrvException("Failed parse of SRV record", __FILE__, __LINE__);
   }
   mTarget = name;
   free(name);
}

Here is the call graph for this function:

resip::DnsSrvRecord::~DnsSrvRecord ( ) [inline]

Definition at line 31 of file DnsSrvRecord.hxx.

{}

Member Function Documentation

EncodeStream & DnsSrvRecord::dump ( EncodeStream &  strm) const [virtual]

Implements resip::DnsResourceRecord.

Definition at line 55 of file DnsSrvRecord.cxx.

References mName, mPort, mPriority, mTarget, and mWeight.

{
   strm << mName << " (SRV) --> p=" << mPriority << " w=" << mWeight << " " << mTarget << ":" << mPort;
   return strm;
}
bool DnsSrvRecord::isSameValue ( const Data value) const [virtual]

Implements resip::DnsResourceRecord.

Definition at line 49 of file DnsSrvRecord.cxx.

References mPort, and mTarget.

{
   return value == (mTarget + ":" + Data(mPort));
}
const Data& resip::DnsSrvRecord::name ( ) const [inline, virtual]

Implements resip::DnsResourceRecord.

Definition at line 39 of file DnsSrvRecord.hxx.

References mName.

Referenced by DnsSrvRecord(), and resip::RRList::encodeRecordItem().

{ return mName; }
int resip::DnsSrvRecord::port ( ) const [inline]

Definition at line 37 of file DnsSrvRecord.hxx.

References mPort.

Referenced by resip::RRList::encodeRecordItem().

{ return mPort; }
int resip::DnsSrvRecord::priority ( ) const [inline]

Definition at line 34 of file DnsSrvRecord.hxx.

References mPriority.

Referenced by resip::RRList::encodeRecordItem(), and resip::RRVip::SrvTransform::transform().

{ return mPriority; }
int& resip::DnsSrvRecord::priority ( ) [inline]

Definition at line 35 of file DnsSrvRecord.hxx.

References mPriority.

{ return mPriority; }
const Data& resip::DnsSrvRecord::target ( ) const [inline]

Definition at line 38 of file DnsSrvRecord.hxx.

References mTarget.

Referenced by resip::RRList::encodeRecordItem().

{ return mTarget; }
int resip::DnsSrvRecord::weight ( ) const [inline]

Definition at line 36 of file DnsSrvRecord.hxx.

References mWeight.

Referenced by resip::RRList::encodeRecordItem().

{ return mWeight; }

Member Data Documentation

Definition at line 48 of file DnsSrvRecord.hxx.

Referenced by DnsSrvRecord(), dump(), and name().

Definition at line 46 of file DnsSrvRecord.hxx.

Referenced by DnsSrvRecord(), dump(), isSameValue(), and port().

Definition at line 44 of file DnsSrvRecord.hxx.

Referenced by DnsSrvRecord(), dump(), and priority().

Definition at line 47 of file DnsSrvRecord.hxx.

Referenced by DnsSrvRecord(), dump(), isSameValue(), and target().

Definition at line 45 of file DnsSrvRecord.hxx.

Referenced by DnsSrvRecord(), dump(), and weight().


The documentation for this class was generated from the following files: