Kea  1.9.9-git
isc::dns::rdata::in::SRV Class Reference

rdata::SRV class represents the SRV RDATA as defined in RFC2782. More...

#include <rdataclass.h>

+ Inheritance diagram for isc::dns::rdata::in::SRV:

Public Member Functions

 SRV (const std::string &type_str)
 
 SRV (isc::util::InputBuffer &buffer, size_t rdata_len)
 
 SRV (const SRV &other)
 
 SRV (MasterLexer &lexer, const Name *name, MasterLoader::Options options, MasterLoaderCallbacks &callbacks)
 
 ~SRV ()
 The destructor. More...
 
virtual int compare (const Rdata &other) const
 Compare two instances of Rdata. More...
 
uint16_t getPort () const
 Return the value of the port field. More...
 
uint16_t getPriority () const
 Specialized methods. More...
 
const NamegetTarget () const
 Return the value of the target field. More...
 
uint16_t getWeight () const
 Return the value of the weight field. More...
 
SRVoperator= (const SRV &source)
 Assignment operator. More...
 
virtual std::string toText () const
 Convert an Rdata to a string. More...
 
virtual void toWire (isc::util::OutputBuffer &buffer) const
 Render the Rdata in the wire format into a buffer. More...
 
virtual void toWire (AbstractMessageRenderer &renderer) const
 Render the Rdata in the wire format into a MessageRenderer object. More...
 
- Public Member Functions inherited from isc::dns::rdata::Rdata
virtual uint16_t getLength () const
 Get the wire format length of an Rdata. More...
 
virtual ~Rdata ()
 The destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from isc::dns::rdata::Rdata
 Rdata ()
 The default constructor. More...
 

Detailed Description

rdata::SRV class represents the SRV RDATA as defined in RFC2782.

This class implements the basic interfaces inherited from the abstract rdata::Rdata class, and provides trivial accessors specific to the SRV RDATA.

Definition at line 2673 of file rdataclass.h.

Constructor & Destructor Documentation

isc::dns::rdata::in::SRV::SRV ( const std::string &  type_str)
explicit
isc::dns::rdata::in::SRV::SRV ( isc::util::InputBuffer buffer,
size_t  rdata_len 
)
isc::dns::rdata::in::SRV::SRV ( const SRV other)
isc::dns::rdata::in::SRV::SRV ( MasterLexer lexer,
const Name name,
MasterLoader::Options  options,
MasterLoaderCallbacks callbacks 
)
isc::dns::rdata::in::SRV::~SRV ( )

The destructor.

Member Function Documentation

virtual int isc::dns::rdata::in::SRV::compare ( const Rdata other) const
virtual

Compare two instances of Rdata.

This method compares this and the other Rdata objects in terms of the DNSSEC sorting order as defined in RFC4034, and returns the result as an integer.

This is a pure virtual method without the definition; the actual comparison logic is specific to each derived concrete class and should be explicitly defined in the derived class.

Specific implementations of this method must confirm that this and the other are objects of the same concrete derived class of Rdata. This is normally done by dynamic_cast in the implementation. It also means if the assumption isn't met an exception of class std::bad_cast will be thrown.

Here is an implementation choice: instead of relying on dynamic_cast, we could first convert the data into wire-format and compare the pair as opaque data. This would be more polymorphic, but might involve significant overhead, especially for a large size of RDATA.

Parameters
otherthe right-hand operand to compare against.
Returns
< 0 if this would be sorted before other.
0 if this is identical to other in terms of sorting order.
> 0 if this would be sorted after other.

Implements isc::dns::rdata::Rdata.

uint16_t isc::dns::rdata::in::SRV::getPort ( ) const

Return the value of the port field.

This method never throws an exception.

uint16_t isc::dns::rdata::in::SRV::getPriority ( ) const

Specialized methods.

Return the value of the priority field.

This method never throws an exception.

const Name& isc::dns::rdata::in::SRV::getTarget ( ) const

Return the value of the target field.

Returns
A reference to a Name class object corresponding to the internal target name.

This method never throws an exception.

uint16_t isc::dns::rdata::in::SRV::getWeight ( ) const

Return the value of the weight field.

This method never throws an exception.

SRV& isc::dns::rdata::in::SRV::operator= ( const SRV source)

Assignment operator.

It internally allocates a resource, and if it fails a corresponding standard exception will be thrown. This operator never throws an exception otherwise.

This operator provides the strong exception guarantee: When an exception is thrown the content of the assignment target will be intact.

virtual std::string isc::dns::rdata::in::SRV::toText ( ) const
virtual

Convert an Rdata to a string.

This method returns a std::string object representing the Rdata.

This is a pure virtual method without the definition; the actual representation is specific to each derived concrete class and should be explicitly defined in the derived class.

Returns
A string representation of Rdata.

Implements isc::dns::rdata::Rdata.

virtual void isc::dns::rdata::in::SRV::toWire ( isc::util::OutputBuffer buffer) const
virtual

Render the Rdata in the wire format into a buffer.

This is a pure virtual method without the definition; the actual conversion is specific to each derived concrete class and should be explicitly defined in the derived class.

Parameters
bufferAn output buffer to store the wire data.

Implements isc::dns::rdata::Rdata.

virtual void isc::dns::rdata::in::SRV::toWire ( AbstractMessageRenderer renderer) const
virtual

Render the Rdata in the wire format into a MessageRenderer object.

This is a pure virtual method without the definition; the actual conversion is specific to each derived concrete class and should be explicitly defined in the derived class.

Parameters
rendererDNS message rendering context that encapsulates the output buffer in which the Rdata is to be stored.

Implements isc::dns::rdata::Rdata.


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