mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
546 B
C++
28 lines
546 B
C++
6 years ago
|
#include <llarp/dns/question.hpp>
|
||
|
|
||
|
namespace llarp
|
||
|
{
|
||
|
namespace dns
|
||
|
{
|
||
|
bool
|
||
|
Question::Encode(llarp_buffer_t* buf) const
|
||
|
{
|
||
|
if(!EncodeName(buf, qname))
|
||
|
return false;
|
||
|
if(!EncodeInt(buf, qtype))
|
||
|
return false;
|
||
|
return EncodeInt(buf, qclass);
|
||
|
}
|
||
|
|
||
|
bool
|
||
|
Question::Decode(llarp_buffer_t* buf)
|
||
|
{
|
||
|
if(!DecodeName(buf, qname))
|
||
|
return false;
|
||
|
if(!DecodeInt(buf, qtype))
|
||
|
return false;
|
||
|
return DecodeInt(buf, qclass);
|
||
|
}
|
||
|
} // namespace dns
|
||
|
} // namespace llarp
|