Skip to content

Commit

Permalink
Roll Fuchsia SDK from 398c4ca33f to dcd092a967
Browse files Browse the repository at this point in the history
netstack interfaces were moved to the fuchsia namespace, so automatic
roll would fail. Updated  BUILD.gn for the SDK and all dependencies
under //net

TBR=eroman@chromium.org

Change-Id: Ia0eb530ea4ec64100e579b6bca328ee4c68c474c
Reviewed-on: https://chromium-review.googlesource.com/1083884
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563934}
  • Loading branch information
SergeyUlanov authored and Commit Bot committed Jun 2, 2018
1 parent ae4fdb1 commit 6994c48
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build/fuchsia/sdk.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
da9c6cf50659326df8c39d1f53ab7d2b1eab2df6
dcd092a967d3bc8e2e233063ce2e439bbb9ec5a6
16 changes: 8 additions & 8 deletions net/base/network_interfaces_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

#include "net/base/network_interfaces.h"

#include <netstack/cpp/fidl.h>
#include <fuchsia/netstack/cpp/fidl.h>

#include "base/fuchsia/component_context.h"
#include "net/base/ip_endpoint.h"

namespace net {

IPAddress NetAddressToIPAddress(const netstack::NetAddress& addr) {
IPAddress NetAddressToIPAddress(const fuchsia::netstack::NetAddress& addr) {
if (addr.ipv4) {
return IPAddress(addr.ipv4->addr.data(), addr.ipv4->addr.count());
}
Expand All @@ -22,25 +22,25 @@ IPAddress NetAddressToIPAddress(const netstack::NetAddress& addr) {
}

bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
netstack::NetstackSyncPtr netstack =
fuchsia::netstack::NetstackSyncPtr netstack =
base::fuchsia::ComponentContext::GetDefault()
->ConnectToServiceSync<netstack::Netstack>();
->ConnectToServiceSync<fuchsia::netstack::Netstack>();

fidl::VectorPtr<netstack::NetInterface> interfaces;
fidl::VectorPtr<fuchsia::netstack::NetInterface> interfaces;
if (!netstack->GetInterfaces(&interfaces))
return false;

for (auto& interface : interfaces.get()) {
// Check if the interface is up.
if (!(interface.flags & netstack::NetInterfaceFlagUp))
if (!(interface.flags & fuchsia::netstack::NetInterfaceFlagUp))
continue;

// Skip loopback.
if (interface.features & netstack::interfaceFeatureLoopback)
if (interface.features & fuchsia::netstack::interfaceFeatureLoopback)
continue;

NetworkChangeNotifier::ConnectionType connection_type =
(interface.features & netstack::interfaceFeatureWlan)
(interface.features & fuchsia::netstack::interfaceFeatureWlan)
? NetworkChangeNotifier::CONNECTION_WIFI
: NetworkChangeNotifier::CONNECTION_UNKNOWN;

Expand Down
3 changes: 3 additions & 0 deletions third_party/fuchsia-sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ fuchsia_sdk_fidl_pkg("mem") {
}

fuchsia_sdk_fidl_pkg("netstack") {
namespace = "fuchsia"
namespace_path = "fuchsia"

sources = [
"net_address.fidl",
"netstack.fidl",
Expand Down

0 comments on commit 6994c48

Please sign in to comment.