Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tunneling support from CHIP code base #2105

Merged
merged 2 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 1 addition & 67 deletions src/include/platform/CHIPDeviceConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,17 +565,6 @@
#define CHIP_DEVICE_CONFIG_THREAD_CONNECTIVITY_TIMEOUT 30000
#endif

// -------------------- Tunnel Configuration --------------------

/**
* CHIP_DEVICE_CONFIG_LWIP_SERVICE_TUN_IF_NAME
*
* Name of the service TUN interface on LwIP-based platforms.
*/
#ifndef CHIP_DEVICE_CONFIG_LWIP_SERVICE_TUN_IF_NAME
#define CHIP_DEVICE_CONFIG_LWIP_SERVICE_TUN_IF_NAME "tn"
#endif

// -------------------- Trait Manager Configuration --------------------

/**
Expand Down Expand Up @@ -604,34 +593,6 @@
#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 0
#endif

/**
* CHIP_DEVICE_CONFIG_ENABLE_FIXED_TUNNEL_SERVER
*
* Forces the use of a service tunnel server at a fixed IP address and port. This
* bypasses the need for a directory query to the service directory endpoint to
* determine the tunnel server address. When enabled, this option allows devices
* that haven't been service provisioned to establish a service tunnel.
*
* When this option is enabled, CHIP_DEVICE_CONFIG_TUNNEL_SERVER_ADDRESS must
* be set to the address of the tunnel server.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_FIXED_TUNNEL_SERVER
#define CHIP_DEVICE_CONFIG_ENABLE_FIXED_TUNNEL_SERVER 0
#endif

/** CHIP_DEVICE_CONFIG_TUNNEL_SERVER_ADDRESS
*
* The address of the server to which the device should establish a service tunnel.
*
* This value is only meaningful if CHIP_DEVICE_CONFIG_ENABLE_FIXED_TUNNEL_SERVER
* has been enabled.
*
* Note: Currently this must be a dot-notation IP address--not a host name.
*/
#ifndef CHIP_DEVICE_CONFIG_TUNNEL_SERVER_ADDRESS
#define CHIP_DEVICE_CONFIG_TUNNEL_SERVER_ADDRESS ""
#endif

/**
* CHIP_DEVICE_CONFIG_DISABLE_ACCOUNT_PAIRING
*
Expand Down Expand Up @@ -687,24 +648,9 @@
#error "If CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL set, then CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY must also be set."
#endif

/**
* @def CHIP_DEVICE_CONFIG_ENABLE_TUNNEL_TELEMETRY
*
* @brief
* Enable automatically uploading chip tunnel telemetry via trait on an interval.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_TUNNEL_TELEMETRY
#define CHIP_DEVICE_CONFIG_ENABLE_TUNNEL_TELEMETRY (0)
#endif

#if CHIP_DEVICE_CONFIG_ENABLE_TUNNEL_TELEMETRY && !CHIP_CONFIG_ENABLE_TUNNELING
#error "If CHIP_DEVICE_CONFIG_ENABLE_TUNNEL_TELEMETRY set, then CHIP_CONFIG_ENABLE_TUNNELING must also be set."
#endif

// Enable Network Telemetry feature if it is enabled for at lease one network.
#define CHIP_DEVICE_CONFIG_ENABLE_NETWORK_TELEMETRY \
(CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY || CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY || \
CHIP_DEVICE_CONFIG_ENABLE_TUNNEL_TELEMETRY)
(CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY || CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY)

/**
* @def CHIP_DEVICE_CONFIG_DEFAULT_TELEMETRY_INTERVAL_MS
Expand All @@ -719,18 +665,6 @@
#define CHIP_DEVICE_CONFIG_DEFAULT_TELEMETRY_INTERVAL_MS 90000
#endif

/**
* @def CHIP_DEVICE_CONFIG_DEFAULT_TUNNEL_TELEMETRY_INTERVAL_MS
*
* @brief
* This sets the default interval at which chip tunnel telemetry events
* will be logged to chip buffers.
*
*/
#ifndef CHIP_DEVICE_CONFIG_DEFAULT_TUNNEL_TELEMETRY_INTERVAL_MS
#define CHIP_DEVICE_CONFIG_DEFAULT_TUNNEL_TELEMETRY_INTERVAL_MS 300000
#endif

