From 722218abbc74b8422dd6cc0a22bc57970781b333 Mon Sep 17 00:00:00 2001 From: Soumava Bera Date: Tue, 4 Feb 2025 16:18:15 -0500 Subject: [PATCH] ipv6 --- include/aws/crt/dns.h | 18 ++++++++++++++++++ source/dns.cpp | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 include/aws/crt/dns.h create mode 100644 source/dns.cpp diff --git a/include/aws/crt/dns.h b/include/aws/crt/dns.h new file mode 100644 index 000000000..fe168c5ba --- /dev/null +++ b/include/aws/crt/dns.h @@ -0,0 +1,18 @@ +#pragma once +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +#include + +namespace Aws +{ + namespace Crt + { + + namespace dns + { + AWS_CRT_CPP_API bool IsValidIpV6(const char *host, bool is_uri_encoded); + } + } +} diff --git a/source/dns.cpp b/source/dns.cpp new file mode 100644 index 000000000..89c9e976a --- /dev/null +++ b/source/dns.cpp @@ -0,0 +1,23 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + + +#include +#include +#include + +namespace Aws +{ + namespace Crt + { + namespace dns + { + bool IsValidIpV6(const char *host, bool is_uri_encoded) + { + return aws_host_utils_is_ipv6(Aws::Crt::ByteCursorFromCString(host), is_uri_encoded); + } + } + } +} \ No newline at end of file