1
#pragma once
2

            
3
#include <memory>
4

            
5
#ifdef ENVOY_ENABLE_QUIC
6
#include "quiche/quic/core/quic_path_validator.h"
7

            
8
using NetworkHandle = quic::QuicNetworkHandle;
9
#else
10
using NetworkHandle = int64_t;
11
#endif
12

            
13
namespace Envoy {
14

            
15
namespace Quic {
16

            
17
// An interface to get network change notifications from the underlying platform.
18
class QuicNetworkConnectivityObserver {
19
public:
20
7
  virtual ~QuicNetworkConnectivityObserver() = default;
21

            
22
  // Called when the device switches to a different network.
23
  virtual void onNetworkMadeDefault(NetworkHandle network) PURE;
24

            
25
  // Called when a new network is connected.
26
  virtual void onNetworkConnected(NetworkHandle network) PURE;
27

            
28
  // Called when the given network gets disconnected.
29
  virtual void onNetworkDisconnected(NetworkHandle network) PURE;
30
};
31

            
32
using QuicNetworkConnectivityObserverPtr = std::unique_ptr<QuicNetworkConnectivityObserver>;
33

            
34
} // namespace Quic
35
} // namespace Envoy