Encoded DNS name. More...

#include <Name.h>

Collaboration diagram for mDNS::Name:

Public Member Functions

 Name (Message &message, uint16_t ptr)
 
MessagegetMessage () const
 
uint16_t getDataLength () const
 Get number of bytes occupied by the name Not the same as the string length because content is encoded. More...
 
String toString () const
 
 operator String () const
 
Name getDomain () const
 Get the last element of the name, which must be the domain. More...
 
Name getProtocol () const
 Get the service name. More...
 
Name getService () const
 Get the service name. More...
 
bool equalsIgnoreCase (const char *str, size_t length) const
 
bool equalsIgnoreCase (const String &value) const
 
bool operator== (const String &value) const
 
bool operator!= (const String &value) const
 
uint16_t getPtr () const
 
uint16_t makePointer () const
 Ensure a pointer refers to actual content, not another pointer. More...
 
bool fixup (const Name &other)
 Fixup pointer at end of name to point to another name. More...
 

Static Public Attributes

static constexpr size_t maxLength {256}
 

Detailed Description

Encoded DNS name.

mDNS-SD names are represented as instance.service.domain. See https://tools.ietf.org/html/rfc6763#section-4.1

Instance names should be friendly and not attempt to be unique. See https://tools.ietf.org/html/rfc6763#appendix-D

Example: "UDP Server._http._tcp.local" instance: "UDP Server" service: "_http._tcp" name: "http" protocol: Protocol::Tcp domain: "local"

Constructor & Destructor Documentation

◆ Name()

mDNS::Name::Name ( Message message,
uint16_t  ptr 
)
inline

Member Function Documentation

◆ equalsIgnoreCase() [1/2]

bool mDNS::Name::equalsIgnoreCase ( const char *  str,
size_t  length 
) const

◆ equalsIgnoreCase() [2/2]

bool mDNS::Name::equalsIgnoreCase ( const String value) const
inline

◆ fixup()

bool mDNS::Name::fixup ( const Name other)

Fixup pointer at end of name to point to another name.

Parameters
otherWhere to point to
Return values
booltrue on success, false if name does not end with a pointer

◆ getDataLength()

uint16_t mDNS::Name::getDataLength ( ) const

Get number of bytes occupied by the name Not the same as the string length because content is encoded.

◆ getDomain()

Name mDNS::Name::getDomain ( ) const

Get the last element of the name, which must be the domain.

Return values
NameThis Result

"UDP Server._http._tcp.local" "local" "UDP Server._http._tcp.my.domain.local" "my.domain.local"

◆ getMessage()

Message& mDNS::Name::getMessage ( ) const
inline

◆ getProtocol()

Name mDNS::Name::getProtocol ( ) const

Get the service name.

Return values
NameThis Result

"UDP Server._http._tcp.local" "_tcp.local"

◆ getPtr()

uint16_t mDNS::Name::getPtr ( ) const
inline

◆ getService()

Name mDNS::Name::getService ( ) const

Get the service name.

Return values
NameThis Result

"UDP Server._http._tcp.local" "_http._tcp.local"

◆ makePointer()

uint16_t mDNS::Name::makePointer ( ) const

Ensure a pointer refers to actual content, not another pointer.

◆ operator String()

mDNS::Name::operator String ( ) const
inline

◆ operator!=()

bool mDNS::Name::operator!= ( const String value) const
inline

◆ operator==()

bool mDNS::Name::operator== ( const String value) const
inline

◆ toString()

String mDNS::Name::toString ( ) const

Member Data Documentation

◆ maxLength

constexpr size_t mDNS::Name::maxLength {256}
staticconstexpr

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