[fuchsia/tun] Transition to final tun API names
Update Fuchsia tun driver to use new API.
This is CL 4/5 of the network tun multiport transition.
Bug: 75528
Change-Id: Id3a9b078499a05a10c0faacb64c550758826f989
diff --git a/src/inet/TunEndPoint.cpp b/src/inet/TunEndPoint.cpp
index 358cea5..866e422 100644
--- a/src/inet/TunEndPoint.cpp
+++ b/src/inet/TunEndPoint.cpp
@@ -91,8 +91,8 @@
return config;
}
-fuchsia::net::tun::DeviceConfig2 DefaultDeviceConfig() {
- fuchsia::net::tun::DeviceConfig2 config;
+fuchsia::net::tun::DeviceConfig DefaultDeviceConfig() {
+ fuchsia::net::tun::DeviceConfig config;
config.set_blocking(false);
return config;
}
@@ -118,7 +118,7 @@
WeaveLogError(Inet, "tunctl is not bound");
return INET_ERROR_INTERFACE_INIT_FAILURE;
}
- err = mTunCtl->CreateDevice2(std::move(config), mTunDevice.NewRequest());
+ err = mTunCtl->CreateDevice(std::move(config), mTunDevice.NewRequest());
if(err != ZX_OK) {
WeaveLogError(Inet, "tunctl failed to create device: %s", zx_status_get_string(err));
return INET_ERROR_INTERFACE_INIT_FAILURE;
@@ -653,7 +653,7 @@
#if WEAVE_SYSTEM_CONFIG_USE_FUCHSIA_TUN
fuchsia::net::tun::Frame frame;
- fuchsia::net::tun::Device2_WriteFrame_Result result;
+ fuchsia::net::tun::Device_WriteFrame_Result result;
if (msg == NULL) {
return INET_ERROR_BAD_ARGS;
}
@@ -986,7 +986,7 @@
p = msg->Start();
#ifdef WEAVE_SYSTEM_CONFIG_USE_FUCHSIA_TUN
- fuchsia::net::tun::Device2_ReadFrame_Result result;
+ fuchsia::net::tun::Device_ReadFrame_Result result;
if (!mTunCtl.is_bound()) {
WeaveLogError(Inet, "Can't read as mTunCtl is not bound");
ExitNow(err = ZX_ERR_BAD_STATE);
diff --git a/src/inet/TunEndPoint.h b/src/inet/TunEndPoint.h
index f54ce7a..9a6f9e5 100644
--- a/src/inet/TunEndPoint.h
+++ b/src/inet/TunEndPoint.h
@@ -205,7 +205,7 @@
#if WEAVE_SYSTEM_CONFIG_USE_FUCHSIA_TUN
fuchsia::net::tun::ControlSyncPtr mTunCtl;
- fuchsia::net::tun::Device2SyncPtr mTunDevice;
+ fuchsia::net::tun::DeviceSyncPtr mTunDevice;
fuchsia::net::tun::PortSyncPtr mTunPort;
fuchsia::net::stack::StackSyncPtr mStackPtr;
uint64_t mInterfaceId;