X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/cdeb54d4626ddc841d8898a8283084a8de3b25ee..c5f22e483cc0f31f2938874370ac776e40792069:/apt-pkg/contrib/srvrec.h diff --git a/apt-pkg/contrib/srvrec.h b/apt-pkg/contrib/srvrec.h index 9323623a5..01b810281 100644 --- a/apt-pkg/contrib/srvrec.h +++ b/apt-pkg/contrib/srvrec.h @@ -26,9 +26,16 @@ class SrvRec int random_number_range_end; int random_number_range_max; - bool operator<(SrvRec const &other) const { - return this->priority < other.priority; + bool operator<(SrvRec const &other) const { + return this->priority < other.priority; } + bool operator==(SrvRec const &other) const; + + SrvRec(std::string const Target, u_int16_t const Priority, + u_int16_t const Weight, u_int16_t const Port) : + target(Target), priority(Priority), weight(Weight), port(Port), + random_number_range_start(0), random_number_range_end(0), + random_number_range_max(0) {} }; /** \brief Get SRV records from host/port (builds the query string internally) @@ -39,4 +46,9 @@ bool GetSrvRecords(std::string name, std::vector &Result); */ bool GetSrvRecords(std::string host, int port, std::vector &Result); +/** \brief Pop a single SRV record from the vector of SrvRec taking + * priority and weight into account + */ +SrvRec PopFromSrvRecs(std::vector &Recs); + #endif