OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/media/router/discovery/discovery_network_list_wifi.h" |
| 6 |
| 7 #include <string.h> |
| 8 #include <sys/ioctl.h> |
| 9 #include <sys/socket.h> |
| 10 #include <sys/types.h> |
| 11 |
| 12 #include <linux/wireless.h> |
| 13 |
| 14 #include "base/logging.h" |
| 15 #include "net/base/network_interfaces_linux.h" |
| 16 |
| 17 bool MaybeGetWifiSSID(const char* if_name, std::string* ssid) { |
| 18 DCHECK(if_name); |
| 19 |
| 20 auto maybe_ssid = net::internal::GetInterfaceSSID(if_name); |
| 21 if (maybe_ssid.size() > 0) { |
| 22 *ssid = std::move(maybe_ssid); |
| 23 return true; |
| 24 } |
| 25 return false; |
| 26 } |
OLD | NEW |