// -------------------- Event Logging Configuration --------------------

/**
Expand Down
16 changes: 0 additions & 16 deletions src/include/platform/CHIPDeviceEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ enum PublicEventTypes
*/
kInternetConnectivityChange,

/**
* Service Tunnel State Change
*
* Signals a change in connectivity of the device's IP tunnel to a chip-enabled service.
*/
kServiceTunnelStateChange,

/**
* Service Connectivity Change
*
Expand Down Expand Up @@ -316,21 +309,12 @@ struct ChipDeviceEvent final
ConnectivityChange IPv6;
} InternetConnectivityChange;
struct
{
ConnectivityChange Result;
bool IsRestricted;
} ServiceTunnelStateChange;
struct
{
struct
{
ConnectivityChange Result;
} Overall;
struct
{
ConnectivityChange Result;
} ViaTunnel;
struct
{
ConnectivityChange Result;
} ViaThread;
Expand Down
45 changes: 0 additions & 45 deletions src/include/platform/ConnectivityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ class ConnectivityManager
kThreadMode_Enabled = 3,
};

enum ServiceTunnelMode
{
kServiceTunnelMode_NotSupported = 0,
kServiceTunnelMode_Disabled = 1,
kServiceTunnelMode_Enabled = 2,
};

enum CHIPoBLEServiceMode
{
kCHIPoBLEServiceMode_NotSupported = 0,
Expand Down Expand Up @@ -149,13 +142,6 @@ class ConnectivityManager
bool HaveIPv4InternetConnectivity(void);
bool HaveIPv6InternetConnectivity(void);

// Service tunnel methods
ServiceTunnelMode GetServiceTunnelMode(void);
CHIP_ERROR SetServiceTunnelMode(ServiceTunnelMode val);
bool IsServiceTunnelConnected(void);
bool IsServiceTunnelRestricted(void);
bool HaveServiceConnectivityViaTunnel(void);

// Service connectivity methods
bool HaveServiceConnectivity(void);

Expand Down Expand Up @@ -184,7 +170,6 @@ class ConnectivityManager
// Support methods
static const char * WiFiStationModeToStr(WiFiStationMode mode);
static const char * WiFiAPModeToStr(WiFiAPMode mode);
static const char * ServiceTunnelModeToStr(ServiceTunnelMode mode);
static const char * CHIPoBLEServiceModeToStr(CHIPoBLEServiceMode mode);

private:
Expand Down Expand Up @@ -361,11 +346,6 @@ inline CHIP_ERROR ConnectivityManager::GetAndLogWifiStatsCounters(void)
return static_cast<ImplClass *>(this)->_GetAndLogWifiStatsCounters();
}

inline bool ConnectivityManager::HaveServiceConnectivityViaTunnel(void)
{
return static_cast<ImplClass *>(this)->_HaveServiceConnectivityViaTunnel();
}

inline bool ConnectivityManager::HaveIPv4InternetConnectivity(void)
{
return static_cast<ImplClass *>(this)->_HaveIPv4InternetConnectivity();
Expand All @@ -376,26 +356,6 @@ inline bool ConnectivityManager::HaveIPv6InternetConnectivity(void)
return static_cast<ImplClass *>(this)->_HaveIPv6InternetConnectivity();
}

inline ConnectivityManager::ServiceTunnelMode ConnectivityManager::GetServiceTunnelMode(void)
{
return static_cast<ImplClass *>(this)->_GetServiceTunnelMode();
}

inline CHIP_ERROR ConnectivityManager::SetServiceTunnelMode(ServiceTunnelMode val)
{
return static_cast<ImplClass *>(this)->_SetServiceTunnelMode(val);
}

inline bool ConnectivityManager::IsServiceTunnelConnected(void)
{
return static_cast<ImplClass *>(this)->_IsServiceTunnelConnected();
}

inline bool ConnectivityManager::IsServiceTunnelRestricted(void)
{
return static_cast<ImplClass *>(this)->_IsServiceTunnelRestricted();
}

inline bool ConnectivityManager::HaveServiceConnectivity(void)
{
return static_cast<ImplClass *>(this)->_HaveServiceConnectivity();
Expand Down Expand Up @@ -556,11 +516,6 @@ inline const char * ConnectivityManager::WiFiAPModeToStr(WiFiAPMode mode)
return ImplClass::_WiFiAPModeToStr(mode);
}

inline const char * ConnectivityManager::ServiceTunnelModeToStr(ServiceTunnelMode mode)
{
return ImplClass::_ServiceTunnelModeToStr(mode);
}

inline const char * ConnectivityManager::CHIPoBLEServiceModeToStr(CHIPoBLEServiceMode mode)
{
return ImplClass::_CHIPoBLEServiceModeToStr(mode);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ void GenericConnectivityManagerImpl_Thread<ImplClass>::UpdateServiceConnectivity
event.Type = DeviceEventType::kServiceConnectivityChange;
event.ServiceConnectivityChange.ViaThread.Result =
(haveServiceConnectivity) ? kConnectivity_Established : kConnectivity_Lost;
event.ServiceConnectivityChange.ViaTunnel.Result = kConnectivity_NoChange;
event.ServiceConnectivityChange.Overall.Result = (Impl()->HaveServiceConnectivityViaTunnel())
? kConnectivity_NoChange
: event.ServiceConnectivityChange.ViaThread.Result;
event.ServiceConnectivityChange.Overall.Result = event.ServiceConnectivityChange.ViaThread.Result;
PlatformMgr().PostEvent(&event);
}
}
Expand Down
12 changes: 0 additions & 12 deletions src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ config("inet_config") {
} else {
defines += [ "INET_CONFIG_ENABLE_TCP_ENDPOINT=0" ]
}
if (chip_inet_config_enable_tun_endpoint) {
defines += [ "INET_CONFIG_ENABLE_TUN_ENDPOINT=1" ]
} else {
defines += [ "INET_CONFIG_ENABLE_TUN_ENDPOINT=0" ]
}
if (chip_inet_config_enable_udp_endpoint) {
defines += [ "INET_CONFIG_ENABLE_UDP_ENDPOINT=1" ]
} else {
Expand Down Expand Up @@ -161,13 +156,6 @@ static_library("inet") {
]
}

if (chip_inet_config_enable_tun_endpoint) {
sources += [
"TunEndPoint.cpp",
"TunEndPoint.h",
]
}

if (chip_with_nlfaultinjection) {
sources += [ "InetFaultInjection.cpp" ]
public_deps += [ "${nlfaultinjection_root}:nlfaultinjection" ]
Expand Down
6 changes: 0 additions & 6 deletions src/inet/EndPointBasis.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ struct udp_pcb;
#if INET_CONFIG_ENABLE_TCP_ENDPOINT
struct tcp_pcb;
#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
#if INET_CONFIG_ENABLE_TUN_ENDPOINT
struct netif;
#endif // INET_CONFIG_ENABLE_TUN_ENDPOINT
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP

namespace chip {
Expand Down Expand Up @@ -116,9 +113,6 @@ class DLL_EXPORT EndPointBasis : public InetLayerBasis
#if INET_CONFIG_ENABLE_TCP_ENDPOINT
tcp_pcb * mTCP; /**< Transmission control protocol (TCP) control */
#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
#if INET_CONFIG_ENABLE_TUN_ENDPOINT
netif * mNetIf; /**< Tunnel interface control */
#endif // INET_CONFIG_ENABLE_TUN_ENDPOINT
};

enum
Expand Down
4 changes: 0 additions & 4 deletions src/inet/Inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,4 @@
#include <inet/UDPEndPoint.h>
#endif // INET_CONFIG_ENABLE_UDP_ENDPOINT

#if INET_CONFIG_ENABLE_TUN_ENDPOINT
#include <inet/TunEndPoint.h>
#endif // INET_CONFIG_ENABLE_TUN_ENDPOINT

#endif // !defined(INET_H)
Loading