+typedef pair<string, Input::Encoding> InputKey;
+
+namespace {
+
+struct OrderByConnectionTime {
+ bool operator() (const ClientProto &a, const ClientProto &b) const {
+ if (a.connect_time_sec() != b.connect_time_sec())
+ return a.connect_time_sec() < b.connect_time_sec();
+ return a.connect_time_nsec() < b.connect_time_nsec();
+ }
+};
+
+// An arbitrary ordering.
+struct AcceptorConfigCompare {
+ bool operator() (const AcceptorConfig &a, const AcceptorConfig &b) const {
+ int cmp = a.certificate_chain.compare(b.certificate_chain);
+ if (cmp != 0) {
+ return cmp < 0;
+ }
+
+ cmp = a.private_key.compare(b.private_key);
+ if (cmp != 0) {
+ return cmp < 0;
+ }
+
+ return Sockaddr6Compare()(a.addr, b.addr);
+ }
+};
+
+} // namespace
+