]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/srvrec.h
improve CheckDropPrivsMustBeDisabled further
[apt.git] / apt-pkg / contrib / srvrec.h
index fd71e697f1eff67605d217176a463c55d9686aa9..e07edc68322377fde5389d25c96021eb15105773 100644 (file)
@@ -3,7 +3,7 @@
 /* ######################################################################
 
    SRV record support
-  
+
    ##################################################################### */
                                                                        /*}}}*/
 #ifndef SRVREC_H
@@ -21,6 +21,11 @@ class SrvRec
    u_int16_t weight;
    u_int16_t port;
 
+   // each server is assigned a interval [start, end] in the space of [0, max]
+   int random_number_range_start;
+   int random_number_range_end;
+   int random_number_range_max;
+
    bool operator<(SrvRec const &other) const { 
       return this->priority < other.priority; 
    }
@@ -34,4 +39,9 @@ bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result);
  */
 bool GetSrvRecords(std::string host, int port, std::vector<SrvRec> &Result);
 
+/** \brief Pop a single SRV record from the vector of SrvRec taking
+ *         priority and weight into account
+ */
+SrvRec PopFromSrvRecs(std::vector<SrvRec> &Recs);
+
 #endif