Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::DnsRR_SRV Struct Reference
+ Collaboration diagram for Slic3r::DnsRR_SRV:

Public Types

enum  { TAG = 0x21 , MIN_SIZE = 8 }
 

Static Public Member Functions

static optional< DnsRR_SRVdecode (const std::vector< char > &buffer, const DnsResource &rr, size_t dataoffset)
 

Public Attributes

uint16_t priority
 
uint16_t weight
 
uint16_t port
 
DnsName hostname
 

Detailed Description

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TAG 
MIN_SIZE 
275 {
276 TAG = 0x21,
277 MIN_SIZE = 8,
278 };
@ TAG
Definition Bonjour.cpp:276
@ MIN_SIZE
Definition Bonjour.cpp:277

Member Function Documentation

◆ decode()

static optional< DnsRR_SRV > Slic3r::DnsRR_SRV::decode ( const std::vector< char > &  buffer,
const DnsResource rr,
size_t  dataoffset 
)
inlinestatic
286 {
287 if (rr.data.size() < MIN_SIZE) {
288 return boost::none;
289 }
290
291 DnsRR_SRV res;
292
293 const uint16_t *data_16 = reinterpret_cast<const uint16_t*>(rr.data.data());
294 res.priority = endian::big_to_native(data_16[0]);
295 res.weight = endian::big_to_native(data_16[1]);
296 res.port = endian::big_to_native(data_16[2]);
297
298 size_t offset = dataoffset + 6;
299 auto hostname = DnsName::decode(buffer, offset);
300
301 if (hostname) {
302 res.hostname = std::move(*hostname);
303 return std::move(res);
304 } else {
305 return boost::none;
306 }
307 }
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, ClipperLib::JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:416
static optional< DnsName > decode(const std::vector< char > &buffer, size_t &offset, unsigned depth=0)
Definition Bonjour.cpp:48
DnsName hostname
Definition Bonjour.cpp:283
unsigned __int16 uint16_t
Definition unistd.h:78

References Slic3r::DnsResource::data, Slic3r::DnsName::decode(), hostname, MIN_SIZE, Slic3r::offset(), port, priority, and weight.

Referenced by Slic3r::DnsMessage::parse_rr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ hostname

DnsName Slic3r::DnsRR_SRV::hostname

Referenced by decode().

◆ port

uint16_t Slic3r::DnsRR_SRV::port

Referenced by decode().

◆ priority

uint16_t Slic3r::DnsRR_SRV::priority

Referenced by decode().

◆ weight

uint16_t Slic3r::DnsRR_SRV::weight

Referenced by decode().


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