LibDNS: Enable EXPLICIT_SYMBOL_EXPORT

This commit is contained in:
ayeteadoe 2025-08-07 14:38:31 -07:00 committed by Andrew Kaster
commit 1573ca35cc
Notes: github-actions[bot] 2025-08-24 18:59:32 +00:00
2 changed files with 7 additions and 6 deletions

View file

@ -2,5 +2,5 @@ set(SOURCES
Message.cpp Message.cpp
) )
ladybird_lib(LibDNS dns) ladybird_lib(LibDNS dns EXPLICIT_SYMBOL_EXPORT)
target_link_libraries(LibDNS PRIVATE LibCore PUBLIC LibCrypto) target_link_libraries(LibDNS PRIVATE LibCore PUBLIC LibCrypto)

View file

@ -11,6 +11,7 @@
#include <AK/IPv6Address.h> #include <AK/IPv6Address.h>
#include <AK/RedBlackTree.h> #include <AK/RedBlackTree.h>
#include <AK/Time.h> #include <AK/Time.h>
#include <LibDNS/Export.h>
namespace DNS { namespace DNS {
namespace Messages { namespace Messages {
@ -84,7 +85,7 @@ struct Header {
NetworkOrdered<u16> additional_count; NetworkOrdered<u16> additional_count;
}; };
struct DomainName { struct DNS_API DomainName {
Vector<ByteString> labels; Vector<ByteString> labels;
static DomainName from_string(StringView); static DomainName from_string(StringView);
@ -201,8 +202,8 @@ enum class ResourceType : u16 {
TA = 32768, // DNSSEC Trust Authorities "[Sam_Weiler][Deploying DNSSEC Without a Signed Root. Technical Report 1999-19, Information Networking Institute, Carnegie Mellon University, April 2004.]" TA = 32768, // DNSSEC Trust Authorities "[Sam_Weiler][Deploying DNSSEC Without a Signed Root. Technical Report 1999-19, Information Networking Institute, Carnegie Mellon University, April 2004.]"
DLV = 32769, // DNSSEC Lookaside Validation (OBSOLETE) [RFC8749][RFC4431] DLV = 32769, // DNSSEC Lookaside Validation (OBSOLETE) [RFC8749][RFC4431]
}; };
StringView to_string(ResourceType); DNS_API StringView to_string(ResourceType);
Optional<ResourceType> resource_type_from_string(StringView); DNS_API Optional<ResourceType> resource_type_from_string(StringView);
// Listing from IANA https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2. // Listing from IANA https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2.
enum class Class : u16 { enum class Class : u16 {
@ -693,7 +694,7 @@ using Record = Variant<
// TODO: Add more records. // TODO: Add more records.
ByteBuffer>; // Fallback for unknown records. ByteBuffer>; // Fallback for unknown records.
struct ResourceRecord { struct DNS_API ResourceRecord {
DomainName name; DomainName name;
ResourceType type; ResourceType type;
Class class_; Class class_;
@ -716,7 +717,7 @@ struct ZoneAuthority {
u32 minimum_ttl; u32 minimum_ttl;
}; };
struct Message { struct DNS_API Message {
Header header; Header header;
Vector<Question> questions; Vector<Question> questions;
Vector<ResourceRecord> answers; Vector<ResourceRecord> answers;