15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2009 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef NET_BASE_CONNECTION_TYPE_HISTOGRAMS_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NET_BASE_CONNECTION_TYPE_HISTOGRAMS_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The UpdateConnectionTypeHistograms function collects statistics related
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to the number of MD5 certificates that our users are encountering.  The
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// information will help us decide when it is fine for browsers to stop
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// supporting MD5 certificates, in light of the recent MD5 certificate
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// collision attack (see "MD5 considered harmful today: Creating a rogue CA
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// certificate" at http://www.win.tue.nl/hashclash/rogue-ca/).
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace net {
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)enum ConnectionType {
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_ANY = 0,      // Any connection (SSL, HTTP, SPDY, etc)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_SSL = 1,      // An SSL connection
20eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  // 2 - Reserved - Was CONNECTION_SSL_MD5
21eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  // 3 - Reserved - Was CONNECTION_SSL_MD2
22eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  // 4 - Reserved - Was CONNECTION_SSL_MD4
23eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  // 5 - Reserved - Was CONNECTION_SSL_MD5_CA
24eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  // 6 - Reserved - Was CONNECTION_SSL_MD2_CA
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_HTTP = 7,     // An HTTP connection
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_SPDY = 8,     // A SPDY connection
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_SSL_SSL2 = 9,     // An SSL connection that uses SSL 2.0
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_SSL_SSL3 = 10,    // An SSL connection that uses SSL 3.0
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_SSL_TLS1 = 11,    // An SSL connection that uses TLS 1.0
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_SSL_TLS1_1 = 12,  // An SSL connection that uses TLS 1.1
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  CONNECTION_SSL_TLS1_2 = 13,  // An SSL connection that uses TLS 1.2
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  NUM_OF_CONNECTION_TYPES
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Update the connection type histograms.  |type| is the connection type.
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void UpdateConnectionTypeHistograms(ConnectionType type);
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace net
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // NET_BASE_CONNECTION_TYPE_HISTOGRAMS_H_
41