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

#include <RROverlay.hxx>

Collaboration diagram for resip::RROverlay:
Collaboration graph
[legend]

List of all members.

Classes

class  OverlayException

Public Member Functions

 RROverlay (const unsigned char *aptr, const unsigned char *abuf, int alen)
const unsigned char * data () const
const unsigned char * msg () const
int msgLength () const
int dataLength () const
int nameLength () const
int ttl () const
int type () const
const Datadomain () const

Private Attributes

const unsigned char * mData
const unsigned char * mMsg
int mMsgLen
int mDataLen
int mNameLen
int mTTL
int mType
Data mDomain

Friends

bool operator< (const RROverlay &r1, const RROverlay &r2)

Detailed Description

Definition at line 9 of file RROverlay.hxx.


Constructor & Destructor Documentation

RROverlay::RROverlay ( const unsigned char *  aptr,
const unsigned char *  abuf,
int  alen 
)

Definition at line 30 of file RROverlay.cxx.

References mData, mDataLen, mDomain, mMsg, mMsgLen, mNameLen, mTTL, mType, and RRFIXEDSZ.

                               : 
   mData(0),
   mMsg(0),
   mMsgLen(0),
   mDataLen(0),
   mNameLen(0),
   mTTL(0),
   mType(-1)
{
   char *name;
   long len = 0;

   // Parse the RR name. 
   int status = ares_expand_name(aptr, abuf, alen, &name, &len);
   if (status != ARES_SUCCESS)
   {
      throw OverlayException("Failed parse of RR", __FILE__, __LINE__);
   }
   mDomain = name;
   aptr += len;
   mNameLen = len;
   free(name);
      
   // Make sure there is enough data after the RR name for the fixed
   // part of the RR.
   if (aptr + RRFIXEDSZ > abuf + alen)
   {
      throw OverlayException("Failed parse of RR", __FILE__, __LINE__);
   }
   
   // Parse the fixed part of the RR, and advance to the RR data field. 
   //
   mType = DNS_RR_TYPE(aptr);
   mDataLen = DNS_RR_LEN(aptr);
   mTTL = DNS_RR_TTL(aptr);
   
   aptr += RRFIXEDSZ;
   if (aptr + mDataLen > abuf + alen)
   {
      throw OverlayException("Failed parse of RR", __FILE__, __LINE__);
   }

   mData = aptr;
   mMsgLen = alen;
   mMsg = abuf;
   aptr += mDataLen;
}

Member Function Documentation

const unsigned char* resip::RROverlay::data ( ) const [inline]
int resip::RROverlay::dataLength ( ) const [inline]

Definition at line 41 of file RROverlay.hxx.

References mDataLen.

Referenced by resip::DnsNaptrRecord::DnsNaptrRecord().

{ return mDataLen; }
const Data& resip::RROverlay::domain ( ) const [inline]

Definition at line 45 of file RROverlay.hxx.

References mDomain.

{ return mDomain; }
const unsigned char* resip::RROverlay::msg ( ) const [inline]
int resip::RROverlay::msgLength ( ) const [inline]
int resip::RROverlay::nameLength ( ) const [inline]
int resip::RROverlay::ttl ( ) const [inline]

Definition at line 43 of file RROverlay.hxx.

References mTTL.

{ return mTTL; }
int resip::RROverlay::type ( ) const [inline]

Definition at line 44 of file RROverlay.hxx.

References mType.

Referenced by resip::RRCache::getTTL().

{ return mType; }

Friends And Related Function Documentation

bool operator< ( const RROverlay r1,
const RROverlay r2 
) [friend]

Definition at line 11 of file RROverlay.hxx.

   {
      if (r1.mType < r2.mType)
      {
         return true;
      }
      if (r1.mType > r2.mType)
      {
         return false;
      }
      return r1.mDomain < r2.mDomain;
   }

Member Data Documentation

const unsigned char* resip::RROverlay::mData [private]

Definition at line 48 of file RROverlay.hxx.

Referenced by data(), and RROverlay().

Definition at line 51 of file RROverlay.hxx.

Referenced by dataLength(), and RROverlay().

Definition at line 55 of file RROverlay.hxx.

Referenced by domain(), and RROverlay().

const unsigned char* resip::RROverlay::mMsg [private]

Definition at line 49 of file RROverlay.hxx.

Referenced by msg(), and RROverlay().

Definition at line 50 of file RROverlay.hxx.

Referenced by msgLength(), and RROverlay().

Definition at line 52 of file RROverlay.hxx.

Referenced by nameLength(), and RROverlay().

int resip::RROverlay::mTTL [private]

Definition at line 53 of file RROverlay.hxx.

Referenced by RROverlay(), and ttl().

int resip::RROverlay::mType [private]

Definition at line 54 of file RROverlay.hxx.

Referenced by RROverlay(), and type().


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