msktname.h (msktutil-1.1.tar.bz2) | : | msktname.h (msktutil-1.2.1) | ||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
along with this program; if not, write to the Free Software | along with this program; if not, write to the Free Software | |||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |||
* | * | |||
*----------------------------------------------------------------------------- | *----------------------------------------------------------------------------- | |||
*/ | */ | |||
#include "config.h" | #include "config.h" | |||
#if defined(HAVE_LIBUDNS) | #if defined(HAVE_LIBUDNS) | |||
#include <udns.h> | #include <udns.h> | |||
#define inet_ntop dns_ntop | ||||
#elif defined(HAVE_NS_INITPARSE) && defined(HAVE_RES_SEARCH) | #elif defined(HAVE_NS_INITPARSE) && defined(HAVE_RES_SEARCH) | |||
#include <arpa/inet.h> | #include <arpa/inet.h> | |||
#include <arpa/nameser.h> | #include <arpa/nameser.h> | |||
#include <resolv.h> | #include <resolv.h> | |||
#if !defined(NS_MAXMSG) | #if !defined(NS_MAXMSG) | |||
#define NS_MAXMSG 65535 | #define NS_MAXMSG 65535 | |||
#endif | #endif | |||
#else | ||||
#include <arpa/inet.h> | ||||
#endif | ||||
#ifndef stringify | ||||
#define stringify(x) stringify_(x) | ||||
#define stringify_(x) #x | ||||
#endif | #endif | |||
#include <algorithm> | #include <algorithm> | |||
#include <cctype> | #include <cctype> | |||
#if defined(HAVE_NS_INITPARSE) | #if defined(HAVE_NS_INITPARSE) | |||
/* A quirk in glibc < 2.9 makes us pick up a symbol marked GLIBC_PRIVATE | /* A quirk in glibc < 2.9 makes us pick up a symbol marked GLIBC_PRIVATE | |||
* if we use ns_get16 from libresolv, leading to a broken RPM | * if we use ns_get16 from libresolv, leading to a broken RPM | |||
* that can only be installed with --nodeps. As a workaround, | * that can only be installed with --nodeps. As a workaround, | |||
* use a private version of ns_get16--it's simple enough. | * use a private version of ns_get16--it's simple enough. | |||
skipping to change at line 114 | skipping to change at line 122 | |||
/* Allow to sort by prio where a lower prio number means stronger | /* Allow to sort by prio where a lower prio number means stronger | |||
* preference, ie. the lowest sorting item is the most preferred. */ | * preference, ie. the lowest sorting item is the most preferred. */ | |||
bool operator<(const DnsSrvHost& other) const { | bool operator<(const DnsSrvHost& other) const { | |||
/* for ultimate confusion, prio and weight go in opposite | /* for ultimate confusion, prio and weight go in opposite | |||
* directions, ie. we prefer lower prio, but higher weight. */ | * directions, ie. we prefer lower prio, but higher weight. */ | |||
if (m_priority == other.m_priority) | if (m_priority == other.m_priority) | |||
return m_weight > other.m_weight; | return m_weight > other.m_weight; | |||
return m_priority < other.m_priority; | return m_priority < other.m_priority; | |||
}; | }; | |||
bool validate(bool nocanon); | /* Check host availability by opening a TCP connection to the objects's | |||
* <port>. If <service> is non-empty, use its associated port instead. */ | ||||
bool validate(bool nocanon, std::string service = ""); | ||||
}; | }; | |||
class DnsSrvQuery { | class DnsSrvQuery { | |||
private: | private: | |||
std::vector<DnsSrvHost> m_results; | std::vector<DnsSrvHost> m_results; | |||
public: | public: | |||
DnsSrvQuery() {}; | DnsSrvQuery() {}; | |||
DnsSrvQuery(const DnsSrvHost& host) { | DnsSrvQuery(const DnsSrvHost& host) { | |||
m_results.push_back(host); | m_results.push_back(host); | |||
}; | }; | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 11 lines changed or added |