QMdnsEngine
0.1.0
Multicast DNS library for Qt applications
|
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. | |
Record & | operator= (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... | |
This class maintains information for an individual record. Not all record types use every field.
For example, to create a TXT record:
QHostAddress QMdnsEngine::Record::address | ( | ) | const |
This field is used by QMdnsEngine::A and QMdnsEngine::AAAA records.
QMap<QByteArray, QByteArray> QMdnsEngine::Record::attributes | ( | ) | const |
This field is used by QMdnsEngine::TXT records.
Bitmap QMdnsEngine::Record::bitmap | ( | ) | const |
This field is used by QMdnsEngine::NSEC records.
bool QMdnsEngine::Record::flushCache | ( | ) | const |
If true, this record replaces all previous records of the same name and type rather than appending to them.
QByteArray QMdnsEngine::Record::nextDomainName | ( | ) | const |
This field is used by QMdnsEngine::NSEC records.
quint16 QMdnsEngine::Record::port | ( | ) | const |
This field is used by QMdnsEngine::SRV records.
quint16 QMdnsEngine::Record::priority | ( | ) | const |
This field is used by QMdnsEngine::SRV records.
void QMdnsEngine::Record::setPriority | ( | quint16 | priority | ) |
Unless more than one QMdnsEngine::SRV record is being sent, this field should be set to 0.
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.
void QMdnsEngine::Record::setWeight | ( | quint16 | weight | ) |
Unless more than one QMdnsEngine::SRV record is being sent, this field should be set to 0.
QByteArray QMdnsEngine::Record::target | ( | ) | const |
This field is used by QMdnsEngine::PTR and QMdnsEngine::SRV records.
quint16 QMdnsEngine::Record::weight | ( | ) | const |
This field is used by QMdnsEngine::SRV records.