diff --git a/src/AP_WS_Connection.h b/src/AP_WS_Connection.h index f6aca4dc..f509072f 100644 --- a/src/AP_WS_Connection.h +++ b/src/AP_WS_Connection.h @@ -30,7 +30,6 @@ namespace OpenWifi { Poco::Logger &L, std::pair, std::shared_ptr> R); ~AP_WS_Connection(); - void LogOpenSslErrors(); void EndConnection(); void ProcessJSONRPCEvent(Poco::JSON::Object::Ptr &Doc); void ProcessJSONRPCResult(Poco::JSON::Object::Ptr Doc); diff --git a/src/framework/utils.cpp b/src/framework/utils.cpp index 36d3494a..8bcced29 100644 --- a/src/framework/utils.cpp +++ b/src/framework/utils.cpp @@ -888,99 +888,15 @@ namespace OpenWifi::Utils { return password; } -#if 0 -/* - Note that this function isn't used. It has been removed due to this deprecation warning: - #47 3.825 /owgw/src/framework/utils.cpp: In function 'std::vector OpenWifi::Utils::getNAPTRRecords(const std::string&)': + /* + Note that these 2 functions aren't used. They have been removed due to this deprecation warning: + // Function to query NAPTR records for a domain and return them in a vector + #47 3.825 /owgw/src/framework/utils.cpp: In function 'std::vector OpenWifi::Utils::getNAPTRRecords(const std::string&)': #47 3.825 /owgw/src/framework/utils.cpp:915:28: warning: 'int ns_sprintrr(const ns_msg*, const ns_rr*, const char*, const char*, char*, size_t)' is deprecated [-Wdeprecated-declarations] -#47 3.825 915 | ns_sprintrr(&handle, &rr, nullptr, nullptr, rdata, sizeof(rdata)); -#47 3.825 | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#47 3.825 In file included from /usr/include/resolv.h:60, -#47 3.825 from /owgw/src/framework/utils.cpp:17: -#47 3.825 /usr/include/arpa/nameser.h:408:17: note: declared here -#47 3.825 408 | int ns_sprintrr (const ns_msg *, const ns_rr *, -#47 3.825 | ^~~~~~~~~~~ -#47 3.833 /owgw/src/framework/utils.cpp: In function 'std::vector OpenWifi::Utils::getSRVRecords(const std::string&)': -#47 3.833 /owgw/src/framework/utils.cpp:952:28: warning: 'int ns_sprintrr(const ns_msg*, const ns_rr*, const char*, const char*, char*, size_t)' is deprecated [-Wdeprecated-declarations] -#47 3.833 952 | ns_sprintrr(&handle, &rr, nullptr, nullptr, rdata, sizeof(rdata)); -#47 3.833 | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#47 3.833 /usr/include/arpa/nameser.h:408:17: note: declared here -#47 3.833 408 | int ns_sprintrr (const ns_msg *, const ns_rr *, -#47 3.833 | ^~~~~~~~~~~ - */ -// Function to query NAPTR records for a domain and return them in a vector - std::vector getNAPTRRecords(const std::string& domain) { - std::vector naptrRecords; - - unsigned char buf[4096]; - ns_msg handle; - ns_initparse(buf, NS_PACKETSZ, &handle); - - // Query NAPTR records for the given domain - int response = res_query(domain.c_str(), ns_c_in, ns_t_naptr, buf, sizeof(buf)); - if (response < 0) { - return naptrRecords; - } - - if(ns_initparse(buf, response, &handle) < 0) { - return naptrRecords; - } - - // Iterate through the DNS response and extract NAPTR records - int count = ns_msg_count(handle, ns_s_an); - for (int i = 0; i < count; ++i) { - ns_rr rr; - if (ns_parserr(&handle, ns_s_an, i, &rr) == 0) { - char rdata[256]; - ns_sprintrr(&handle, &rr, nullptr, nullptr, rdata, sizeof(rdata)); - NAPTRRecord record; - std::istringstream os(rdata); - os >> record.name >> record.ttl >> record.rclass >> record.rtype >> record.order >> record.preference >> record.flags - >> record.service >> record.regexp >> record.replacement; - naptrRecords.push_back(record); - } - } - - return naptrRecords; - } std::vector getSRVRecords(const std::string& domain) { - std::vector srvRecords; - - // Buffer to hold the DNS response - unsigned char buf[4096]; - ns_msg handle; - ns_initparse(buf, NS_PACKETSZ, &handle); - - // Query NAPTR records for the given domain - int response = res_query(domain.c_str(), ns_c_in, ns_t_srv, buf, sizeof(buf)); - if (response < 0) { - std::cerr << "DNS query failed for " << domain << ": " << hstrerror(h_errno) << std::endl; - return srvRecords; - } - - if(ns_initparse(buf, response, &handle) < 0) { - return srvRecords; - } - - // Iterate through the DNS response and extract NAPTR records - int count = ns_msg_count(handle, ns_s_an); - for (int i = 0; i < count; ++i) { - ns_rr rr; - if (ns_parserr(&handle, ns_s_an, i, &rr) == 0) { - char rdata[256]; - ns_sprintrr(&handle, &rr, nullptr, nullptr, rdata, sizeof(rdata)); - SrvRecord record; - std::istringstream os(rdata); - os >> record.name >> record.ttl >> record.rclass >> record.rtype >> record.pref >> record.weight >> - record.port >> record.srvname ; - srvRecords.push_back(record); - } - } - - return srvRecords; - } -#endif - + #47 3.833 /owgw/src/framework/utils.cpp: In function 'std::vector OpenWifi::Utils::getSRVRecords(const std::string&)': + #47 3.833 /owgw/src/framework/utils.cpp:952:28: warning: 'int ns_sprintrr(const ns_msg*, const ns_rr*, const char*, const char*, char*, size_t)' is deprecated [-Wdeprecated-declarations] + */ } // namespace OpenWifi::Utils diff --git a/src/framework/utils.h b/src/framework/utils.h index 02e58192..093ca6a9 100644 --- a/src/framework/utils.h +++ b/src/framework/utils.h @@ -298,11 +298,10 @@ namespace OpenWifi::Utils { std::string replacement; }; -#if 0 // removed due to deprecation: see utils.cpp // Function to query NAPTR records for a domain and return them in a vector - std::vector getNAPTRRecords(const std::string& domain); -#endif + //std::vector getNAPTRRecords(const std::string& domain); + struct SrvRecord { std::string name; std::string ttl; @@ -314,10 +313,8 @@ namespace OpenWifi::Utils { std::string srvname; }; -#if 0 // removed due to deprecation: see utils.cpp - std::vector getSRVRecords(const std::string& domain); -#endif + // std::vector getSRVRecords(const std::string& domain); struct HostNameServerResult{ std::string Hostname;