summaryrefslogtreecommitdiffstats
path: root/components/wifi_sync/wifi_security_class_chromeos.cc
blob: 6f3b10d7bd8665a7c135fc7572a563a9aa2045b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/wifi_sync/wifi_security_class.h"

#include "third_party/cros_system_api/dbus/service_constants.h"

namespace wifi_sync {

WifiSecurityClass WifiSecurityClassFromShillSecurity(
    const std::string& shill_security) {
  if (shill_security == shill::kSecurityNone)
    return SECURITY_CLASS_NONE;
  else if (shill_security == shill::kSecurityWep)
    return SECURITY_CLASS_WEP;
  else if (shill_security == shill::kSecurityPsk)
    return SECURITY_CLASS_PSK;
  else if (shill_security == shill::kSecurity8021x)
    return SECURITY_CLASS_802_1X;
  return SECURITY_CLASS_INVALID;
}

}  // namespace wifi_sync