QMdnsEngine  0.1.0
Multicast DNS library for Qt applications
Public Member Functions | List of all members
QMdnsEngine::Record Class Reference

DNS record. More...

#include <qmdnsengine/record.h>

Public Member Functions

 Record ()
 Create an uninitialized record.
 
 Record (const Record &other)
 Create a copy of an existing record.
 
virtual ~Record ()
 Destroy the record.
 
void addAttribute (const QByteArray &key, const QByteArray &value)
 Add an attribute to the record.
 
QHostAddress address () const
 Retrieve the address for the record. More...
 
QMap< QByteArray, QByteArray > attributes () const
 Retrieve attributes for the record. More...
 
Bitmap bitmap () const
 Retrieve the bitmap for the record. More...
 
bool flushCache () const
 Determine whether to replace or append to existing records. More...
 
QByteArray name () const
 Retrieve the name of the record.
 
QByteArray nextDomainName () const
 Retrieve the next domain name. More...
 
bool operator!= (const Record &other) const
 Inequality operator.
 
Recordoperator= (const Record &other)
 Assignment operator.
 
bool operator== (const Record &other) const
 Equality operator.
 
quint16 port () const
 Retrieve the port for the record. More...
 
quint16 priority () const
 Retrieve the priority for the record. More...
 
void setAddress (const QHostAddress &address)
 Set the address for the record.
 
void setAttributes (const QMap< QByteArray, QByteArray > &attributes)
 Set attributes for the record.
 
void setBitmap (const Bitmap &bitmap)
 Set the bitmap for the record.
 
void setFlushCache (bool flushCache)
 Set whether to replace or append to existing records.
 
void setName (const QByteArray &name)
 Set the name of the record.
 
void setNextDomainName (const QByteArray &nextDomainName)
 Set the next domain name.
 
void setPort (quint16 port)
 Set the port for the record.
 
void setPriority (quint16 priority)
 Set the priority for the record. More...
 
void setTarget (const QByteArray &target)
 Set the target for the record.
 
void setTtl (quint32 ttl)
 Set the TTL (time to live) for the record.
 
void setType (quint16 type)
 Set the type of the record. More...
 
void setWeight (quint16 weight)
 Set the weight of the record. More...
 
QByteArray target () const
 Retrieve the target for the record. More...
 
quint32 ttl () const
 Retrieve the TTL (time to live) for the record.
 
quint16 type () const
 Retrieve the type of the record.
 
quint16 weight () const
 Retrieve the weight of the record. More...
 

Detailed Description

This class maintains information for an individual record. Not all record types use every field.

For example, to create a TXT record:

record.setName("My Service._http._tcp.local.");
record.setType(QMdnsEngine::TXT);
record.addAttribute("a", "value1");
record.addAttribute("b", "value2");
message.addRecord(record);

Member Function Documentation

§ address()

QHostAddress QMdnsEngine::Record::address ( ) const

This field is used by QMdnsEngine::A and QMdnsEngine::AAAA records.

§ attributes()

QMap<QByteArray, QByteArray> QMdnsEngine::Record::attributes ( ) const

This field is used by QMdnsEngine::TXT records.

§ bitmap()

Bitmap QMdnsEngine::Record::bitmap ( ) const

This field is used by QMdnsEngine::NSEC records.

§ flushCache()

bool QMdnsEngine::Record::flushCache ( ) const

If true, this record replaces all previous records of the same name and type rather than appending to them.

§ nextDomainName()

QByteArray QMdnsEngine::Record::nextDomainName ( ) const

This field is used by QMdnsEngine::NSEC records.

§ port()

quint16 QMdnsEngine::Record::port ( ) const

This field is used by QMdnsEngine::SRV records.

§ priority()

quint16 QMdnsEngine::Record::priority ( ) const

This field is used by QMdnsEngine::SRV records.

§ setPriority()

void QMdnsEngine::Record::setPriority ( quint16  priority)

Unless more than one QMdnsEngine::SRV record is being sent, this field should be set to 0.

§ setType()

void QMdnsEngine::Record::setType ( quint16  type)

For convenience, constants for types used by mDNS, such as QMdnsEngine::A or QMdnsEngine::PTR, may be used here.

§ setWeight()

void QMdnsEngine::Record::setWeight ( quint16  weight)

Unless more than one QMdnsEngine::SRV record is being sent, this field should be set to 0.

§ target()

QByteArray QMdnsEngine::Record::target ( ) const

This field is used by QMdnsEngine::PTR and QMdnsEngine::SRV records.

§ weight()

quint16 QMdnsEngine::Record::weight ( ) const

This field is used by QMdnsEngine::SRV records.


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