OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::DnsResource Struct Reference
Collaboration diagram for Slic3r::DnsResource:

Public Member Functions

 DnsResource ()

Static Public Member Functions

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

Public Attributes

DnsName name
uint16_t type
uint16_t rclass
uint32_t ttl
std::vector< char > data

Detailed Description

Constructor & Destructor Documentation

◆ DnsResource()

Slic3r::DnsResource::DnsResource ( )
inline
215 : type(0)
216 , rclass(0)
217 , ttl(0)
218 {}
uint16_t type
Definition Bonjour.cpp:209
uint16_t rclass
Definition Bonjour.cpp:210
uint32_t ttl
Definition Bonjour.cpp:211

References rclass, ttl, and type.

Referenced by decode().

Here is the caller graph for this function:

Member Function Documentation

◆ decode()

optional< DnsResource > Slic3r::DnsResource::decode ( const std::vector< char > & buffer,
size_t & offset,
size_t & dataoffset )
inlinestatic
221 {
222 const size_t bsize = buffer.size();
223 if (offset + 1 >= bsize) {
224 return boost::none;
225 }
226
227 auto rname = DnsName::decode(buffer, offset);
228 if (!rname) {
229 return boost::none;
230 }
231
232 if (offset + 10 >= bsize) {
233 return boost::none;
234 }
235
236 DnsResource res;
237 res.name = std::move(*rname);
238 const uint16_t *data_16 = reinterpret_cast<const uint16_t*>(buffer.data() + offset);
239 res.type = endian::big_to_native(data_16[0]);
240 res.rclass = endian::big_to_native(data_16[1]);
241 res.ttl = endian::big_to_native(*reinterpret_cast<const uint32_t*>(data_16 + 2));
242 uint16_t rdlength = endian::big_to_native(data_16[4]);
243
244 offset += 10;
245 if (offset + rdlength > bsize) {
246 return boost::none;
247 }
248
249 dataoffset = offset;
250 res.data = std::vector<char>(buffer.begin() + offset, buffer.begin() + offset + rdlength);
251 offset += rdlength;
252
253 return std::move(res);
254 }
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582
static optional< DnsName > decode(const std::vector< char > &buffer, size_t &offset, unsigned depth=0)
Definition Bonjour.cpp:70
DnsResource()
Definition Bonjour.cpp:214

References DnsResource(), data, Slic3r::DnsName::decode(), name, Slic3r::offset(), rclass, ttl, and type.

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

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

Member Data Documentation

◆ data

◆ name

DnsName Slic3r::DnsResource::name

Referenced by decode().

◆ rclass

uint16_t Slic3r::DnsResource::rclass

Referenced by DnsResource(), and decode().

◆ ttl

uint32_t Slic3r::DnsResource::ttl

Referenced by DnsResource(), and decode().

◆ type

uint16_t Slic3r::DnsResource::type

Referenced by DnsResource(), and decode().


The documentation for this struct was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/Bonjour.cpp