Sese Framework
x.y.z
A cross-platform framework
|
DNS 包对象 更多...
#include <DnsPackage.h>
类 | |
struct | Answer |
DNS 应答 更多... | |
struct | DnsHeader |
struct | Flags |
DNS Flags 工具 更多... | |
class | Index |
DNS 打包压缩索引 更多... | |
struct | Question |
DNS 请求 更多... | |
Public 类型 | |
using | Authority = Answer |
DNS 权威应答 | |
using | Additional = Answer |
DNS 附加应答 | |
using | Ptr = std::shared_ptr<DnsPackage> |
Public 成员函数 | |
Index | buildIndex () |
bool | encode (void *buffer, size_t &length, Index &index) const |
std::vector< Question > & | getQuestions () |
std::vector< Answer > & | getAnswers () |
std::vector< Authority > & | getAuthorities () |
std::vector< Additional > & | getAdditionals () |
auto | getId () const |
auto | getFlags () const |
void | setId (uint16_t id) |
void | setFlags (uint16_t flags) |
静态 Public 成员函数 | |
static Ptr | new_ () |
static Ptr | decode (const uint8_t *buffer, size_t length) |
Private 成员函数 | |
DnsPackage ()=default | |
静态 Private 成员函数 | |
static std::string | decodeWords (const uint8_t *buffer, size_t length, size_t &offset) |
static bool | decodeAnswers (std::vector< Answer > &answers, size_t expect_size, const uint8_t *buffer, size_t length, size_t &pos) |
static std::string | encodeWords (const std::string &fullname) |
static bool | encodeQuestions (const std::vector< Question > &questions, void *buffer, size_t &length, Index &index, size_t offset) |
static bool | encodeAnswers (const std::vector< Answer > &answers, void *buffer, size_t &length, Index &index, size_t offset) |
Private 属性 | |
struct sese::net::dns::DnsPackage::DnsHeader | header |
std::vector< Question > | questions |
std::vector< Answer > | answers |
std::vector< Authority > | authorities |
std::vector< Additional > | additionals |
DNS 包对象
DNS 附加应答
DNS 权威应答
using sese::net::dns::DnsPackage::Ptr = std::shared_ptr<DnsPackage> |
|
privatedefault |
被这些函数引用 new_().
DnsPackage::Index DnsPackage::buildIndex | ( | ) |
|
static |
解析 DNS 原始包
buffer | DNS 包缓存 |
length | 缓存大小 |
引用了 sese::net::dns::DnsPackage::Question::class_, DECODE_HEADER, decodeAnswers(), decodeWords(), FromBigEndian16(), sese::net::dns::DnsPackage::Question::name, new_() , 以及 sese::net::dns::DnsPackage::Question::type.
被这些函数引用 sese::internal::net::service::dns::DnsService::handle().
|
staticprivate |
引用了 answers, sese::net::dns::DnsPackage::Answer::class_, sese::net::dns::DnsPackage::Answer::data, sese::net::dns::DnsPackage::Answer::data_length, decodeWords(), FromBigEndian16(), FromBigEndian32(), sese::net::dns::DnsPackage::Answer::name, sese::net::dns::DnsPackage::Answer::ttl , 以及 sese::net::dns::DnsPackage::Answer::type.
被这些函数引用 decode().
|
staticprivate |
解码 DNS 名称
buffer | 完整 buffer |
length | buffer 大小 |
offset | 需要解码的偏移位置,解码完成后停留在 00 位置 |
引用了 sese::text::AbstractStringBuffer::append(), decodeWords(), FromBigEndian16() , 以及 sese::text::AbstractStringBuffer::toString().
被这些函数引用 decode(), decodeAnswers() , 以及 decodeWords().
bool DnsPackage::encode | ( | void * | buffer, |
size_t & | length, | ||
Index & | index ) const |
将 DNS 包编码至缓存
buffer | 输出缓存 |
length | 输出缓存大小,执行成功将返回实际所用大小;若输入0则计算所需缓存大小,不执行实际打包操作 |
index | DNS 打包压缩索引 |
引用了 additionals, answers, authorities, sese::net::dns::DnsPackage::Index::clearPos(), encodeAnswers(), encodeQuestions(), sese::net::dns::DnsPackage::DnsHeader::flags, header, sese::net::dns::DnsPackage::DnsHeader::id, questions , 以及 ToBigEndian16().
|
staticprivate |
|
inlinenodiscard |
引用了 additionals.
|
inlinenodiscard |
引用了 authorities.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
引用了 questions.
|
static |
引用了 DnsPackage().
被这些函数引用 decode(), sese::internal::net::service::dns::DnsService::handle() , 以及 sese::net::dns::Resolver::resolve().
|
inline |
|
inline |
|
private |
被这些函数引用 buildIndex(), encode() , 以及 getAdditionals().
|
private |
被这些函数引用 buildIndex(), decodeAnswers(), encode(), encodeAnswers() , 以及 getAnswers().
|
private |
被这些函数引用 buildIndex(), encode() , 以及 getAuthorities().
|
private |
被这些函数引用 encode(), getFlags(), getId(), setFlags() , 以及 setId().
|
private |
被这些函数引用 buildIndex(), encode(), encodeQuestions() , 以及 getQuestions().